Skip to content

Commit e2ac1fd

Browse files
Improve commentary.
1 parent 3ca5a4e commit e2ac1fd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Analysis/ScalarEvolution.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10791,10 +10791,10 @@ bool ScalarEvolution::SimplifyICmpOperands(CmpPredicate &Pred, const SCEV *&LHS,
1079110791
const SCEVMulExpr *LMul = cast<SCEVMulExpr>(LHS);
1079210792
const SCEVMulExpr *RMul = cast<SCEVMulExpr>(RHS);
1079310793

10794+
// (X * vscale) pred (Y * vscale) ==> X pred Y
10795+
// when both multiples are NSW.
1079410796
// (X * vscale) uicmp/eq/ne (Y * vscale) ==> X uicmp/eq/ne Y
10795-
// when neither multiply wraps.
10796-
// (X * vscale) sicmp (Y * vscale) ==> X sicmp Y
10797-
// when neither multiply changes sign.
10797+
// when both multiples are NUW.
1079810798
if ((LMul->hasNoSignedWrap() && RMul->hasNoSignedWrap()) ||
1079910799
(LMul->hasNoUnsignedWrap() && RMul->hasNoUnsignedWrap() &&
1080010800
!ICmpInst::isSigned(Pred))) {

0 commit comments

Comments
 (0)