Skip to content

Commit 0b5ef27

Browse files
committed
[LV] Update LoopVectorizationPlanner::emitInvalidCostRemarks to handle reduction plans
Issue #165359. TypeSwitch did not handle the case of retrieving the opcode from a VPRedutionPlan type.
1 parent b6a8861 commit 0b5ef27

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3971,6 +3971,9 @@ void LoopVectorizationPlanner::emitInvalidCostRemarks(
39713971
.Case<VPInterleaveRecipe>([](const VPInterleaveRecipe *R) {
39723972
return R->getStoredValues().empty() ? Instruction::Load
39733973
: Instruction::Store;
3974+
})
3975+
.Case<VPReductionRecipe>([](const auto *R) {
3976+
return RecurrenceDescriptor::getOpcode(R->getRecurrenceKind());
39743977
});
39753978

39763979
// If the next recipe is different, or if there are no other pairs,

0 commit comments

Comments
 (0)