[llvm] [LV] Support tail-folded epilogue loops (PR #208764)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 21 04:05:23 PDT 2026
================
@@ -120,26 +152,31 @@ for.end:
ret i32 0
}
-define i1 @early_exit(ptr %A, i64 %n, i8 %find) {
+define i64 @early_exit(ptr dereferenceable(1024) align 8 %src, i1 %cond) {
; CHECK-DISABLED-EARLY-EXIT-LABEL: LV: Checking a loop in 'early_exit'
; CHECK-DISABLED-EARLY-EXIT: remark: <unknown>:0:0: Epilogue tail-folding is not supported yet for early-exit loops
;
entry:
- br label %for.body
+ br label %loop.header
-for.body:
- %iv = phi i64 [ 0, %entry ], [ %iv.next, %cont ]
- %arrayidx = getelementptr inbounds i8, ptr %A, i64 %iv
- %val = load i8, ptr %arrayidx, align 1
- %exitcond = icmp eq i8 %val, %find
- br i1 %exitcond, label %exit, label %cont
+loop.header:
+ %iv = phi i64 [ %iv.next, %latch ], [ 0, %entry ]
----------------
david-arm wrote:
I think some of these changes (and the new test perhaps?) can be committed separately in a NFC patch to reduce the diff. For example, the changes to `@test_outer_loop` and `@early_exit`.
https://github.com/llvm/llvm-project/pull/208764
More information about the llvm-commits
mailing list