Commit 8f79754
authored
[SCEV] Better preserve wrapping info in SimplifyICmpOperands for UGE. (#144404)
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.
PR: #1444041 parent 0a7b0c8 commit 8f79754
File tree
2 files changed
+13
-7
lines changed- llvm
- lib/Analysis
- test/Transforms/IndVarSimplify
2 files changed
+13
-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 | + | |
| 10900 | + | |
10896 | 10901 | | |
10897 | 10902 | | |
10898 | 10903 | | |
| |||
10901 | 10906 | | |
10902 | 10907 | | |
10903 | 10908 | | |
| 10909 | + | |
| 10910 | + | |
| 10911 | + | |
| 10912 | + | |
10904 | 10913 | | |
10905 | 10914 | | |
10906 | 10915 | | |
| |||
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