diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp index dcbc9c20746b..12bb87a77dc9 100644 --- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -90,10 +90,6 @@ namespace { /// particular stride. std::map IVsByStride; - /// StrideNoReuse - Keep track of all the strides whose ivs cannot be - /// reused (nor should they be rewritten to reuse other strides). - SmallSet StrideNoReuse; - /// DeadInsts - Keep track of instructions we may have made dead, so that /// we can remove them after we are done working. SmallVector DeadInsts; @@ -983,17 +979,13 @@ const SCEV *LoopStrengthReduce::CheckForIVReuse(bool HasBaseReg, const SCEV *const &Stride, IVExpr &IV, const Type *Ty, const std::vector& UsersToProcess) { - if (StrideNoReuse.count(Stride)) - return SE->getIntegerSCEV(0, Stride->getType()); - if (const SCEVConstant *SC = dyn_cast(Stride)) { int64_t SInt = SC->getValue()->getSExtValue(); for (unsigned NewStride = 0, e = IU->StrideOrder.size(); NewStride != e; ++NewStride) { std::map::iterator SI = IVsByStride.find(IU->StrideOrder[NewStride]); - if (SI == IVsByStride.end() || !isa(SI->first) || - StrideNoReuse.count(SI->first)) + if (SI == IVsByStride.end() || !isa(SI->first)) continue; // The other stride has no uses, don't reuse it. std::map::iterator UI = @@ -2766,7 +2758,6 @@ bool LoopStrengthReduce::runOnLoop(Loop *L, LPPassManager &LPM) { // We're done analyzing this loop; release all the state we built up for it. IVsByStride.clear(); - StrideNoReuse.clear(); // Clean up after ourselves if (!DeadInsts.empty())