Commit fa12df5
[SCEV] Check correct value for UB (llvm#124302)
This is a followup to llvm#117152. That patch introduced a check for
UB/poison on BEValue. However, the SCEV we're actually going to use is
Shifted. In some cases, it's possible for Shifted to contain UB, while
BEValue doesn't.
In the test case the values are:
BEValue: (-1 * (zext i8 (-83 + ((-83 /u {1,+,1}<%loop>) *
{-1,+,-1}<%loop>)) to i32))<nuw><nsw>
Shifted: (-173 + (-1 * (zext i8 ((-83 /u {0,+,1}<%loop>) *
{0,+,-1}<%loop>) to i32))<nuw><nsw>)<nuw><nsw>
Fixes llvm#123550.
(cherry picked from commit 07efe2c)1 parent a97eed9 commit fa12df5
File tree
2 files changed
+16
-18
lines changed- llvm
- lib/Analysis
- test/Analysis/ScalarEvolution
2 files changed
+16
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5917 | 5917 | | |
5918 | 5918 | | |
5919 | 5919 | | |
5920 | | - | |
5921 | | - | |
5922 | | - | |
5923 | | - | |
5924 | | - | |
5925 | | - | |
5926 | | - | |
5927 | | - | |
5928 | | - | |
5929 | | - | |
5930 | | - | |
5931 | | - | |
5932 | | - | |
5933 | | - | |
| 5920 | + | |
| 5921 | + | |
| 5922 | + | |
| 5923 | + | |
| 5924 | + | |
| 5925 | + | |
| 5926 | + | |
| 5927 | + | |
| 5928 | + | |
| 5929 | + | |
| 5930 | + | |
| 5931 | + | |
5934 | 5932 | | |
5935 | 5933 | | |
5936 | 5934 | | |
| |||
| 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 | 15 | | |
16 | 16 | | |
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
0 commit comments