Skip to content

Commit 7ff943a

Browse files
committed
[indvars] Move a check slightlly earlier [NFC]
1 parent 3fc9882 commit 7ff943a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/Scalar/IndVarSimplify.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,7 +1431,7 @@ bool IndVarSimplify::canonicalizeExitCondition(Loop *L) {
14311431
assert(BI->isConditional() && "exit branch must be conditional");
14321432

14331433
auto *ICmp = dyn_cast<ICmpInst>(BI->getCondition());
1434-
if (!ICmp || !ICmp->hasOneUse())
1434+
if (!ICmp || !ICmp->hasOneUse() || ICmp->isUnsigned())
14351435
continue;
14361436

14371437
auto *LHS = ICmp->getOperand(0);
@@ -1444,7 +1444,7 @@ bool IndVarSimplify::canonicalizeExitCondition(Loop *L) {
14441444

14451445
// Match (icmp signed-cond zext, RHS)
14461446
Value *LHSOp = nullptr;
1447-
if (!match(LHS, m_ZExt(m_Value(LHSOp))) || !ICmp->isSigned())
1447+
if (!match(LHS, m_ZExt(m_Value(LHSOp))))
14481448
continue;
14491449

14501450
const DataLayout &DL = ExitingBB->getModule()->getDataLayout();

0 commit comments

Comments
 (0)