[llvm] [LV] Update LoopVectorizationPlanner::emitInvalidCostRemarks to handle reduction plans (PR #165913)

Ryan Buchner via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 6 11:00:24 PST 2025


================
@@ -0,0 +1,27 @@
+; RUN: opt < %s -passes=loop-vectorize -S -pass-remarks=loop-vectorize -debug-only=loop-vectorize &> %t
+; RUN: cat %t | FileCheck --check-prefix=CHECK-REMARKS %s
+
+; CHECK-REMARKS: LV: Recipe with invalid costs prevented vectorization at VF=(vscale x 1): fadd.
+
+target triple = "aarch64-unknown-linux-gnu"
+
+define void @reduce_fail(i64 %loop_count, ptr %ptr0, ptr noalias %ptr1) #0 {
+entry:
+  %d1 = load double, ptr %ptr1
+  %d0 = load double, ptr %ptr0
----------------
bababuck wrote:

Removed one of the loads, left the other.

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


More information about the llvm-commits mailing list