30 SmallVectorImpl<std::pair<unsigned, const MachineOperand*>> *Clobbers) {
32 while (LRI != LiveRegs.
end()) {
35 Clobbers->push_back(std::make_pair(*LRI, &MO));
36 LRI = LiveRegs.
erase(LRI);
50 unsigned Reg = O->getReg();
54 }
else if (O->isRegMask())
60 if (!O->isReg() || !O->readsReg() || O->isUndef())
62 unsigned Reg = O->getReg();
74 SmallVectorImpl<std::pair<unsigned, const MachineOperand*>> &Clobbers) {
78 unsigned Reg = O->getReg();
84 Clobbers.push_back(std::make_pair(Reg, &*O));
91 }
else if (O->isRegMask())
96 for (
auto Reg : Clobbers) {
98 if (
Reg.second->isReg() &&
Reg.second->isDead())
106 OS <<
"Live Registers:";
108 OS <<
" (uninitialized)\n";
124 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
125 dbgs() <<
" " << *
this;
const MachineFunction * getParent() const
getParent - Return the MachineFunction containing this basic block.
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
SparseSet< unsigned >::const_iterator const_iterator
iterator_range< succ_iterator > successors()
const std::vector< CalleeSavedInfo > & getCalleeSavedInfo() const
Returns a reference to call saved info vector for the current function.
livein_iterator livein_begin() const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
const_iterator end() const
Reg
All possible values of the reg field in the ModR/M byte.
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
void print(raw_ostream &OS) const
Prints the currently live registers to OS.
PrintReg - Helper class for printing registers on a raw_ostream.
void stepForward(const MachineInstr &MI, SmallVectorImpl< std::pair< unsigned, const MachineOperand * >> &Clobbers)
Simulates liveness when stepping forward over an instruction(bundle): Remove killed-uses, add defs.
virtual const MCPhysReg * getCalleeSavedRegs(const MachineFunction *MF) const =0
getCalleeSavedRegs - Return a null-terminated list of all of the callee saved registers on this targe...
static void addPristines(LivePhysRegs &LiveRegs, const MachineFunction &MF, const TargetRegisterInfo &TRI)
Add pristine registers to the given LiveRegs.
iterator erase(iterator I)
erase - Erases an existing element identified by a valid iterator.
void addLiveOuts(const MachineBasicBlock *MBB, bool AddPristines=false)
Adds all live-out registers of basic block MBB; After prologue/ epilogue insertion AddPristines shoul...
livein_iterator livein_end() const
static void addLiveIns(LivePhysRegs &LiveRegs, const MachineBasicBlock &MBB)
Add live-in registers of basic block MBB to LiveRegs.
void stepBackward(const MachineInstr &MI)
Simulates liveness when stepping backwards over an instruction(bundle): Remove Defs, add uses.
bool isCalleeSavedInfoValid() const
Has the callee saved info been calculated yet?
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
const_iterator begin() const
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
void removeRegsInMask(const MachineOperand &MO, SmallVectorImpl< std::pair< unsigned, const MachineOperand * >> *Clobbers)
Removes physical registers clobbered by the regmask operand MO.
void addLiveIns(const MachineBasicBlock *MBB, bool AddPristines=false)
Adds all live-in registers of basic block MBB; After prologue/ epilogue insertion AddPristines should...
ConstMIBundleOperands - Iterate over all operands in a const bundle of machine instructions.
bool empty() const
Returns true if the set is empty.
MachineOperand class - Representation of each machine instruction operand.
MachineFrameInfo * getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
The CalleeSavedInfo class tracks the information need to locate where a callee saved register is in t...
static bool clobbersPhysReg(const uint32_t *RegMask, unsigned PhysReg)
clobbersPhysReg - Returns true if this RegMask clobbers PhysReg.
Representation of each machine instruction.
void removeReg(unsigned Reg)
Removes a physical register, all its sub-registers, and all its super-registers from the set...
SparseSet - Fast set implmentation for objects that can be identified by small unsigned keys...
A set of live physical registers with functions to track liveness when walking backward/forward throu...
void dump() const
Dumps the currently live registers to the debug output.
bool isValid() const
isValid - Returns true until all the operands have been visited.
This class implements an extremely fast bulk output stream that can only output to a stream...
const_iterator end() const
const_iterator begin() const
void addReg(unsigned Reg)
Adds a physical register and all its sub-registers to the set.