X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FLiveInterval.cpp;h=40f8cd4388d89bc65bc89358e06d8d74e4b481e0;hb=b0000c376cf13ed63306622ab9642cfae49f074a;hp=24081b99c0e4cae49672694e8f93b8d19562fa7d;hpb=3f32d65912b4da23793dab618d981be2ce11c331;p=oota-llvm.git diff --git a/lib/CodeGen/LiveInterval.cpp b/lib/CodeGen/LiveInterval.cpp index 24081b99c0e..40f8cd4388d 100644 --- a/lib/CodeGen/LiveInterval.cpp +++ b/lib/CodeGen/LiveInterval.cpp @@ -244,9 +244,19 @@ LiveInterval::addRangeFrom(LiveRange LR, iterator From) { return ranges.insert(it, LR); } +/// isInOneLiveRange - Return true if the range specified is entirely in the +/// a single LiveRange of the live interval. +bool LiveInterval::isInOneLiveRange(unsigned Start, unsigned End) { + Ranges::iterator I = std::upper_bound(ranges.begin(), ranges.end(), Start); + if (I == ranges.begin()) + return false; + --I; + return I->contains(Start) && I->contains(End-1); +} + /// removeRange - Remove the specified range from this interval. Note that -/// the range must already be in this interval in its entirety. +/// the range must be in a single LiveRange in its entirety. void LiveInterval::removeRange(unsigned Start, unsigned End, bool RemoveDeadValNo) { // Find the LiveRange containing this span. @@ -547,7 +557,7 @@ void LiveInterval::MergeValueInAsValue(const LiveInterval &RHS, /// used with an unknown definition value. void LiveInterval::MergeInClobberRanges(const LiveInterval &Clobbers, BumpPtrAllocator &VNInfoAllocator) { - if (Clobbers.begin() == Clobbers.end()) return; + if (Clobbers.empty()) return; // Find a value # to use for the clobber ranges. If there is already a value# // for unknown values, use it. @@ -581,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 @@ -642,6 +652,8 @@ void LiveInterval::MergeValueNumberInto(VNInfo *V1, VNInfo *V2) { } else { V1->def = ~1U; } + + return V2; } void LiveInterval::Copy(const LiveInterval &RHS, @@ -678,8 +690,8 @@ void LiveRange::dump() const { void LiveInterval::print(std::ostream &OS, const TargetRegisterInfo *TRI) const { - if (isSS) - OS << "SS#" << reg; + if (isStackSlot()) + OS << "SS#" << getStackSlotIndex(); else if (TRI && TargetRegisterInfo::isPhysicalRegister(reg)) OS << TRI->getName(reg); else