diff options
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyIndVar.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyIndVar.cpp | 19 |
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 |