Commit 0e8caf4
committed
[InstCombine] Detect different vscales in div by shift combine.
This attempts to fix a regression in code that performs `svcntb() / svcntw()`
(which is just a constant). https://godbolt.org/z/4o3a67s6n. We would previous
expand the svcnt into two different vscale intrinsics, CSE them in a later pass
and then fold udiv of shifts into a constant in a second instcombine.
After llvm#121386 we now introduce a cttz. This patch just adds an additional check
for vscale to the div of shift fold, allowing it to happen earlier and avoiding
the need to look through the awkward (but probably not impossible) cttz that
was introduced.1 parent 4b0a7e6 commit 0e8caf4
File tree
3 files changed
+7
-17
lines changed- llvm
- lib/Transforms/InstCombine
- test/Transforms/InstCombine
- AArch64
3 files changed
+7
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1205 | 1205 | | |
1206 | 1206 | | |
1207 | 1207 | | |
1208 | | - | |
1209 | | - | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
1210 | 1212 | | |
1211 | 1213 | | |
1212 | 1214 | | |
1213 | 1215 | | |
1214 | 1216 | | |
1215 | | - | |
| 1217 | + | |
1216 | 1218 | | |
1217 | 1219 | | |
1218 | 1220 | | |
| |||
Lines changed: 1 addition & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
| 245 | + | |
252 | 246 | | |
253 | 247 | | |
254 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1403 | 1403 | | |
1404 | 1404 | | |
1405 | 1405 | | |
1406 | | - | |
1407 | | - | |
1408 | | - | |
1409 | | - | |
1410 | | - | |
1411 | | - | |
1412 | | - | |
| 1406 | + | |
1413 | 1407 | | |
1414 | 1408 | | |
1415 | 1409 | | |
| |||
0 commit comments