Skip to content

Commit 0553257

Browse files
committed
[RDA] Skip debug values
Skip debug instructions when iterating through a block to find uses. Differential Revision: https://reviews.llvm.org/D73273
1 parent 618fa77 commit 0553257

File tree

2 files changed

+363
-0
lines changed

2 files changed

+363
-0
lines changed

llvm/lib/CodeGen/ReachingDefAnalysis.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,9 @@ void ReachingDefAnalysis::getReachingLocalUses(MachineInstr *Def, int PhysReg,
231231
MachineBasicBlock *MBB = Def->getParent();
232232
MachineBasicBlock::iterator MI = MachineBasicBlock::iterator(Def);
233233
while (++MI != MBB->end()) {
234+
if (MI->isDebugInstr())
235+
continue;
236+
234237
// If/when we find a new reaching def, we know that there's no more uses
235238
// of 'Def'.
236239
if (getReachingMIDef(&*MI, PhysReg) != Def)
@@ -251,6 +254,8 @@ bool
251254
ReachingDefAnalysis::getLiveInUses(MachineBasicBlock *MBB, int PhysReg,
252255
SmallPtrSetImpl<MachineInstr*> &Uses) const {
253256
for (auto &MI : *MBB) {
257+
if (MI.isDebugInstr())
258+
continue;
254259
for (auto &MO : MI.operands()) {
255260
if (!MO.isReg() || !MO.isUse() || MO.getReg() != PhysReg)
256261
continue;

0 commit comments

Comments
 (0)