Commit d140713
committed
[AArch64] Fix Fold of Compare with Right-shifted Value
This commit folds (setcc ne (lshr x c) 0) for 64-bit types and constants
>= 32. This fold already existed for other types or smaller constants
but was not applicable to 64-bit types and constants >= 32 due to a
comparison of the constant c with the bit size of the setcc operation.
The type of this operation is legalized to i32, which does not
necessarily match the type of the lshr operation. Use the bit size of
the type of the lshr operation instead for the comparison.
Fixes #122380.1 parent a5d619e commit d140713
File tree
2 files changed
+5
-8
lines changed- llvm
- lib/Target/AArch64
- test/CodeGen/AArch64
2 files changed
+5
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25070 | 25070 | | |
25071 | 25071 | | |
25072 | 25072 | | |
25073 | | - | |
25074 | 25073 | | |
25075 | 25074 | | |
25076 | | - | |
| 25075 | + | |
| 25076 | + | |
25077 | 25077 | | |
25078 | 25078 | | |
25079 | 25079 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
| 72 | + | |
74 | 73 | | |
75 | 74 | | |
76 | 75 | | |
| |||
81 | 80 | | |
82 | 81 | | |
83 | 82 | | |
84 | | - | |
85 | | - | |
| 83 | + | |
86 | 84 | | |
87 | 85 | | |
88 | 86 | | |
| |||
93 | 91 | | |
94 | 92 | | |
95 | 93 | | |
96 | | - | |
97 | | - | |
| 94 | + | |
98 | 95 | | |
99 | 96 | | |
100 | 97 | | |
| |||
0 commit comments