Repository navigation
Commit 1786361
committed
[InstCombine] Fold select -> and/or using impliesPoison
We can fold a ? b : false to a & b if is_poison(b) implies that
is_poison(a), at which point we're able to reuse all the usual fold
on ands. In particular, this covers the very common case of
icmp X, C && icmp X, C'. The same applies to ors.
This currently only has an effect if the
-instcombine-unsafe-select-transform=0 option is set.
Differential Revision: https://reviews.llvm.org/D945501 parent e433ca2 commit 1786361
2 files changed
Lines changed: 10 additions & 11 deletions
File tree
- llvm
- lib/Transforms/InstCombine
- test/Transforms/InstCombine
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2572 | 2572 | | |
2573 | 2573 | | |
2574 | 2574 | | |
2575 | | - | |
| 2575 | + | |
| 2576 | + | |
2576 | 2577 | | |
2577 | 2578 | | |
2578 | 2579 | | |
2579 | | - | |
| 2580 | + | |
| 2581 | + | |
2580 | 2582 | | |
2581 | 2583 | | |
2582 | 2584 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 106 | + | |
110 | 107 | | |
111 | 108 | | |
112 | 109 | | |
| |||
119 | 116 | | |
120 | 117 | | |
121 | 118 | | |
122 | | - | |
| 119 | + | |
123 | 120 | | |
124 | 121 | | |
125 | 122 | | |
| |||
132 | 129 | | |
133 | 130 | | |
134 | 131 | | |
135 | | - | |
136 | | - | |
137 | | - | |
| 132 | + | |
138 | 133 | | |
139 | 134 | | |
140 | 135 | | |
| |||
153 | 148 | | |
154 | 149 | | |
155 | 150 | | |
| 151 | + | |
156 | 152 | | |
157 | 153 | | |
158 | 154 | | |
| |||
173 | 169 | | |
174 | 170 | | |
175 | 171 | | |
| 172 | + | |
176 | 173 | | |
177 | 174 | | |
178 | 175 | | |
| |||
0 commit comments