Commit 77f75b4
committed
[InstCombine] Extend
Two ways to relaxed:
1) Only require one of the `and` ops to be single-use if both `X`
and `Y` are constant.
2) Special case, if `X ^ Y` is a negative power of 2, then
`Z ^ NegP2 ==/!= 0` will fold to `Z u</u>= -NegP2` which
creates no additional instructions so fold irrelivant of
use counts.
Closes #94867(icmp eq/ne (and Z, X), (and Z, Y)) folds1 parent 4ac158e commit 77f75b4
File tree
2 files changed
+29
-15
lines changed- llvm
- lib/Transforms/InstCombine
- test/Transforms/InstCombine
2 files changed
+29
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5549 | 5549 | | |
5550 | 5550 | | |
5551 | 5551 | | |
5552 | | - | |
5553 | | - | |
| 5552 | + | |
| 5553 | + | |
5554 | 5554 | | |
5555 | 5555 | | |
5556 | 5556 | | |
| |||
5571 | 5571 | | |
5572 | 5572 | | |
5573 | 5573 | | |
5574 | | - | |
5575 | | - | |
5576 | | - | |
5577 | | - | |
| 5574 | + | |
| 5575 | + | |
| 5576 | + | |
| 5577 | + | |
| 5578 | + | |
| 5579 | + | |
| 5580 | + | |
| 5581 | + | |
| 5582 | + | |
| 5583 | + | |
| 5584 | + | |
| 5585 | + | |
| 5586 | + | |
| 5587 | + | |
| 5588 | + | |
| 5589 | + | |
| 5590 | + | |
| 5591 | + | |
| 5592 | + | |
| 5593 | + | |
5578 | 5594 | | |
5579 | 5595 | | |
5580 | 5596 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
151 | | - | |
| 150 | + | |
152 | 151 | | |
153 | | - | |
| 152 | + | |
154 | 153 | | |
155 | 154 | | |
156 | 155 | | |
| |||
162 | 161 | | |
163 | 162 | | |
164 | 163 | | |
165 | | - | |
166 | | - | |
| 164 | + | |
167 | 165 | | |
168 | | - | |
| 166 | + | |
169 | 167 | | |
170 | 168 | | |
171 | 169 | | |
| |||
0 commit comments