From: Philip Reames Date: Wed, 3 Nov 2021 19:24:10 +0000 (-0700) Subject: [indvars] Move a check slightlly earlier [NFC] X-Git-Tag: upstream/15.0.7~26795 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7ff943a9ed878e3b8ffe162b2af41a81da1a11a2;p=platform%2Fupstream%2Fllvm.git [indvars] Move a check slightlly earlier [NFC] --- diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp index fd8b08b..c57acea 100644 --- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -1431,7 +1431,7 @@ bool IndVarSimplify::canonicalizeExitCondition(Loop *L) { assert(BI->isConditional() && "exit branch must be conditional"); auto *ICmp = dyn_cast(BI->getCondition()); - if (!ICmp || !ICmp->hasOneUse()) + if (!ICmp || !ICmp->hasOneUse() || ICmp->isUnsigned()) continue; auto *LHS = ICmp->getOperand(0); @@ -1444,7 +1444,7 @@ bool IndVarSimplify::canonicalizeExitCondition(Loop *L) { // Match (icmp signed-cond zext, RHS) Value *LHSOp = nullptr; - if (!match(LHS, m_ZExt(m_Value(LHSOp))) || !ICmp->isSigned()) + if (!match(LHS, m_ZExt(m_Value(LHSOp)))) continue; const DataLayout &DL = ExitingBB->getModule()->getDataLayout();