diff options
author | Chris Lattner <sabre@nondot.org> | 2006-09-02 05:26:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-09-02 05:26:59 +0000 |
commit | f21f0205b5dec61f165518887f54e01ab5aab13c (patch) | |
tree | ef13c4e541a597a9afe73025654e4eb947a51e71 /lib/CodeGen/LiveInterval.cpp | |
parent | 6bda49fd9fbc356eb5cf8a8547bd03acb4fa7036 (diff) |
When joining two intervals where the RHS is really simple, use a light-weight
method for joining the live ranges instead of the fully-general one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30049 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveInterval.cpp')
-rw-r--r-- | lib/CodeGen/LiveInterval.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/CodeGen/LiveInterval.cpp b/lib/CodeGen/LiveInterval.cpp index eecb570db5..1834d6c015 100644 --- a/lib/CodeGen/LiveInterval.cpp +++ b/lib/CodeGen/LiveInterval.cpp @@ -351,6 +351,23 @@ void LiveInterval::join(LiveInterval &Other, int *LHSValNoAssignments, weight += Other.weight; } +/// MergeRangesInAsValue - Merge all of the intervals in RHS into this live +/// interval as the specified value number. The LiveRanges in RHS are +/// allowed to overlap with LiveRanges in the current interval, but only if +/// the overlapping LiveRanges have the specified value number. +void LiveInterval::MergeRangesInAsValue(const LiveInterval &RHS, + unsigned LHSValNo) { + // TODO: Make this more efficient. + iterator InsertPos = begin(); + for (const_iterator I = RHS.begin(), E = RHS.end(); I != E; ++I) { + // Map the ValId in the other live range to the current live range. + LiveRange Tmp = *I; + Tmp.ValId = LHSValNo; + InsertPos = addRangeFrom(Tmp, InsertPos); + } +} + + /// MergeInClobberRanges - For any live ranges that are not defined in the /// current interval, but are defined in the Clobbers interval, mark them /// used with an unknown definition value. |