[llvm] r189642 - Replace LiveInterval::killedAt with isKilledAtInstr.

Andrew Trick atrick at apple.com
Thu Aug 29 21:31:01 PDT 2013


Author: atrick
Date: Thu Aug 29 23:31:01 2013
New Revision: 189642

URL: http://llvm.org/viewvc/llvm-project?rev=189642&view=rev
Log:
Replace LiveInterval::killedAt with isKilledAtInstr.

Return true for LRGs that end at EarlyClobber or Register slots.

Modified:
    llvm/trunk/include/llvm/CodeGen/LiveInterval.h
    llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp
    llvm/trunk/lib/CodeGen/RegisterPressure.cpp

Modified: llvm/trunk/include/llvm/CodeGen/LiveInterval.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveInterval.h?rev=189642&r1=189641&r2=189642&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/LiveInterval.h (original)
+++ llvm/trunk/include/llvm/CodeGen/LiveInterval.h Thu Aug 29 23:31:01 2013
@@ -287,12 +287,13 @@ namespace llvm {
       return r != end() && r->start <= index;
     }
 
-    /// killedAt - Return true if a live range ends at index. Note that the kill
-    /// point is not contained in the half-open live range. It is usually the
-    /// getDefIndex() slot following its last use.
-    bool killedAt(SlotIndex index) const {
-      const_iterator r = find(index.getRegSlot(true));
-      return r != end() && r->end == index;
+    /// Return true if a live range ends at the instruction at this index. Note
+    /// that the kill point is not contained in the half-open live range. It is
+    /// usually the EarlyClobber or Register slot following its last use.
+    bool isKilledAtInstr(SlotIndex index) const {
+      SlotIndex BaseIdx = index.getBaseIndex();
+      const_iterator r = find(BaseIdx);
+      return r != end() && r->end.getBaseIndex() == BaseIdx;
     }
 
     /// getLiveRangeContaining - Return the live range that contains the

Modified: llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp?rev=189642&r1=189641&r2=189642&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp Thu Aug 29 23:31:01 2013
@@ -278,7 +278,7 @@ void LiveRangeEdit::eliminateDeadDef(Mac
     // Always shrink COPY uses that probably come from live range splitting.
     if (MI->readsVirtualRegister(Reg) &&
         (MI->isCopy() || MOI->isDef() || MRI.hasOneNonDBGUse(Reg) ||
-         LI.killedAt(Idx)))
+         LI.isKilledAtInstr(Idx)))
       ToShrink.insert(&LI);
 
     // Remove defined value.

Modified: llvm/trunk/lib/CodeGen/RegisterPressure.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterPressure.cpp?rev=189642&r1=189641&r2=189642&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegisterPressure.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegisterPressure.cpp Thu Aug 29 23:31:01 2013
@@ -496,7 +496,7 @@ bool RegPressureTracker::recede(Pressure
       // Adjust liveouts if LiveIntervals are available.
       if (RequireIntervals) {
         const LiveInterval *LI = getInterval(Reg);
-        if (LI && !LI->killedAt(SlotIdx))
+        if (LI && !LI->isKilledAtInstr(SlotIdx))
           discoverLiveOut(Reg);
       }
       increaseRegPressure(Reg);
@@ -550,7 +550,7 @@ bool RegPressureTracker::advance() {
     bool lastUse = false;
     if (RequireIntervals) {
       const LiveInterval *LI = getInterval(Reg);
-      lastUse = LI && LI->killedAt(SlotIdx);
+      lastUse = LI && LI->isKilledAtInstr(SlotIdx);
     }
     else {
       // Allocatable physregs are always single-use before register rewriting.
@@ -886,7 +886,7 @@ void RegPressureTracker::bumpDownwardPre
       // to be bottom-scheduled to avoid searching uses at each query.
       SlotIndex CurrIdx = getCurrSlot();
       const LiveInterval *LI = getInterval(Reg);
-      if (LI && LI->killedAt(SlotIdx)
+      if (LI && LI->isKilledAtInstr(SlotIdx)
           && !findUseBetween(Reg, CurrIdx, SlotIdx, MRI, LIS)) {
         decreaseRegPressure(Reg);
       }





More information about the llvm-commits mailing list