Commit 0e28fd7
authored
[RISCV] Check the types are the same for folding (sub 0, (setcc x, 0, setlt)) to (sra x, xlen - 1) (llvm#158179)
We should check the type of x is the same as `sub` operation. Otherwise
the shift amount xlen -1 will exceed the bit size of x.
Fixes llvm#158121.1 parent 7ee4909 commit 0e28fd7
File tree
2 files changed
+19
-1
lines changed- llvm
- lib/Target/RISCV
- test/CodeGen/RISCV
2 files changed
+19
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15827 | 15827 | | |
15828 | 15828 | | |
15829 | 15829 | | |
15830 | | - | |
| 15830 | + | |
| 15831 | + | |
15831 | 15832 | | |
15832 | 15833 | | |
15833 | 15834 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
0 commit comments