Commit 47fd32f
authored
[DAGCombine] Fix type mismatch in
Proof: https://alive2.llvm.org/ce/z/J7GBMU
Same as #92753, the types of
LHS and RHS in shift nodes may differ.
+ When VT is smaller than ShiftVT, it is safe to use trunc.
+ When VT is larger than ShiftVT, it is safe to use zext iff
`is_zero_poison` is true (i.e., `opcode == ISD::CTTZ_ZERO_UNDEF`). See
also the counterexample `src_shl_cttz2 -> tgt_shl_cttz2` in the alive2
proofs.
Fixes issue
#85066 (comment).(shl X, cttz(Y)) -> (mul (Y & -Y), X) (#94008)1 parent cb7a03b commit 47fd32f
File tree
2 files changed
+52
-4
lines changed- llvm
- lib/CodeGen/SelectionDAG
- test/CodeGen/PowerPC
2 files changed
+52
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10120 | 10120 | | |
10121 | 10121 | | |
10122 | 10122 | | |
10123 | | - | |
10124 | | - | |
| 10123 | + | |
| 10124 | + | |
| 10125 | + | |
| 10126 | + | |
10125 | 10127 | | |
10126 | 10128 | | |
10127 | 10129 | | |
10128 | | - | |
10129 | | - | |
| 10130 | + | |
| 10131 | + | |
| 10132 | + | |
10130 | 10133 | | |
10131 | 10134 | | |
10132 | 10135 | | |
| |||
| 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 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
0 commit comments