diff options
author | Owen Anderson <resistor@mac.com> | 2009-02-02 22:42:01 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-02-02 22:42:01 +0000 |
commit | 5b93f6fa82e33b17d618b3e24da513f547861481 (patch) | |
tree | a3cadfbcb6fa5dc28d2da63f94bd92baebb0c8e7 /lib/CodeGen/LiveInterval.cpp | |
parent | 8a782a2a8c2f0c82f292d03a3f707232b0bae27b (diff) |
MergeValueInto is too smart: it might choose to do the merge the opposite direction.
Live interval reconstruction needs to account for this, and scour its maps to
prevent dangling references.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63558 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveInterval.cpp')
-rw-r--r-- | lib/CodeGen/LiveInterval.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/LiveInterval.cpp b/lib/CodeGen/LiveInterval.cpp index 6341b9cd50..40f8cd4388 100644 --- a/lib/CodeGen/LiveInterval.cpp +++ b/lib/CodeGen/LiveInterval.cpp @@ -591,7 +591,7 @@ void LiveInterval::MergeInClobberRanges(const LiveInterval &Clobbers, /// are found to be equivalent. This eliminates V1, replacing all /// LiveRanges with the V1 value number with the V2 value number. This can /// cause merging of V1/V2 values numbers and compaction of the value space. -void LiveInterval::MergeValueNumberInto(VNInfo *V1, VNInfo *V2) { +VNInfo* LiveInterval::MergeValueNumberInto(VNInfo *V1, VNInfo *V2) { assert(V1 != V2 && "Identical value#'s are always equivalent!"); // This code actually merges the (numerically) larger value number into the @@ -652,6 +652,8 @@ void LiveInterval::MergeValueNumberInto(VNInfo *V1, VNInfo *V2) { } else { V1->def = ~1U; } + + return V2; } void LiveInterval::Copy(const LiveInterval &RHS, |