From bed9711ca81e2bfe24df46ae2147417df4b3902e Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Fri, 17 Jun 2011 23:26:52 +0000 Subject: [PATCH] Only call TRI::getRawAllocationOrder to resolve a target-dependent hint. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133313 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/RegAllocLinearScan.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/RegAllocLinearScan.cpp b/lib/CodeGen/RegAllocLinearScan.cpp index 0818034c15c..7a2ea6c4084 100644 --- a/lib/CodeGen/RegAllocLinearScan.cpp +++ b/lib/CodeGen/RegAllocLinearScan.cpp @@ -1440,8 +1440,12 @@ unsigned RALinScan::getFreePhysReg(LiveInterval* cur, if (TargetRegisterInfo::isVirtualRegister(physReg) && vrm_->hasPhys(physReg)) physReg = vrm_->getPhys(physReg); - ArrayRef Order = tri_->getRawAllocationOrder(RC, Hint.first, - physReg, *mf_); + ArrayRef Order; + if (Hint.first) + Order = tri_->getRawAllocationOrder(RC, Hint.first, physReg, *mf_); + else + Order = RegClassInfo.getOrder(RC); + assert(!Order.empty() && "No allocatable register in this register class!"); // Scan for the first available register. -- 2.34.1