30 #ifndef LLVM_CODEGEN_LIVEPHYSREGS_H 31 #define LLVM_CODEGEN_LIVEPHYSREGS_H 44 class MachineRegisterInfo;
81 assert(TRI &&
"LivePhysRegs is not initialized.");
82 assert(Reg <= TRI->getNumRegs() &&
"Expected a physical register.");
91 assert(TRI &&
"LivePhysRegs is not initialized.");
92 assert(Reg <= TRI->getNumRegs() &&
"Expected a physical register.");
99 SmallVectorImpl<std::pair<MCPhysReg, const MachineOperand*>> *Clobbers =
130 SmallVectorImpl<std::pair<MCPhysReg, const MachineOperand*>> &Clobbers);
198 #endif // LLVM_CODEGEN_LIVEPHYSREGS_H This class represents lattice values for constants.
void dump() const
Dumps the currently live registers to the debug output.
std::pair< iterator, bool > insert(const ValueT &Val)
insert - Attempts to insert a new element.
LivePhysRegs()=default
Constructs an unitialized set. init() needs to be called to initialize it.
bool contains(MCPhysReg Reg) const
Returns true if register Reg is contained in the set.
const_iterator begin() const
bool empty() const
Returns true if the set is empty.
size_type count(const KeyT &Key) const
count - Returns 1 if this set contains an element identified by Key, 0 otherwise. ...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
iterator erase(iterator I)
erase - Erases an existing element identified by a valid iterator.
bool empty() const
empty - Returns true if the set is empty.
unsigned getNumRegs() const
Return the number of registers this target has (useful for sizing arrays holding per register informa...
unsigned const MachineRegisterInfo * MRI
typename DenseT::const_iterator const_iterator
void addLiveOuts(const MachineBasicBlock &MBB)
Adds all live-out registers of basic block MBB.
void addLiveIns(const MachineBasicBlock &MBB)
Adds all live-in registers of basic block MBB.
LivePhysRegs & operator=(const LivePhysRegs &)=delete
void addUses(const MachineInstr &MI)
Add uses to the set.
void init(const TargetRegisterInfo &TRI)
(re-)initializes and clears the set.
MCRegAliasIterator enumerates all registers aliasing Reg.
void stepBackward(const MachineInstr &MI)
Simulates liveness when stepping backwards over an instruction(bundle).
void clearLiveIns()
Clear live in list.
void setUniverse(unsigned U)
setUniverse - Set the universe size which determines the largest key the set can hold.
RegisterSet::const_iterator const_iterator
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
MCSubRegIterator enumerates all sub-registers of Reg.
void addLiveOutsNoPristines(const MachineBasicBlock &MBB)
Adds all live-out registers of basic block MBB but skips pristine registers.
const_iterator end() const
void computeLiveIns(LivePhysRegs &LiveRegs, const MachineBasicBlock &MBB)
Computes registers live-in to MBB assuming all of its successors live-in lists are up-to-date...
bool available(const MachineRegisterInfo &MRI, MCPhysReg Reg) const
Returns true if register Reg and no aliasing register is in the set.
MachineOperand class - Representation of each machine instruction operand.
const_iterator begin() const
bool isValid() const
isValid - returns true if this iterator is not yet at the end.
LivePhysRegs(const TargetRegisterInfo &TRI)
Constructs and initializes an empty set.
void computeAndAddLiveIns(LivePhysRegs &LiveRegs, MachineBasicBlock &MBB)
Convenience function combining computeLiveIns() and addLiveIns().
void print(raw_ostream &OS) const
Prints the currently live registers to OS.
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.
void removeDefs(const MachineInstr &MI)
Remove defined registers and regmask kills from the set.
A set of physical registers with utility functions to track liveness when walking backward/forward th...
const_iterator end() const
raw_ostream & operator<<(raw_ostream &OS, const APInt &I)
void clear()
clear - Clears the set.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void clear()
Clears the set.
void removeRegsInMask(const MachineOperand &MO, SmallVectorImpl< std::pair< MCPhysReg, const MachineOperand *>> *Clobbers=nullptr)
Removes physical registers clobbered by the regmask operand MO.
static void recomputeLiveIns(MachineBasicBlock &MBB)
Convenience function for recomputing live-in's for MBB.
void addReg(MCPhysReg Reg)
Adds a physical register and all its sub-registers to the set.
This class implements an extremely fast bulk output stream that can only output to a stream...
void removeReg(MCPhysReg Reg)
Removes a physical register, all its sub-registers, and all its super-registers from the set...
void stepForward(const MachineInstr &MI, SmallVectorImpl< std::pair< MCPhysReg, const MachineOperand *>> &Clobbers)
Simulates liveness when stepping forward over an instruction(bundle).
void recomputeLivenessFlags(MachineBasicBlock &MBB)
Recomputes dead and kill flags in MBB.