Commit 36c2311
committed
[LoopVectorize] Use new getUniqueLatchExitBlock routine
With PR #88385 I am introducing support for vectorising more
loops with early exits that don't require a scalar epilogue.
As such, if a loop doesn't have a unique exit block it will
not automatically imply we require a scalar epilogue. Also,
in all places in the code today where we use the variable
LoopExitBlock we actually mean the exit block from the latch.
Therefore, it seemed reasonable to add a new
getUniqueLatchExitBlock that allows the caller to determine
the exit block taken from the latch and use this instead of
getUniqueExitBlock. I also renamed LoopExitBlock to be
LatchExitBlock. I feel this not only better reflects how the
variable is used today, but also prepares the code for
PR #88385.
While doing this I also noticed that one of the comments in
requiresScalarEpilogue is wrong when we require a scalar
epilogue, i.e. when we're not exiting from the latch block.
This doesn't always imply we have multiple exits, e.g. see
the test in
Transforms/LoopVectorize/unroll_nonlatch.ll
where the latch unconditionally branches back to the only
exiting block.1 parent 44cfbef commit 36c2311
File tree
3 files changed
+27
-13
lines changed- llvm
- include/llvm/Support
- lib/Transforms/Vectorize
3 files changed
+27
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
297 | 301 | | |
298 | 302 | | |
299 | 303 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
162 | 172 | | |
163 | 173 | | |
164 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
652 | 652 | | |
653 | 653 | | |
654 | 654 | | |
655 | | - | |
656 | | - | |
657 | | - | |
| 655 | + | |
| 656 | + | |
658 | 657 | | |
659 | 658 | | |
660 | 659 | | |
| |||
1390 | 1389 | | |
1391 | 1390 | | |
1392 | 1391 | | |
| 1392 | + | |
| 1393 | + | |
1393 | 1394 | | |
1394 | 1395 | | |
1395 | 1396 | | |
| |||
1398 | 1399 | | |
1399 | 1400 | | |
1400 | 1401 | | |
1401 | | - | |
1402 | | - | |
| 1402 | + | |
| 1403 | + | |
1403 | 1404 | | |
1404 | 1405 | | |
1405 | 1406 | | |
| |||
2043 | 2044 | | |
2044 | 2045 | | |
2045 | 2046 | | |
2046 | | - | |
2047 | | - | |
| 2047 | + | |
2048 | 2048 | | |
2049 | 2049 | | |
2050 | 2050 | | |
| |||
2516 | 2516 | | |
2517 | 2517 | | |
2518 | 2518 | | |
2519 | | - | |
| 2519 | + | |
2520 | 2520 | | |
2521 | 2521 | | |
2522 | 2522 | | |
| |||
2533 | 2533 | | |
2534 | 2534 | | |
2535 | 2535 | | |
2536 | | - | |
| 2536 | + | |
2537 | 2537 | | |
2538 | 2538 | | |
2539 | 2539 | | |
| |||
2581 | 2581 | | |
2582 | 2582 | | |
2583 | 2583 | | |
2584 | | - | |
2585 | | - | |
2586 | | - | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
2587 | 2587 | | |
2588 | 2588 | | |
2589 | 2589 | | |
| |||
7788 | 7788 | | |
7789 | 7789 | | |
7790 | 7790 | | |
7791 | | - | |
| 7791 | + | |
7792 | 7792 | | |
7793 | 7793 | | |
7794 | 7794 | | |
| |||
0 commit comments