[llvm] cd47f5b - [LSR] Minor code style improvement [nfc]
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 17 07:51:08 PDT 2023
Author: Philip Reames
Date: 2023-03-17T07:50:59-07:00
New Revision: cd47f5bb5987667a1761059fa216437d9f1d97c9
URL: https://github.com/llvm/llvm-project/commit/cd47f5bb5987667a1761059fa216437d9f1d97c9
DIFF: https://github.com/llvm/llvm-project/commit/cd47f5bb5987667a1761059fa216437d9f1d97c9.diff
LOG: [LSR] Minor code style improvement [nfc]
Added:
Modified:
llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index e5da0652a4ab7..73b8a40866f90 100644
--- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -6706,8 +6706,8 @@ canFoldTermCondOfLoop(Loop *L, ScalarEvolution &SE, DominatorTree &DT,
BranchInst *BI = cast<BranchInst>(LoopLatch->getTerminator());
if (BI->isUnconditional())
return std::nullopt;
- Value *TermCond = BI->getCondition();
- if (!isa<ICmpInst>(TermCond) || !cast<ICmpInst>(TermCond)->isEquality()) {
+ auto *TermCond = dyn_cast<ICmpInst>(BI->getCondition());
+ if (!TermCond || !TermCond->isEquality()) {
LLVM_DEBUG(dbgs() << "Cannot fold on branching condition that is not an "
"ICmpInst::eq / ICmpInst::ne\n");
return std::nullopt;
More information about the llvm-commits
mailing list