Skip to content

Commit

Permalink
[LoopVectorize] Relax a FCmpInst assert to dyn_cast after D95690
Browse files Browse the repository at this point in the history
The instruction may be `icmp eq i32`. Noticed in an internal Halide+wasm JIT test.
  • Loading branch information
MaskRay committed Feb 2, 2021
1 parent 41877b8 commit 0fa6130
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/Analysis/IVDescriptors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 0fa6130

Please sign in to comment.