Commit f70bb3d
committed
[SCEV] Better preserve wrapping info in SimplifyICmpOperands for UGE.
Update SimplifyICmpOperands to only try subtracting 1 from RHS first, if
RHS is an op we can fold the subtract directly into. Otherwise try
adding to LHS first, as we can preserve NUW flags.
This improves results in a few cases, including the modified test case
from berkeley-abc and new code to be added in
#128061.
Note that there are more cases where the results can be improved by
better ordering here which I'll try to investigate as follow-up.1 parent 49c6235 commit f70bb3d
File tree
2 files changed
+12
-7
lines changed- llvm
- lib/Analysis
- test/Transforms/IndVarSimplify
2 files changed
+12
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10892 | 10892 | | |
10893 | 10893 | | |
10894 | 10894 | | |
10895 | | - | |
| 10895 | + | |
| 10896 | + | |
| 10897 | + | |
| 10898 | + | |
| 10899 | + | |
10896 | 10900 | | |
10897 | 10901 | | |
10898 | 10902 | | |
| |||
10901 | 10905 | | |
10902 | 10906 | | |
10903 | 10907 | | |
| 10908 | + | |
| 10909 | + | |
| 10910 | + | |
| 10911 | + | |
10904 | 10912 | | |
10905 | 10913 | | |
10906 | 10914 | | |
| |||
Lines changed: 3 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
| 60 | + | |
| 61 | + | |
65 | 62 | | |
66 | 63 | | |
67 | 64 | | |
| |||
0 commit comments