[llvm-commits] [llvm] r127773 - /llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp
Jakob Stoklund Olesen
stoklund at 2pi.dk
Wed Mar 16 15:56:14 PDT 2011
Author: stoklund
Date: Wed Mar 16 17:56:13 2011
New Revision: 127773
URL: http://llvm.org/viewvc/llvm-project?rev=127773&view=rev
Log:
Erase virtual registers that are unused after DCE.
Modified:
llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp
Modified: llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp?rev=127773&r1=127772&r2=127773&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp Wed Mar 16 17:56:13 2011
@@ -174,13 +174,21 @@
if (!TargetRegisterInfo::isVirtualRegister(Reg))
continue;
LiveInterval &LI = LIS.getInterval(Reg);
- // Remove defined value.
- if (MOI->isDef())
- if (VNInfo *VNI = LI.getVNInfoAt(Idx))
- LI.removeValNo(VNI);
+
// Shrink read registers.
if (MI->readsVirtualRegister(Reg))
ToShrink.insert(&LI);
+
+ // Remove defined value.
+ if (MOI->isDef()) {
+ if (VNInfo *VNI = LI.getVNInfoAt(Idx)) {
+ LI.removeValNo(VNI);
+ if (LI.empty()) {
+ ToShrink.remove(&LI);
+ eraseVirtReg(Reg, LIS);
+ }
+ }
+ }
}
if (delegate_)
More information about the llvm-commits
mailing list