Skip to content

Commit 68ba286

Browse files
committed
[SCEVExp] Remove early exit, rely on InstSimplifyFolder (NFCI).
Remove the SCEV-based check refined in #156910, as InstSimplifyFolder manages to simplify the generated code to false directly as well.
1 parent 778e104 commit 68ba286

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2208,17 +2208,6 @@ Value *SCEVExpander::generateOverflowCheck(const SCEVAddRecExpr *AR,
22082208
// negative. If Step is known to be positive or negative, only create
22092209
// either 1. or 2.
22102210
auto ComputeEndCheck = [&]() -> Value * {
2211-
// Checking <u 0 is always false, if (Step * trunc ExitCount) does not wrap.
2212-
// TODO: Predicates that can be proven true/false should be discarded when
2213-
// the predicates are created, not late during expansion.
2214-
if (!Signed && Start->isZero() && SE.isKnownPositive(Step) &&
2215-
DstBits < SrcBits &&
2216-
ExitCount == SE.getZeroExtendExpr(SE.getTruncateExpr(ExitCount, ARTy),
2217-
ExitCount->getType()) &&
2218-
SE.willNotOverflow(Instruction::Mul, Signed, Step,
2219-
SE.getTruncateExpr(ExitCount, ARTy)))
2220-
return ConstantInt::getFalse(Loc->getContext());
2221-
22222211
// Get the backedge taken count and truncate or extended to the AR type.
22232212
Value *TruncTripCount = Builder.CreateZExtOrTrunc(TripCountVal, Ty);
22242213

0 commit comments

Comments
 (0)