Commit 25172e1
committed
[InstCombine] Allow folds of shifts by constants for scalable vectors again
However this meant that FoldShiftByConstant no longer kicked in for scalable vectors because scalable splats are represented by ConstantExprs.
This fixes it by explicitly allowing splats of ConstantInts, it's not the prettiest so open to any suggestions.
But I'm also hoping that UseConstantIntForScalableSplat will eventually remove the need for this.
I noticed this when trying to reverse a combine on RISC-V in #132245, and saw that the resulting vector and scalar forms were different.1 parent 5cb140c commit 25172e1
File tree
2 files changed
+6
-3
lines changed- llvm
- lib/Transforms/InstCombine
- test/Transforms/InstCombine
2 files changed
+6
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
428 | 428 | | |
429 | 429 | | |
430 | 430 | | |
431 | | - | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
432 | 435 | | |
433 | 436 | | |
434 | 437 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
659 | 659 | | |
660 | 660 | | |
661 | 661 | | |
662 | | - | |
663 | | - | |
| 662 | + | |
| 663 | + | |
664 | 664 | | |
665 | 665 | | |
666 | 666 | | |
| |||
0 commit comments