Skip to content

Commit 58e5788

Browse files
committed
Adjust to use havaSameSign
1 parent e5005a3 commit 58e5788

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/Transforms/Utils/SimplifyIndVar.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,7 @@ void SimplifyIndvar::eliminateIVComparison(ICmpInst *ICmp,
279279
// fallthrough to end of function
280280
} else if ((ICmpInst::isSigned(OriginalPred) ||
281281
(ICmpInst::isUnsigned(OriginalPred) && !ICmp->hasSameSign())) &&
282-
((SE->isKnownNegative(S) && SE->isKnownNegative(X)) ||
283-
(SE->isKnownNonNegative(S) && SE->isKnownNonNegative(X)))) {
282+
SE->haveSameSign(S, X)) {
284283
// Set the samesign flag on the compare if legal, and canonicalize to
285284
// the unsigned variant (for signed compares) hoping that it will open
286285
// the doors for other optimizations. Note that we cannot rely on Pred

0 commit comments

Comments
 (0)