[llvm] 64990f1 - Revert "[indvars] Move a check slightlly earlier [NFC]"
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 3 13:42:21 PDT 2021
Author: Philip Reames
Date: 2021-11-03T13:38:52-07:00
New Revision: 64990f1408fb296533a6710c0254cd8b598200af
URL: https://github.com/llvm/llvm-project/commit/64990f1408fb296533a6710c0254cd8b598200af
DIFF: https://github.com/llvm/llvm-project/commit/64990f1408fb296533a6710c0254cd8b598200af.diff
LOG: Revert "[indvars] Move a check slightlly earlier [NFC]"
This reverts commit 7ff943a9ed878e3b8ffe162b2af41a81da1a11a2.
This wasn't NFC. isSigned != !isUnsigned as there are also relational operators.
Added:
Modified:
llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
index c57acea0ca40..fd8b08bed147 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<ICmpInst>(BI->getCondition());
- if (!ICmp || !ICmp->hasOneUse() || ICmp->isUnsigned())
+ if (!ICmp || !ICmp->hasOneUse())
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))))
+ if (!match(LHS, m_ZExt(m_Value(LHSOp))) || !ICmp->isSigned())
continue;
const DataLayout &DL = ExitingBB->getModule()->getDataLayout();
More information about the llvm-commits
mailing list