diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-10-15 21:33:06 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-10-15 21:33:06 +0000 |
commit | e4f273908bd37df5f0f6b2c575dcb2af99f6b85b (patch) | |
tree | 51c66c47a113c60fd810f97f4ee9df34118c49b7 /lib/CodeGen/SelectionDAG | |
parent | 64ba6352097d38db5a57f4bf62dcdf14b0e6e147 (diff) | |
download | llvm-e4f273908bd37df5f0f6b2c575dcb2af99f6b85b.tar.gz llvm-e4f273908bd37df5f0f6b2c575dcb2af99f6b85b.tar.bz2 llvm-e4f273908bd37df5f0f6b2c575dcb2af99f6b85b.tar.xz |
Freeze the reserved registers as soon as isel is complete.
Also provide an MRI::getReservedRegs() function to access the frozen
register set, and isReserved() and isAllocatable() methods to test
individual registers.
The various implementations of TRI::getReservedRegs() are quite
complicated, and many passes need to look at the reserved register set.
This patch makes it possible for these passes to use the cached copy in
MRI, avoiding a lot of malloc traffic and repeated calculations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165982 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 8fc9c70f99..c314fa5b51 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -474,6 +474,11 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) { MRI.replaceRegWith(From, To); } + // Freeze the set of reserved registers now that MachineFrameInfo has been + // set up. All the information required by getReservedRegs() should be + // available now. + MRI.freezeReservedRegs(*MF); + // Release function-specific state. SDB and CurDAG are already cleared // at this point. FuncInfo->clear(); |