Commit 6f37d36
Automerge: [VPlan] Fix nowrap flags for strided access pointers from SCEV (#209453)
This patch addresses two things. First, the offset calculation
(canonical IV * stride) should not reuse the NSW flag of the add
recurrence. The NSW property from SCEV for the original scalar
recurrence does not necessarily hold for the reconstructed
multiplication using the vector canonical IV. The NUW flag, however, can
still be safely propagated.
Second, because vputils::getGEPFlagsForPtr currently doesn't support
recipes other than VPInstruction, and to avoid relying on LLVM IR
function (like calling stripPointerCasts()), we change
VPVectorPointerRecipe's GEP flags to use the add recurrence's flags to
prevent propagating unprovable GEP flags like inbounds.
(cherry picked from commit 1d41488)3 files changed
Lines changed: 13 additions & 15 deletions
File tree
- llvm
- lib/Transforms/Vectorize
- test/Transforms/LoopVectorize/RISCV
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7787 | 7787 | | |
7788 | 7788 | | |
7789 | 7789 | | |
7790 | | - | |
7791 | | - | |
7792 | | - | |
7793 | | - | |
7794 | | - | |
| 7790 | + | |
| 7791 | + | |
| 7792 | + | |
| 7793 | + | |
| 7794 | + | |
7795 | 7795 | | |
7796 | 7796 | | |
7797 | 7797 | | |
7798 | | - | |
7799 | | - | |
| 7798 | + | |
| 7799 | + | |
7800 | 7800 | | |
7801 | 7801 | | |
7802 | 7802 | | |
| |||
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | 4 | | |
7 | 5 | | |
8 | 6 | | |
| |||
26 | 24 | | |
27 | 25 | | |
28 | 26 | | |
29 | | - | |
| 27 | + | |
30 | 28 | | |
31 | 29 | | |
32 | 30 | | |
| |||
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1262 | 1262 | | |
1263 | 1263 | | |
1264 | 1264 | | |
1265 | | - | |
1266 | | - | |
| 1265 | + | |
| 1266 | + | |
1267 | 1267 | | |
1268 | 1268 | | |
1269 | 1269 | | |
1270 | | - | |
1271 | | - | |
| 1270 | + | |
| 1271 | + | |
1272 | 1272 | | |
1273 | 1273 | | |
1274 | 1274 | | |
| |||
1356 | 1356 | | |
1357 | 1357 | | |
1358 | 1358 | | |
1359 | | - | |
| 1359 | + | |
1360 | 1360 | | |
1361 | 1361 | | |
1362 | 1362 | | |
| |||
0 commit comments