[llvm] 30496bf - [SCEV] Use fallthoughs in predicate switch when collecting rewrites for loop guard (NFC)
Dmitry Makogon via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 7 01:07:53 PST 2023
Author: Dmitry Makogon
Date: 2023-03-07T15:59:50+07:00
New Revision: 30496bf6453207ee93fda8330e84fec02b40c5bf
URL: https://github.com/llvm/llvm-project/commit/30496bf6453207ee93fda8330e84fec02b40c5bf
DIFF: https://github.com/llvm/llvm-project/commit/30496bf6453207ee93fda8330e84fec02b40c5bf.diff
LOG: [SCEV] Use fallthoughs in predicate switch when collecting rewrites for loop guard (NFC)
Added:
Modified:
llvm/lib/Analysis/ScalarEvolution.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 5da3aaac3c23..cccf6cb6ced8 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -15066,31 +15066,27 @@ const SCEV *ScalarEvolution::applyLoopGuards(const SCEV *Expr, const Loop *L) {
if (RHS->getType()->isPointerTy())
break;
const SCEV *One = getOne(RHS->getType());
- RewrittenRHS =
- getUMinExpr(RewrittenLHS, getMinusSCEV(getUMaxExpr(RHS, One), One));
- break;
+ RHS = getMinusSCEV(getUMaxExpr(RHS, One), One);
+ LLVM_FALLTHROUGH;
}
- case CmpInst::ICMP_SLT:
- RewrittenRHS =
- getSMinExpr(RewrittenLHS, getMinusSCEV(RHS, getOne(RHS->getType())));
- break;
case CmpInst::ICMP_ULE:
RewrittenRHS = getUMinExpr(RewrittenLHS, RHS);
break;
+ case CmpInst::ICMP_SLT:
+ RHS = getMinusSCEV(RHS, getOne(RHS->getType()));
+ LLVM_FALLTHROUGH;
case CmpInst::ICMP_SLE:
RewrittenRHS = getSMinExpr(RewrittenLHS, RHS);
break;
case CmpInst::ICMP_UGT:
- RewrittenRHS =
- getUMaxExpr(RewrittenLHS, getAddExpr(RHS, getOne(RHS->getType())));
- break;
- case CmpInst::ICMP_SGT:
- RewrittenRHS =
- getSMaxExpr(RewrittenLHS, getAddExpr(RHS, getOne(RHS->getType())));
- break;
+ RHS = getAddExpr(RHS, getOne(RHS->getType()));
+ LLVM_FALLTHROUGH;
case CmpInst::ICMP_UGE:
RewrittenRHS = getUMaxExpr(RewrittenLHS, RHS);
break;
+ case CmpInst::ICMP_SGT:
+ RHS = getAddExpr(RHS, getOne(RHS->getType()));
+ LLVM_FALLTHROUGH;
case CmpInst::ICMP_SGE:
RewrittenRHS = getSMaxExpr(RewrittenLHS, RHS);
break;
More information about the llvm-commits
mailing list