[llvm] [LV] Support tail-folded epilogue loops (PR #208764)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 1 08:59:30 PDT 2026


================
@@ -0,0 +1,584 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
+; REQUIRES: asserts
+; RUN: opt -p loop-vectorize -epilogue-tail-folding-policy=prefer-fold-tail \
+; RUN: -force-vector-width=16 -epilogue-vectorization-force-VF=8 -mattr=+sve -S %s | FileCheck %s
+
+; RUN: opt -p loop-vectorize -epilogue-tail-folding-policy=prefer-fold-tail \
+; RUN: -force-vector-width="vscale x 16" -epilogue-vectorization-force-VF="vscale x 8" -mattr=+sve -S %s | FileCheck %s --check-prefix=CHECK-VS
+
+target triple = "aarch64-linux-gnu"
+
+define i32 @add_redc(ptr %src, i64 %n) {
----------------
david-arm wrote:

Can you also add:

1. A test for a loop with multiple reductions similar to one of the tests in https://github.com/llvm/llvm-project/pull/214455? Support has been added for this now.
2. A test similar to LoopVectorize/AArch64/partial-reduce-with-predicate.ll for partial reductions with tail-folding.

?

https://github.com/llvm/llvm-project/pull/208764


More information about the llvm-commits mailing list