Clear virtual registers after they are no longer referenced.
[oota-llvm.git] / lib / CodeGen / RegAllocFast.cpp
index 6d7b5f4b6567e1e8c74da3fd20042b66315b7cb5..b8b05a9f60d8082bbb01c5717c4f3fa1454b569c 100644 (file)
@@ -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();