From: Dan Gohman Date: Thu, 7 Oct 2010 23:36:45 +0000 (+0000) Subject: When merging one use into another, transfer the offsets from X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=dd3db0e0c33958328cc709f01aba45c8d9e57f1f;p=oota-llvm.git When merging one use into another, transfer the offsets from the old use to the new one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116008 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 07477661f9a..f54bf63de22 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -3035,6 +3035,14 @@ void LSRInstance::NarrowSearchSpaceByCollapsingUnrolledCode() { if (Fixup.LUIdx == LUIdx) { Fixup.LUIdx = LUThatHas - &Uses.front(); Fixup.Offset += F.AM.BaseOffs; + // Add the new offset to LUThatHas' offset list. + if (LUThatHas->Offsets.back() != Fixup.Offset) { + LUThatHas->Offsets.push_back(Fixup.Offset); + if (Fixup.Offset > LUThatHas->MaxOffset) + LUThatHas->MaxOffset = Fixup.Offset; + if (Fixup.Offset < LUThatHas->MinOffset) + LUThatHas->MinOffset = Fixup.Offset; + } DEBUG(dbgs() << "New fixup has offset " << Fixup.Offset << '\n'); }