Skip to content

Commit f54c6b4

Browse files
[IndVarSimplify] Bail out if not a branch in maybeFloatingPointRecurrence
clang-riscv-gauntlet buildbot was previously failing. Conservatively bail out if not handling a branch when looking for floating-point recurrences, we may wish to support select and branch in the future. Fixes: https://lab.llvm.org/buildbot/#/builders/210/builds/5908.
1 parent a7c8505 commit f54c6b4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/Transforms/Scalar/IndVarSimplify.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,9 @@ maybeFloatingPointRecurrence(Loop *L, PHINode *PN) {
306306
// The branch block must be in the loop and one of the successors must be out
307307
// of the loop.
308308
auto *BI = dyn_cast<BranchInst>(Compare->user_back());
309+
if (!BI)
310+
return std::nullopt;
311+
309312
assert(BI->isConditional() && "Can't use fcmp if not conditional");
310313
if (!L->contains(BI->getParent()) ||
311314
(L->contains(BI->getSuccessor(0)) && L->contains(BI->getSuccessor(1))))

0 commit comments

Comments
 (0)