diff options
author | Matthias Braun <matze@braunis.de> | 2015-01-21 18:50:21 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2015-01-21 18:50:21 +0000 |
commit | cfb8ad29b525298fb853f4bfaae97af062eb376e (patch) | |
tree | 4cd337774d1f8e82a12bda2ce92c5614be541cfc /llvm/lib/CodeGen/LiveRangeEdit.cpp | |
parent | 1002baf7b908cd1f683fd714e24dc4a7448447e2 (diff) | |
download | bcm5719-llvm-cfb8ad29b525298fb853f4bfaae97af062eb376e.tar.gz bcm5719-llvm-cfb8ad29b525298fb853f4bfaae97af062eb376e.zip |
LiveIntervalAnalysis: Factor out code to update liveness on physreg def removal
This cleans up code and is more in line with the general philosophy of
modifying LiveIntervals through LiveIntervalAnalysis instead of changing
them directly.
llvm-svn: 226687
Diffstat (limited to 'llvm/lib/CodeGen/LiveRangeEdit.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveRangeEdit.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/LiveRangeEdit.cpp b/llvm/lib/CodeGen/LiveRangeEdit.cpp index 47da205df69..c4bfc0e876c 100644 --- a/llvm/lib/CodeGen/LiveRangeEdit.cpp +++ b/llvm/lib/CodeGen/LiveRangeEdit.cpp @@ -256,15 +256,8 @@ void LiveRangeEdit::eliminateDeadDef(MachineInstr *MI, ToShrinkSet &ToShrink) { // Check if MI reads any unreserved physregs. if (Reg && MOI->readsReg() && !MRI.isReserved(Reg)) ReadsPhysRegs = true; - else if (MOI->isDef()) { - for (MCRegUnitIterator Units(Reg, MRI.getTargetRegisterInfo()); - Units.isValid(); ++Units) { - if (LiveRange *LR = LIS.getCachedRegUnit(*Units)) { - if (VNInfo *VNI = LR->getVNInfoAt(Idx)) - LR->removeValNo(VNI); - } - } - } + else if (MOI->isDef()) + LIS.removePhysRegDefAt(Reg, Idx); continue; } LiveInterval &LI = LIS.getInterval(Reg); |