diff options
| author | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2016-09-02 19:48:55 +0000 |
|---|---|---|
| committer | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2016-09-02 19:48:55 +0000 |
| commit | 3bf4aeccd607fbc86429f3b26e18c1f1cdfda77c (patch) | |
| tree | a137a1faa25bebb727d1a42f2102f1e6ac504b17 /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | |
| parent | 70277411d3dd780ae794da3621204823bb9344f8 (diff) | |
| download | bcm5719-llvm-3bf4aeccd607fbc86429f3b26e18c1f1cdfda77c.tar.gz bcm5719-llvm-3bf4aeccd607fbc86429f3b26e18c1f1cdfda77c.zip | |
Do not consider subreg defs as reads when computing subrange liveness
Subregister definitions are considered uses for the purpose of tracking
liveness of the whole register. At the same time, when calculating live
interval subranges, subregister defs should not be treated as uses.
Differential Revision: https://reviews.llvm.org/D24190
llvm-svn: 280532
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp index a3122763806..4195f007d43 100644 --- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -506,20 +506,19 @@ void LiveIntervals::shrinkToUses(LiveInterval::SubRange &SR, unsigned Reg) { // Visit all instructions reading Reg. SlotIndex LastIdx; - for (MachineOperand &MO : MRI->reg_operands(Reg)) { - MachineInstr *UseMI = MO.getParent(); - if (UseMI->isDebugValue() || !MO.readsReg()) + for (MachineOperand &MO : MRI->use_nodbg_operands(Reg)) { + // Skip "undef" uses. + if (!MO.readsReg()) continue; // Maybe the operand is for a subregister we don't care about. unsigned SubReg = MO.getSubReg(); if (SubReg != 0) { LaneBitmask LaneMask = TRI->getSubRegIndexLaneMask(SubReg); - if (MO.isDef()) - LaneMask = ~LaneMask & MRI->getMaxLaneMaskForVReg(Reg); if ((LaneMask & SR.LaneMask) == 0) continue; } // We only need to visit each instruction once. + MachineInstr *UseMI = MO.getParent(); SlotIndex Idx = getInstructionIndex(*UseMI).getRegSlot(); if (Idx == LastIdx) continue; |

