X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FLiveInterval.cpp;h=ff430d71c7d79247424a406ae98202990f42c53e;hb=b382c4dc235b78b606b305f1913fafc20eca472c;hp=48c25a14a3506a687fd0bc88b31758599c1bb50b;hpb=4c71dfe356716e6bc1993ef5efdced08b68fe612;p=oota-llvm.git diff --git a/lib/CodeGen/LiveInterval.cpp b/lib/CodeGen/LiveInterval.cpp index 48c25a14a35..ff430d71c7d 100644 --- a/lib/CodeGen/LiveInterval.cpp +++ b/lib/CodeGen/LiveInterval.cpp @@ -358,6 +358,20 @@ LiveInterval::FindLiveRangeContaining(unsigned Idx) { return end(); } +/// findDefinedVNInfo - Find the VNInfo that's defined at the specified index +/// (register interval) or defined by the specified register (stack inteval). +VNInfo *LiveInterval::findDefinedVNInfo(unsigned DefIdxOrReg) const { + VNInfo *VNI = NULL; + for (LiveInterval::const_vni_iterator i = vni_begin(), e = vni_end(); + i != e; ++i) + if ((*i)->def == DefIdxOrReg) { + VNI = *i; + break; + } + return VNI; +} + + /// join - Join two live intervals (this, and other) together. This applies /// mappings to the value numbers in the LHS/RHS intervals as specified. If /// the intervals are not joinable, this aborts. @@ -533,7 +547,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. @@ -664,7 +678,9 @@ void LiveRange::dump() const { void LiveInterval::print(std::ostream &OS, const TargetRegisterInfo *TRI) const { - if (TRI && TargetRegisterInfo::isPhysicalRegister(reg)) + if (isStackSlot()) + OS << "SS#" << getStackSlotIndex(); + else if (TRI && TargetRegisterInfo::isPhysicalRegister(reg)) OS << TRI->getName(reg); else OS << "%reg" << reg; @@ -672,7 +688,7 @@ void LiveInterval::print(std::ostream &OS, OS << ',' << weight; if (empty()) - OS << "EMPTY"; + OS << " EMPTY"; else { OS << " = "; for (LiveInterval::Ranges::const_iterator I = ranges.begin(),