Commit be0340b
committed
[LAA] Only use inbounds/nusw in isNoWrap if the GEP is dereferenced.
Update isNoWrap to only use the inbounds/nusw flags from GEPs that are
guaranteed to be dereferenced on every iteration. This fixes a case
where we incorrectly determine no dependence.
I think the issue is isolated to code that evaluates the resulting
AddRec at BTC, just using it the compute the distance between accesses
should still be fine; if the access does not execute in a given
iteration, there's no dependence in that iteration. But isolating the
code is not straight-forward, so be conservative for now. The practical
impact should be very minor (only one loop changed across a corpus with
27k modules from large C/C++ workloads.
Fixes #160912.1 parent a099c91 commit be0340b
File tree
6 files changed
+156
-39
lines changed- llvm
- include/llvm/Analysis
- lib/Analysis
- test
- Analysis/LoopAccessAnalysis
- Transforms/LoopVectorize
- RISCV
- X86
6 files changed
+156
-39
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
896 | 896 | | |
897 | 897 | | |
898 | 898 | | |
899 | | - | |
| 899 | + | |
| 900 | + | |
900 | 901 | | |
901 | 902 | | |
902 | 903 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
800 | 800 | | |
801 | 801 | | |
802 | 802 | | |
803 | | - | |
| 803 | + | |
804 | 804 | | |
805 | 805 | | |
806 | | - | |
807 | | - | |
| 806 | + | |
| 807 | + | |
808 | 808 | | |
809 | 809 | | |
810 | 810 | | |
| |||
928 | 928 | | |
929 | 929 | | |
930 | 930 | | |
| 931 | + | |
| 932 | + | |
931 | 933 | | |
932 | 934 | | |
933 | 935 | | |
| |||
1009 | 1011 | | |
1010 | 1012 | | |
1011 | 1013 | | |
1012 | | - | |
| 1014 | + | |
| 1015 | + | |
1013 | 1016 | | |
1014 | 1017 | | |
1015 | 1018 | | |
| |||
1021 | 1024 | | |
1022 | 1025 | | |
1023 | 1026 | | |
1024 | | - | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
1025 | 1030 | | |
1026 | | - | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
1027 | 1043 | | |
1028 | 1044 | | |
1029 | 1045 | | |
| |||
1287 | 1303 | | |
1288 | 1304 | | |
1289 | 1305 | | |
1290 | | - | |
| 1306 | + | |
1291 | 1307 | | |
1292 | 1308 | | |
1293 | 1309 | | |
| |||
1602 | 1618 | | |
1603 | 1619 | | |
1604 | 1620 | | |
1605 | | - | |
| 1621 | + | |
1606 | 1622 | | |
1607 | 1623 | | |
1608 | 1624 | | |
| |||
1624 | 1640 | | |
1625 | 1641 | | |
1626 | 1642 | | |
1627 | | - | |
| 1643 | + | |
1628 | 1644 | | |
1629 | 1645 | | |
1630 | 1646 | | |
| |||
2041 | 2057 | | |
2042 | 2058 | | |
2043 | 2059 | | |
2044 | | - | |
2045 | | - | |
2046 | | - | |
2047 | | - | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
2048 | 2064 | | |
2049 | 2065 | | |
2050 | 2066 | | |
| |||
2621 | 2637 | | |
2622 | 2638 | | |
2623 | 2639 | | |
2624 | | - | |
| 2640 | + | |
| 2641 | + | |
2625 | 2642 | | |
2626 | 2643 | | |
2627 | 2644 | | |
| |||
2685 | 2702 | | |
2686 | 2703 | | |
2687 | 2704 | | |
2688 | | - | |
| 2705 | + | |
| 2706 | + | |
2689 | 2707 | | |
2690 | 2708 | | |
2691 | 2709 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1388 | 1388 | | |
1389 | 1389 | | |
1390 | 1390 | | |
1391 | | - | |
1392 | | - | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
1393 | 1394 | | |
1394 | 1395 | | |
1395 | 1396 | | |
| |||
1644 | 1645 | | |
1645 | 1646 | | |
1646 | 1647 | | |
1647 | | - | |
| 1648 | + | |
| 1649 | + | |
1648 | 1650 | | |
1649 | 1651 | | |
1650 | 1652 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
| |||
Lines changed: 28 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
20 | 35 | | |
21 | | - | |
22 | 36 | | |
23 | | - | |
24 | | - | |
25 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
26 | 41 | | |
27 | 42 | | |
28 | 43 | | |
29 | 44 | | |
30 | 45 | | |
31 | | - | |
| 46 | + | |
32 | 47 | | |
33 | 48 | | |
34 | 49 | | |
| |||
43 | 58 | | |
44 | 59 | | |
45 | 60 | | |
46 | | - | |
| 61 | + | |
47 | 62 | | |
48 | 63 | | |
49 | 64 | | |
50 | | - | |
| 65 | + | |
51 | 66 | | |
52 | 67 | | |
53 | 68 | | |
54 | | - | |
| 69 | + | |
55 | 70 | | |
56 | 71 | | |
57 | 72 | | |
58 | | - | |
| 73 | + | |
59 | 74 | | |
60 | 75 | | |
61 | 76 | | |
| 77 | + | |
62 | 78 | | |
63 | 79 | | |
64 | | - | |
| 80 | + | |
65 | 81 | | |
66 | 82 | | |
67 | 83 | | |
| |||
78 | 94 | | |
79 | 95 | | |
80 | 96 | | |
81 | | - | |
| 97 | + | |
82 | 98 | | |
83 | 99 | | |
84 | 100 | | |
| |||
146 | 162 | | |
147 | 163 | | |
148 | 164 | | |
149 | | - | |
| 165 | + | |
150 | 166 | | |
151 | 167 | | |
152 | 168 | | |
| |||
0 commit comments