Commit 34a6be4
committed
[SCEV] Allow udiv canonicalization of potentially-wrapping AddRecs
Extend the {X,+,N}/C => {(X - X%N),+,N}/C canonicalization to handle
AddRecs that may wrap, when X < N <= C and both N,C are powers of 2.
The alignment and power-of-2 properties ensure division results remain
equivalent for all offsets [(X - X%N), X).
Alive2 Proof: https://alive2.llvm.org/ce/z/VGUZo3
Fixes #1687091 parent 5f777b2 commit 34a6be4
File tree
3 files changed
+50
-14
lines changed- llvm
- lib/Analysis
- test
- Analysis/ScalarEvolution
- Transforms/LoopVectorize/X86
3 files changed
+50
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3492 | 3492 | | |
3493 | 3493 | | |
3494 | 3494 | | |
3495 | | - | |
3496 | | - | |
3497 | | - | |
3498 | | - | |
3499 | | - | |
| 3495 | + | |
3500 | 3496 | | |
3501 | 3497 | | |
3502 | | - | |
3503 | | - | |
3504 | | - | |
3505 | | - | |
| 3498 | + | |
| 3499 | + | |
| 3500 | + | |
| 3501 | + | |
| 3502 | + | |
| 3503 | + | |
| 3504 | + | |
| 3505 | + | |
| 3506 | + | |
| 3507 | + | |
| 3508 | + | |
| 3509 | + | |
| 3510 | + | |
| 3511 | + | |
| 3512 | + | |
| 3513 | + | |
| 3514 | + | |
| 3515 | + | |
3506 | 3516 | | |
3507 | 3517 | | |
3508 | 3518 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
24 | 46 | | |
| 47 | + | |
| 48 | + | |
25 | 49 | | |
| 50 | + | |
| 51 | + | |
0 commit comments