Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3971,6 +3971,9 @@ void LoopVectorizationPlanner::emitInvalidCostRemarks(
.Case<VPInterleaveRecipe>([](const VPInterleaveRecipe *R) {
return R->getStoredValues().empty() ? Instruction::Load
: Instruction::Store;
})
.Case<VPReductionRecipe>([](const auto *R) {
return RecurrenceDescriptor::getOpcode(R->getRecurrenceKind());
});

// If the next recipe is different, or if there are no other pairs,
Expand Down
27 changes: 27 additions & 0 deletions llvm/test/Transforms/LoopVectorize/AArch64/bug165359.ll
Original file line number Diff line number Diff line change
@@ -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
br label %loop

loop:
%acc0 = phi double [ %fadd0, %loop ], [ %d0, %entry ]
%counter = phi i64 [ %counter_updated, %loop ], [ %loop_count, %entry ]
%fadd0 = fadd double %acc0, %d1
%counter_updated = add nsw i64 %counter, -1
%exit_cond = icmp samesign ugt i64 %counter, 1
br i1 %exit_cond, label %loop, label %loopexit

loopexit:
store double %fadd0, ptr %ptr1
ret void
}

attributes #0 = { "target-features"="+sve" }
Loading