26 #define DEBUG_TYPE "codegen-dce"
28 STATISTIC(NumDeletes,
"Number of dead instructions deleted");
53 "Remove dead machine instructions",
false,
false)
59 if (MI->isInlineAsm())
68 if (!MI->isSafeToMove(
nullptr, SawStore) && !MI->isPHI())
72 for (
unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
81 if (!MRI->use_nodbg_empty(Reg))
92 bool DeadMachineInstructionElim::runOnMachineFunction(
MachineFunction &MF) {
96 bool AnyChanges =
false;
117 LI != (*S)->livein_end(); LI++)
123 MIE = MBB->
rend(); MII != MIE; ) {
128 DEBUG(
dbgs() <<
"DeadMachineInstructionElim: DELETING: " << *MI);
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
STATISTIC(NumFunctions,"Total number of functions")
bool isValid() const
isValid - returns true if this iterator is not yet at the end.
std::reverse_iterator< iterator > reverse_iterator
std::vector< unsigned >::const_iterator livein_iterator
const Function * getFunction() const
getFunction - Return the LLVM function that this machine code represents
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
const HexagonInstrInfo * TII
bool isReg() const
isReg - Tests if this is a MO_Register operand.
std::vector< MachineBasicBlock * >::iterator succ_iterator
Reg
All possible values of the reg field in the ModR/M byte.
void eraseFromParentAndMarkDBGValuesForRemoval()
Unlink 'this' from the containing basic block and delete it.
unsigned getNumOperands() const
Access to explicit operands of the instruction.
char & DeadMachineInstructionElimID
DeadMachineInstructionElim - This pass removes dead machine instructions.
reverse_iterator rbegin()
TargetInstrInfo - Interface to description of machine instruction set.
Instruction that records the offset of a local stack allocation passed to llvm.localescape.
void initializeDeadMachineInstructionElimPass(PassRegistry &)
const MachineOperand & getOperand(unsigned i) const
MCRegAliasIterator enumerates all registers aliasing Reg.
succ_iterator succ_begin()
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
MCSubRegIterator enumerates all sub-registers of Reg.
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
bool isRegMask() const
isRegMask - Tests if this is a MO_RegisterMask operand.
const uint32_t * getRegMask() const
getRegMask - Returns a bit mask of registers preserved by this RegMask operand.
MachineOperand class - Representation of each machine instruction operand.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
Representation of each machine instruction.
static bool isPhysicalRegister(unsigned Reg)
isPhysicalRegister - Return true if the specified register number is in the physical register namespa...
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
A set of live physical registers with functions to track liveness when walking backward/forward throu...
unsigned getReg() const
getReg - Returns the register number.
void clear()
Clears the LivePhysRegs set.
virtual const TargetInstrInfo * getInstrInfo() const
std::reverse_iterator< iterator > reverse_iterator
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
reverse_iterator rbegin()