summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegAllocFast.cpp
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2012-02-21 04:51:23 +0000
committerAndrew Trick <atrick@apple.com>2012-02-21 04:51:23 +0000
commitda84e6468304500dc65813aee8728bee18ac6578 (patch)
tree82aa6ab0593f8013f860f9141b97bafadbc89db4 /llvm/lib/CodeGen/RegAllocFast.cpp
parent5c714e79859116672383af512efc032dc1cb5ca7 (diff)
downloadbcm5719-llvm-da84e6468304500dc65813aee8728bee18ac6578.tar.gz
bcm5719-llvm-da84e6468304500dc65813aee8728bee18ac6578.zip
Clear virtual registers after they are no longer referenced.
Passes after RegAlloc should be able to rely on MRI->getNumVirtRegs() == 0. This makes sharing code for pre/postRA passes more robust. Now, to check if a pass is running before the RA pipeline begins, use MRI->isSSA(). To check if a pass is running after the RA pipeline ends, use !MRI->getNumVirtRegs(). PEI resets virtual regs when it's done scavenging. PTX will either have to provide its own PEI pass or assign physregs. llvm-svn: 151032
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocFast.cpp')
-rw-r--r--llvm/lib/CodeGen/RegAllocFast.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/RegAllocFast.cpp b/llvm/lib/CodeGen/RegAllocFast.cpp
index 6d7b5f4b656..b8b05a9f60d 100644
--- a/llvm/lib/CodeGen/RegAllocFast.cpp
+++ b/llvm/lib/CodeGen/RegAllocFast.cpp
@@ -1104,6 +1104,10 @@ bool RAFast::runOnMachineFunction(MachineFunction &Fn) {
while (*Defs)
MRI->setPhysRegUsed(*Defs++);
+ // All machine operands and other references to virtual registers have been
+ // replaced. Remove the virtual registers.
+ MRI->clearVirtRegs();
+
SkippedInstrs.clear();
StackSlotForVirtReg.clear();
LiveDbgValueMap.clear();
OpenPOWER on IntegriCloud