From f21f0205b5dec61f165518887f54e01ab5aab13c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 2 Sep 2006 05:26:59 +0000 Subject: 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 --- lib/CodeGen/LiveInterval.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib/CodeGen/LiveInterval.cpp') 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. -- cgit v1.2.3-18-g5258