29 #ifndef LLVM_CODEGEN_LIVEVARIABLES_H
30 #define LLVM_CODEGEN_LIVEVARIABLES_H
43 class MachineBasicBlock;
44 class MachineRegisterInfo;
89 std::vector<MachineInstr*>
Kills;
95 std::vector<MachineInstr*>::iterator
199 bool AddIfNotFound =
false) {
212 bool Removed =
false;
222 assert(Removed &&
"Register is not used by this instruction!");
235 bool AddIfNotFound =
false) {
248 bool Removed =
false;
257 assert(Removed &&
"Register is not defined by this instruction!");
276 std::vector<MachineBasicBlock*> &WorkList);
static PassRegistry * getPassRegistry()
bool removeKill(MachineInstr *MI)
bool addRegisterDead(unsigned Reg, const TargetRegisterInfo *RegInfo, bool AddIfNotFound=false)
bool isLiveOut(unsigned Reg, const MachineBasicBlock &MBB)
void setIsDead(bool Val=true)
void initializeLiveVariablesPass(PassRegistry &)
bool isReg() const
isReg - Tests if this is a MO_Register operand.
void replaceKillInstruction(unsigned Reg, MachineInstr *OldMI, MachineInstr *NewMI)
SparseBitVector AliveBlocks
unsigned getNumOperands() const
void removeVirtualRegistersKilled(MachineInstr *MI)
void setPHIJoin(unsigned Reg)
setPHIJoin - Mark Reg as a phi join register.
bool removeVirtualRegisterDead(unsigned reg, MachineInstr *MI)
const MachineOperand & getOperand(unsigned i) const
bool isPHIJoin(unsigned Reg)
isPHIJoin - Return true if Reg is a phi join register.
VarInfo & getVarInfo(unsigned RegIdx)
getVarInfo - Get (possibly creating) a VarInfo object for the given vreg.
void MarkVirtRegAliveInBlock(VarInfo &VRInfo, MachineBasicBlock *DefBlock, MachineBasicBlock *BB)
void setIsKill(bool Val=true)
void addNewBlock(MachineBasicBlock *BB, MachineBasicBlock *DomBB, MachineBasicBlock *SuccBB)
std::vector< MachineInstr * > Kills
bool removeVirtualRegisterKilled(unsigned reg, MachineInstr *MI)
bool isLiveIn(const MachineBasicBlock &MBB, unsigned Reg, MachineRegisterInfo &MRI)
void HandleVirtRegDef(unsigned reg, MachineInstr *MI)
virtual void releaseMemory()
MachineInstr * findKill(const MachineBasicBlock *MBB) const
findKill - Find a kill instruction in MBB. Return NULL if none is found.
void addVirtualRegisterDead(unsigned IncomingReg, MachineInstr *MI, bool AddIfNotFound=false)
unsigned getReg() const
getReg - Returns the register number.
virtual bool runOnMachineFunction(MachineFunction &MF)
bool addRegisterKilled(unsigned IncomingReg, const TargetRegisterInfo *RegInfo, bool AddIfNotFound=false)
void getAnalysisUsage(AnalysisUsage &AU) const
bool RegisterDefIsDead(MachineInstr *MI, unsigned Reg) const
bool isLiveIn(unsigned Reg, const MachineBasicBlock &MBB)
void addVirtualRegisterKilled(unsigned IncomingReg, MachineInstr *MI, bool AddIfNotFound=false)
void HandleVirtRegUse(unsigned reg, MachineBasicBlock *MBB, MachineInstr *MI)