Commit 1b4d8f0
[SCEV] Fix incorrect extension in computeConstantDifference()
The Mul factor was zero-extended here, resulting in incorrect
results for integers larger than 64-bit.
As we currently only multiply by 1 or -1, just split this into
two cases -- there's no need for a full multiplication here.
Fixes llvm/llvm-project#102597.1 parent 3d06e83 commit 1b4d8f0
File tree
2 files changed
+11
-5
lines changed- llvm
- lib/Analysis
- test/Transforms/IndVarSimplify
2 files changed
+11
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11976 | 11976 | | |
11977 | 11977 | | |
11978 | 11978 | | |
11979 | | - | |
11980 | | - | |
11981 | | - | |
| 11979 | + | |
| 11980 | + | |
| 11981 | + | |
| 11982 | + | |
| 11983 | + | |
| 11984 | + | |
| 11985 | + | |
| 11986 | + | |
11982 | 11987 | | |
11983 | 11988 | | |
11984 | 11989 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
0 commit comments