Commit e0aff41
committed
Rewrite more SCEVAddExpr when applying guards.
When re-writing SCEVAddExprs to apply information from guards, check if
we have information for the expression itself. If so, apply it.
When we have an expression of the form (Const + A), check if we have
have guard info for (Const + 1 + A) and use it. This is needed to avoid
regressions in a few cases, where we have BTCs with a subtracted
constant.
Rewriting expressions could cause regressions, e.g. when comparing 2
SCEV expressions where we are only able to rewrite one side, but I could
not find any cases where this happens more with this patch in practice.
Depends on llvm#160012 (included in
PR)
Proofs for some of the test changes: https://alive2.llvm.org/ce/z/RPX6t_1 parent 6bdff80 commit e0aff41
File tree
7 files changed
+41
-32
lines changed- llvm
- lib/Analysis
- test
- Analysis/ScalarEvolution
- Transforms
- IndVarSimplify
- LoopIdiom
- LoopVectorize
7 files changed
+41
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16030 | 16030 | | |
16031 | 16031 | | |
16032 | 16032 | | |
16033 | | - | |
16034 | | - | |
16035 | | - | |
16036 | | - | |
16037 | | - | |
16038 | | - | |
16039 | | - | |
16040 | | - | |
16041 | | - | |
| 16033 | + | |
| 16034 | + | |
| 16035 | + | |
| 16036 | + | |
| 16037 | + | |
| 16038 | + | |
| 16039 | + | |
| 16040 | + | |
| 16041 | + | |
| 16042 | + | |
| 16043 | + | |
| 16044 | + | |
| 16045 | + | |
| 16046 | + | |
| 16047 | + | |
| 16048 | + | |
| 16049 | + | |
| 16050 | + | |
| 16051 | + | |
| 16052 | + | |
| 16053 | + | |
| 16054 | + | |
| 16055 | + | |
| 16056 | + | |
16042 | 16057 | | |
| 16058 | + | |
16043 | 16059 | | |
16044 | 16060 | | |
16045 | 16061 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
| 200 | + | |
201 | 201 | | |
202 | | - | |
| 202 | + | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
| 205 | + | |
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
346 | | - | |
347 | 346 | | |
348 | 347 | | |
349 | 348 | | |
350 | 349 | | |
351 | 350 | | |
352 | 351 | | |
353 | | - | |
| 352 | + | |
354 | 353 | | |
355 | 354 | | |
356 | 355 | | |
| |||
385 | 384 | | |
386 | 385 | | |
387 | 386 | | |
388 | | - | |
389 | 387 | | |
390 | 388 | | |
391 | 389 | | |
392 | 390 | | |
393 | 391 | | |
394 | 392 | | |
395 | | - | |
| 393 | + | |
396 | 394 | | |
397 | 395 | | |
398 | 396 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
| 196 | + | |
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| |||
Lines changed: 1 addition & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
| 468 | + | |
474 | 469 | | |
475 | 470 | | |
476 | 471 | | |
| |||
0 commit comments