diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-12-10 22:21:05 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-12-10 22:21:05 +0000 |
commit | 4d7432ebf1b4b81b00793ad4b7f5bb4403742a16 (patch) | |
tree | 898d4d56d29d098e1e7806ee8488a8bb8961cf1f /llvm/lib/CodeGen/AllocationOrder.cpp | |
parent | 9375d27460f1ee184d53a55dd105393a0b298c1d (diff) | |
download | bcm5719-llvm-4d7432ebf1b4b81b00793ad4b7f5bb4403742a16.tar.gz bcm5719-llvm-4d7432ebf1b4b81b00793ad4b7f5bb4403742a16.zip |
Use AllocationOrder in RegAllocGreedy, fix a bug in the hint calculation.
llvm-svn: 121584
Diffstat (limited to 'llvm/lib/CodeGen/AllocationOrder.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AllocationOrder.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AllocationOrder.cpp b/llvm/lib/CodeGen/AllocationOrder.cpp index 3f08439fac5..26d4cd4d753 100644 --- a/llvm/lib/CodeGen/AllocationOrder.cpp +++ b/llvm/lib/CodeGen/AllocationOrder.cpp @@ -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() { |