Use AllocationOrder in RegAllocGreedy, fix a bug in the hint calculation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121584 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen
2010-12-10 22:21:05 +00:00
parent 746fa17d59
commit dd479e9769
2 changed files with 10 additions and 25 deletions
+4 -4
View File
@@ -36,6 +36,10 @@ AllocationOrder::AllocationOrder(unsigned VirtReg,
if (Hint && TargetRegisterInfo::isVirtualRegister(Hint))
Hint = VRM.getPhys(Hint);
// The remaining allocation order may depend on the hint.
tie(Begin, End) = VRM.getTargetRegInfo()
.getAllocationOrder(RC, HintPair.first, Hint, VRM.getMachineFunction());
// Target-dependent hints require resolution.
if (HintPair.first)
Hint = VRM.getTargetRegInfo().ResolveRegAllocHint(HintPair.first, Hint,
@@ -45,10 +49,6 @@ AllocationOrder::AllocationOrder(unsigned VirtReg,
if (Hint && (!TargetRegisterInfo::isPhysicalRegister(Hint) ||
!RC->contains(Hint) || ReservedRegs.test(Hint)))
Hint = 0;
// The remaining allocation order may also depend on the hint.
tie(Begin, End) = VRM.getTargetRegInfo()
.getAllocationOrder(RC, HintPair.first, Hint, VRM.getMachineFunction());
}
unsigned AllocationOrder::next() {