[llvm] [LV] Avoid low-trip-count vectorization for countable early exits (PR #225635)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 23 01:21:32 PDT 2026
david-arm wrote:
Hi, I think this
```
For loops where an early exit condition is present, and the exiting block of the loop is not in the same block as the loop latch, the new transformation should not be applied.
```
is only a partial solution. I believe @huntergr-arm has been working on supporting early exit loops where both the early exit condition and the latch condition are combined together in the same latch block, i.e.
```
loop:
... stuff ...
%ee_cond = icmp ugt i32 %ld, 3
%latch_cond = icmp uge i64 %iv.next, %n
%combined_cond = or i1 %ee_cond, %latch_cond
br i1 %combined_cond, label %exit, %loop
```
So you also need to worry about early exits where the exiting block *is* the latch.
https://github.com/llvm/llvm-project/pull/225635
More information about the llvm-commits
mailing list