From f103029d0d0f8f285ee9fc539dcf5b5ec393eee2 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Wed, 10 Jan 2018 22:36:26 +0000 Subject: [PATCH] LiveRangeEdit: Inline markDeadRemat() into only user; NFC This function was only called from a single place in which we didn't even need the `if (DeadRemats)` check. llvm-svn: 322230 --- include/llvm/CodeGen/LiveRangeEdit.h | 6 ------ lib/CodeGen/LiveRangeEdit.cpp | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/include/llvm/CodeGen/LiveRangeEdit.h b/include/llvm/CodeGen/LiveRangeEdit.h index 84ca51e3d72..82b1f0b0de7 100644 --- a/include/llvm/CodeGen/LiveRangeEdit.h +++ b/include/llvm/CodeGen/LiveRangeEdit.h @@ -233,12 +233,6 @@ public: return Rematted.count(ParentVNI); } - void markDeadRemat(MachineInstr *inst) { - // DeadRemats is an optional field. - if (DeadRemats) - DeadRemats->insert(inst); - } - /// eraseVirtReg - Notify the delegate that Reg is no longer in use, and try /// to erase it from LIS. void eraseVirtReg(unsigned Reg); diff --git a/lib/CodeGen/LiveRangeEdit.cpp b/lib/CodeGen/LiveRangeEdit.cpp index d00b3607867..22f6b3260f4 100644 --- a/lib/CodeGen/LiveRangeEdit.cpp +++ b/lib/CodeGen/LiveRangeEdit.cpp @@ -364,7 +364,7 @@ void LiveRangeEdit::eliminateDeadDef(MachineInstr *MI, ToShrinkSet &ToShrink, VNInfo *VNI = NewLI.getNextValue(Idx, LIS.getVNInfoAllocator()); NewLI.addSegment(LiveInterval::Segment(Idx, Idx.getDeadSlot(), VNI)); pop_back(); - markDeadRemat(MI); + DeadRemats->insert(MI); const TargetRegisterInfo &TRI = *MRI.getTargetRegisterInfo(); MI->substituteRegister(Dest, NewLI.reg, 0, TRI); MI->getOperand(0).setIsDead(true);