DEBUG shouldEvict decisions
authorAndrew Trick <atrick@apple.com>
Fri, 22 Nov 2013 19:07:42 +0000 (19:07 +0000)
committerAndrew Trick <atrick@apple.com>
Fri, 22 Nov 2013 19:07:42 +0000 (19:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195490 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegAllocBase.cpp
lib/CodeGen/RegAllocGreedy.cpp

index 293e306a29139fc3e66b16e8327ea293934d7bac..2e433811f44a5593b95c78f4a7e9366a6f899bfe 100644 (file)
@@ -101,8 +101,8 @@ void RegAllocBase::allocatePhysRegs() {
     // register if possible and populate a list of new live intervals that
     // result from splitting.
     DEBUG(dbgs() << "\nselectOrSplit "
-                 << MRI->getRegClass(VirtReg->reg)->getName()
-                 << ':' << *VirtReg << '\n');
+          << MRI->getRegClass(VirtReg->reg)->getName()
+          << ':' << *VirtReg << " w=" << VirtReg->weight << '\n');
     typedef SmallVector<unsigned, 4> VirtRegVec;
     VirtRegVec SplitVRegs;
     unsigned AvailablePhysReg = selectOrSplit(*VirtReg, SplitVRegs);
index ce3818a6c214913a3558eecdcf769656ca9f7336..27dc07b54c9bee4de86c5d619e808d6967cb8e34 100644 (file)
@@ -548,7 +548,11 @@ bool RAGreedy::shouldEvict(LiveInterval &A, bool IsHint,
   if (CanSplit && IsHint && !BreaksHint)
     return true;
 
-  return A.weight > B.weight;
+  if (A.weight > B.weight) {
+    DEBUG(dbgs() << "should evict: " << B << " w= " << B.weight << '\n');
+    return true;
+  }
+  return false;
 }
 
 /// canEvictInterference - Return true if all interferences between VirtReg and