Commit ca1154d
authored
AMDGPU: Disable pattern matching "x<<32-y>>32-y" to "bfe x, 0, y" (llvm#114279)
It is not correct to lower "x<<32-y>>32-y" to "bfe x, 0, y". When y
equals to 32, the left-hand side is still x (unchanged), however, the
right-hand side will be evaluated to 0. So it is not always correct to
do such transformation.
We may be able to keep the pattern for immediate y while y is within [0,
31]. However, the immediate operands of the sub (32 - y) are easily
folded, and "(x << imm) >> imm" will be lowered to "and x,
(2^(32-imm))-1" anyway. So no bfe matching is needed.1 parent 5545f76 commit ca1154d
File tree
3 files changed
+27
-22
lines changed- llvm
- lib/Target/AMDGPU
- test/CodeGen/AMDGPU
3 files changed
+27
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3553 | 3553 | | |
3554 | 3554 | | |
3555 | 3555 | | |
3556 | | - | |
3557 | | - | |
3558 | | - | |
3559 | | - | |
3560 | | - | |
3561 | | - | |
3562 | | - | |
3563 | | - | |
3564 | | - | |
3565 | | - | |
3566 | | - | |
3567 | | - | |
3568 | | - | |
3569 | 3556 | | |
3570 | 3557 | | |
3571 | 3558 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
39 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
| |||
215 | 219 | | |
216 | 220 | | |
217 | 221 | | |
218 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
219 | 225 | | |
220 | 226 | | |
221 | 227 | | |
| |||
234 | 240 | | |
235 | 241 | | |
236 | 242 | | |
237 | | - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
238 | 246 | | |
239 | 247 | | |
240 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
158 | 168 | | |
159 | 169 | | |
160 | 170 | | |
| |||
0 commit comments