aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
diff options
context:
space:
mode:
authorPhilip Reames <preames@rivosinc.com>2023-11-03 11:16:40 -0700
committerPhilip Reames <listmail@philipreames.com>2023-11-03 11:19:14 -0700
commit5adf6ab7ff9c0bcf32c58224aee6a6a3e901abee (patch)
tree8e645effec84751f3b2f7e1c5d88054e4a9f5f4b /llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
parent70b35ec0a81375c49482755f08afc9463210ca87 (diff)
downloadllvm-5adf6ab7ff9c0bcf32c58224aee6a6a3e901abee.zip
llvm-5adf6ab7ff9c0bcf32c58224aee6a6a3e901abee.tar.gz
llvm-5adf6ab7ff9c0bcf32c58224aee6a6a3e901abee.tar.bz2
Revert "[IndVars] Generate zext nneg when locally obvious"
This reverts commit a6c8e27b3a052913a15a13ee0d4ac466c5ab3f92. It appears likely to have caused https://lab.llvm.org/buildbot/#/builders/57/builds/30988.
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyIndVar.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyIndVar.cpp19
1 files changed, 0 insertions, 19 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp b/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
index a618d72..f325698 100644
--- a/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
@@ -1201,15 +1201,6 @@ Value *WidenIV::createExtendInst(Value *NarrowOper, Type *WideType,
L = L->getParentLoop())
Builder.SetInsertPoint(L->getLoopPreheader()->getTerminator());
- // If we know the operand is never negative, prefer zext nneg.
- // For constant expressions, fall back to plain sext or zext.
- if (SE->isKnownNonNegative(SE->getSCEV(NarrowOper))) {
- auto *Res = Builder.CreateZExt(NarrowOper, WideType);
- if (auto *I = dyn_cast<Instruction>(Res))
- I->setNonNeg(true);
- return Res;
- }
-
return IsSigned ? Builder.CreateSExt(NarrowOper, WideType) :
Builder.CreateZExt(NarrowOper, WideType);
}
@@ -1711,16 +1702,6 @@ bool WidenIV::widenWithVariantUse(WidenIV::NarrowIVDefUse DU) {
auto ExtendedOp = [&](Value * V)->Value * {
if (V == NarrowUse)
return WideBO;
-
- // If we know the operand is never negative, prefer zext nneg.
- // For constant expressions, fall back to plain sext or zext.
- if (SE->isKnownNonNegative(SE->getSCEV(V))) {
- auto *Res = Builder.CreateZExt(V, WideBO->getType());
- if (auto *I = dyn_cast<Instruction>(Res))
- I->setNonNeg(true);
- return Res;
- }
-
if (ExtKind == ExtendKind::Zero)
return Builder.CreateZExt(V, WideBO->getType());
else