1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00

[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.
This commit is contained in:
Fangrui Song 2021-02-01 19:28:45 -08:00
parent e64514a4fe
commit 6659e20d2b

View File

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