[llvm-commits] [llvm] r43670 - /llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp

Evan Cheng evan.cheng at apple.com
Sun Nov 4 01:32:21 PDT 2007


Author: evancheng
Date: Sun Nov  4 02:32:21 2007
New Revision: 43670

URL: http://llvm.org/viewvc/llvm-project?rev=43670&view=rev
Log:
If an interval is being undone clear its preference as well since the source interval may have been undone as well.

Modified:
    llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp

Modified: llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp?rev=43670&r1=43669&r2=43670&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp Sun Nov  4 02:32:21 2007
@@ -209,7 +209,7 @@
 /// different register classes or because the coalescer was overly
 /// conservative.
 unsigned RALinScan::attemptTrivialCoalescing(LiveInterval &cur, unsigned Reg) {
-  if (cur.preference && cur.preference == Reg || !cur.containsOneValue())
+  if ((cur.preference && cur.preference == Reg) || !cur.containsOneValue())
     return Reg;
 
   VNInfo *vni = cur.getValNumInfo(0);
@@ -791,6 +791,11 @@
       vrm_->clearVirt(i->reg);
       unhandled_.push(i);
     }
+
+    // It interval has a preference, it must be defined by a copy. Clear the
+    // preference now since the source interval allocation may have been undone
+    // as well.
+    i->preference = 0;
   }
 
   // Rewind the iterators in the active, inactive, and fixed lists back to the





More information about the llvm-commits mailing list