Skip to content

Commit 0fa6130

Browse files
committed
[LoopVectorize] Relax a FCmpInst assert to dyn_cast after D95690
The instruction may be `icmp eq i32`. Noticed in an internal Halide+wasm JIT test.
1 parent 41877b8 commit 0fa6130

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Analysis/IVDescriptors.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,8 @@ bool RecurrenceDescriptor::AddReductionVar(PHINode *Phi, RecurKind Kind,
309309
// TODO: This is a hack to work-around the fact that FMF may not be
310310
// assigned/propagated correctly. If that problem is fixed or we
311311
// standardize on fmin/fmax via intrinsics, this can be removed.
312-
assert(isa<FCmpInst>(Sel->getCondition()) && "Expected fcmp min/max");
313-
CurFMF |= cast<FCmpInst>(Sel->getCondition())->getFastMathFlags();
312+
if (auto *FCmp = dyn_cast<FCmpInst>(Sel->getCondition()))
313+
CurFMF |= FCmp->getFastMathFlags();
314314
}
315315
FMF &= CurFMF;
316316
}

0 commit comments

Comments
 (0)