aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/LoopStrengthReduce.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-10-07 23:36:45 +0000
committerDan Gohman <gohman@apple.com>2010-10-07 23:36:45 +0000
commitdd3db0e0c33958328cc709f01aba45c8d9e57f1f (patch)
tree06260753a15a505fccb0c3ad2356e769ade24ede /lib/Transforms/Scalar/LoopStrengthReduce.cpp
parent122e2ea043918c77ebdd8936875f14282503d60f (diff)
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
Diffstat (limited to 'lib/Transforms/Scalar/LoopStrengthReduce.cpp')
-rw-r--r--lib/Transforms/Scalar/LoopStrengthReduce.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 07477661f9..f54bf63de2 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');
}