Skip to content

Commit db3c9af

Browse files
Dinar TemirbulatovDinar Temirbulatov
authored andcommitted
Fix a compile time failure, while testing proposed change.
1 parent 5b01b8c commit db3c9af

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -837,10 +837,9 @@ bool LoopVectorizationLegality::canVectorizeInstrs() {
837837
if (Instruction *SI = dyn_cast<SelectInst>(V))
838838
Cmp = dyn_cast<CmpInst>(SI->getOperand(0));
839839
}
840-
if (Cmp && !Cmp->hasOneUse()) {
841-
RecurKind Kind = RedDes.getRecurrenceKind();
842-
assert((Kind == RecurKind::IAnyOf || Kind == RecurKind::FAnyOf) &&
843-
"Unexpected type of recurrence");
840+
RecurKind Kind = RedDes.getRecurrenceKind();
841+
if (Cmp && !Cmp->hasOneUse() &&
842+
(Kind == RecurKind::IAnyOf || Kind == RecurKind::FAnyOf)) {
844843
if (MultiCmpsRed.contains(Cmp))
845844
MultiCmpsRed[Cmp]++;
846845
else

0 commit comments

Comments
 (0)