Skip to content

Commit c56db5f

Browse files
committed
!fixup drop A >= C requierement
1 parent def07a5 commit c56db5f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

llvm/lib/Analysis/ScalarEvolution.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,13 +1795,11 @@ const SCEV *ScalarEvolution::getZeroExtendExprImpl(const SCEV *Op, Type *Ty,
17951795

17961796
const SCEVConstant *C;
17971797
const SCEV *A;
1798-
// zext (C + A)<nsw> -> (sext(C) + zext(A))<nsw> if zext (C + A)<nsw> >=s 0
1799-
// and A >=s V.
1798+
// zext (C + A)<nsw> -> (sext(C) + sext(A))<nsw> if zext (C + A)<nsw> >=s 0.
18001799
if (SA->hasNoSignedWrap() && isKnownNonNegative(SA) &&
1801-
match(SA, m_scev_Add(m_SCEVConstant(C), m_SCEV(A))) &&
1802-
isKnownPredicate(CmpInst::ICMP_SGE, A, C)) {
1800+
match(SA, m_scev_Add(m_SCEVConstant(C), m_SCEV(A)))) {
18031801
SmallVector<const SCEV *, 4> Ops = {getSignExtendExpr(C, Ty, Depth + 1),
1804-
getZeroExtendExpr(A, Ty, Depth + 1)};
1802+
getSignExtendExpr(A, Ty, Depth + 1)};
18051803
return getAddExpr(Ops, SCEV::FlagNSW, Depth + 1);
18061804
}
18071805

0 commit comments

Comments
 (0)