Commit cab6f07
committed
[VPlan] Support VPWidenIntOrFpInductionRecipes with EVL tail folding
Following on from #118638, this handles widened induction variables with EVL tail folding by setting the VF operand to be EVL, calculated in the vector body.
We need to do this for correctness since with EVL tail folding the number of elements processed in the penultimate iteration may not be VF, but the runtime EVL, and we need to increment induction variables as such.
- Because the VF may now not be a live-in we need to move the builder to just after its definition
- We also need to avoid truncating it when it's the same size as the step type, previously this wasn't a problem for live-ins.
- Also because the VF may be smaller than the IV type, since the EVL is always i32, we may need to zext it.
On -march=rva23u64 -O3 we get 87.1% more loops vectorized on TSVC, and 42.8% more loops vectorized on SPEC CPU 20171 parent a981134 commit cab6f07
File tree
11 files changed
+576
-146
lines changed- llvm
- lib/Transforms/Vectorize
- test/Transforms/LoopVectorize
- RISCV
11 files changed
+576
-146
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2006 | 2006 | | |
2007 | 2007 | | |
2008 | 2008 | | |
| 2009 | + | |
2009 | 2010 | | |
2010 | 2011 | | |
2011 | 2012 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2196 | 2196 | | |
2197 | 2197 | | |
2198 | 2198 | | |
| 2199 | + | |
| 2200 | + | |
2199 | 2201 | | |
2200 | 2202 | | |
2201 | 2203 | | |
| |||
2277 | 2279 | | |
2278 | 2280 | | |
2279 | 2281 | | |
2280 | | - | |
2281 | | - | |
2282 | | - | |
2283 | | - | |
2284 | | - | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
2285 | 2286 | | |
2286 | 2287 | | |
2287 | 2288 | | |
| |||
2604 | 2605 | | |
2605 | 2606 | | |
2606 | 2607 | | |
| 2608 | + | |
| 2609 | + | |
| 2610 | + | |
2607 | 2611 | | |
2608 | 2612 | | |
2609 | 2613 | | |
2610 | 2614 | | |
2611 | 2615 | | |
2612 | | - | |
| 2616 | + | |
2613 | 2617 | | |
2614 | 2618 | | |
| 2619 | + | |
| 2620 | + | |
2615 | 2621 | | |
2616 | 2622 | | |
2617 | 2623 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
| 160 | + | |
160 | 161 | | |
161 | 162 | | |
162 | 163 | | |
| |||
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
168 | | - | |
169 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
170 | 184 | | |
171 | 185 | | |
172 | 186 | | |
173 | | - | |
174 | | - | |
| 187 | + | |
175 | 188 | | |
176 | 189 | | |
177 | 190 | | |
178 | | - | |
179 | | - | |
| 191 | + | |
| 192 | + | |
180 | 193 | | |
181 | 194 | | |
182 | 195 | | |
| |||
Lines changed: 54 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
11 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
12 | 53 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
19 | 60 | | |
20 | 61 | | |
21 | 62 | | |
| |||
68 | 109 | | |
69 | 110 | | |
70 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
0 commit comments