From 9aeaf7593bb3c124aa8a5aa9623efcf3db3b0534 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Sun, 4 Nov 2007 08:32:21 +0000 Subject: If an interval is being undone clear its preference as well since the source interval may have been undone as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43670 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/RegAllocLinearScan.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen') diff --git a/lib/CodeGen/RegAllocLinearScan.cpp b/lib/CodeGen/RegAllocLinearScan.cpp index 2d675b09b7..98b62cee31 100644 --- a/lib/CodeGen/RegAllocLinearScan.cpp +++ b/lib/CodeGen/RegAllocLinearScan.cpp @@ -209,7 +209,7 @@ void RALinScan::ComputeRelatedRegClasses() { /// 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 @@ void RALinScan::assignRegOrStackSlotAtInterval(LiveInterval* cur) 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 -- cgit v1.2.3