]> granicus.if.org Git - llvm/commitdiff
Revert "[RegAlloc] Make sure live-ranges reflect the state of the IR when removing...
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>
Thu, 7 Sep 2017 09:13:17 +0000 (09:13 +0000)
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>
Thu, 7 Sep 2017 09:13:17 +0000 (09:13 +0000)
This temporarily reverts commit 463fa38 (r311401).

See https://bugs.llvm.org/show_bug.cgi?id=34502

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312708 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegAllocBasic.cpp
lib/CodeGen/RegAllocGreedy.cpp

index 5ecde0c9d9f8b275f0f136c96362956e3a3a9ca7..774306154a894b85a109b45eb583476b9ab23d78 100644 (file)
@@ -143,17 +143,14 @@ INITIALIZE_PASS_END(RABasic, "regallocbasic", "Basic Register Allocator", false,
                     false)
 
 bool RABasic::LRE_CanEraseVirtReg(unsigned VirtReg) {
-  LiveInterval &LI = LIS->getInterval(VirtReg);
   if (VRM->hasPhys(VirtReg)) {
+    LiveInterval &LI = LIS->getInterval(VirtReg);
     Matrix->unassign(LI);
     aboutToRemoveInterval(LI);
     return true;
   }
   // Unassigned virtreg is probably in the priority queue.
   // RegAllocBase will erase it after dequeueing.
-  // Nonetheless, clear the live-range so that the debug
-  // dump will show the right state for that VirtReg.
-  LI.clear();
   return false;
 }
 
index 6f0b7a936c55094bb0faf6023a6a6531e56ff853..020e81eca2dd20fce7ad8cf091921f96fce0f272 100644 (file)
@@ -546,17 +546,14 @@ void RAGreedy::getAnalysisUsage(AnalysisUsage &AU) const {
 //===----------------------------------------------------------------------===//
 
 bool RAGreedy::LRE_CanEraseVirtReg(unsigned VirtReg) {
-  LiveInterval &LI = LIS->getInterval(VirtReg);
   if (VRM->hasPhys(VirtReg)) {
+    LiveInterval &LI = LIS->getInterval(VirtReg);
     Matrix->unassign(LI);
     aboutToRemoveInterval(LI);
     return true;
   }
   // Unassigned virtreg is probably in the priority queue.
   // RegAllocBase will erase it after dequeueing.
-  // Nonetheless, clear the live-range so that the debug
-  // dump will show the right state for that VirtReg.
-  LI.clear();
   return false;
 }