Commit 111ae45
[X86] Fix miscompile in combineShiftRightArithmetic
When folding (ashr (shl, x, c1), c2) we need to treat c1 and c2
as unsigned to find out if the combined shift should be a left
or right shift.
Also do an early out during pre-legalization in case c1 and c2
has different types, as that otherwise complicated the comparison
of c1 and c2 a bit.
(cherry picked from commit 3e6e54e)1 parent 76cbd41 commit 111ae45
File tree
2 files changed
+21
-18
lines changed- llvm
- lib/Target/X86
- test/CodeGen/X86
2 files changed
+21
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47035 | 47035 | | |
47036 | 47036 | | |
47037 | 47037 | | |
47038 | | - | |
47039 | | - | |
47040 | | - | |
47041 | | - | |
| 47038 | + | |
| 47039 | + | |
| 47040 | + | |
| 47041 | + | |
| 47042 | + | |
| 47043 | + | |
| 47044 | + | |
47042 | 47045 | | |
47043 | 47046 | | |
47044 | 47047 | | |
| |||
47054 | 47057 | | |
47055 | 47058 | | |
47056 | 47059 | | |
47057 | | - | |
| 47060 | + | |
47058 | 47061 | | |
47059 | 47062 | | |
47060 | | - | |
| 47063 | + | |
| 47064 | + | |
| 47065 | + | |
47061 | 47066 | | |
47062 | 47067 | | |
47063 | 47068 | | |
47064 | 47069 | | |
47065 | | - | |
47066 | | - | |
| 47070 | + | |
47067 | 47071 | | |
47068 | 47072 | | |
47069 | 47073 | | |
47070 | 47074 | | |
47071 | 47075 | | |
47072 | | - | |
47073 | | - | |
| 47076 | + | |
47074 | 47077 | | |
47075 | | - | |
| 47078 | + | |
47076 | 47079 | | |
47077 | | - | |
| 47080 | + | |
47078 | 47081 | | |
47079 | | - | |
| 47082 | + | |
47080 | 47083 | | |
47081 | 47084 | | |
47082 | 47085 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
0 commit comments