LLVM API Documentation
#include <LiveVariables.h>
Definition at line 45 of file LiveVariables.h.
| llvm::LiveVariables::LiveVariables | ( | ) | [inline] |
Definition at line 48 of file LiveVariables.h.
| bool LiveVariables::runOnMachineFunction | ( | MachineFunction & | MF | ) | [virtual] |
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformation or analysis.
Implements llvm::MachineFunctionPass.
Definition at line 493 of file LiveVariables.cpp.
References llvm::MachineInstr::addOperand(), llvm::MachineBasicBlock::back(), llvm::SmallVectorImpl< T >::begin(), llvm::MachineBasicBlock::begin(), llvm::MachineFunction::begin(), llvm::SmallPtrSet< PtrType, SmallSize >::count(), llvm::MachineOperand::CreateReg(), llvm::df_ext_begin(), llvm::df_ext_end(), E, llvm::MachineBasicBlock::empty(), llvm::SmallVectorImpl< T >::empty(), llvm::MachineFunction::end(), llvm::SmallVectorImpl< T >::end(), llvm::MachineBasicBlock::end(), Entry, llvm::TargetRegisterInfo::FirstVirtualRegister, llvm::MachineInstr::getDesc(), llvm::MachineBasicBlock::getNumber(), llvm::MachineFunction::getNumBlockIDs(), llvm::MachineInstr::getNumOperands(), llvm::TargetRegisterInfo::getNumRegs(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::TargetMachine::getRegisterInfo(), llvm::TargetRegisterInfo::getReservedRegs(), llvm::MachineFunction::getTarget(), getVarInfo(), llvm::MachineRegisterInfo::getVRegDef(), HandleVirtRegDef(), HandleVirtRegUse(), II, llvm::MachineOperand::isDef(), llvm::TargetRegisterInfo::isPhysicalRegister(), llvm::MachineOperand::isReg(), llvm::TargetInstrDesc::isReturn(), llvm::MachineOperand::isUse(), llvm::TargetRegisterInfo::isVirtualRegister(), llvm::MachineBasicBlock::livein_begin(), llvm::MachineBasicBlock::livein_end(), llvm::MachineRegisterInfo::liveout_begin(), llvm::MachineRegisterInfo::liveout_end(), MarkVirtRegAliveInBlock(), llvm::TargetInstrInfo::PHI, llvm::SmallVectorImpl< T >::push_back(), llvm::MachineInstr::readsRegister(), llvm::MipsISD::Ret, llvm::SmallVectorImpl< T >::size(), and Visited.
| bool llvm::LiveVariables::RegisterDefIsDead | ( | MachineInstr * | MI, | |
| unsigned | Reg | |||
| ) | const |
RegisterDefIsDead - Return true if the specified instruction defines the specified register, but that definition is dead.
| void LiveVariables::replaceKillInstruction | ( | unsigned | Reg, | |
| MachineInstr * | OldMI, | |||
| MachineInstr * | NewMI | |||
| ) |
replaceKillInstruction - Update register kill info by replacing a kill instruction with a new one.
replaceKillInstruction - Update register kill info by replacing a kill instruction with a new one.
Definition at line 655 of file LiveVariables.cpp.
References getVarInfo(), and llvm::LiveVariables::VarInfo::Kills.
Referenced by llvm::X86InstrInfo::convertToThreeAddress().
| void llvm::LiveVariables::addVirtualRegisterKilled | ( | unsigned | IncomingReg, | |
| MachineInstr * | MI, | |||
| bool | AddIfNotFound = false | |||
| ) | [inline] |
addVirtualRegisterKilled - Add information about the fact that the specified register is killed after being used by the specified instruction. If AddIfNotFound is true, add a implicit operand if it's not found.
Definition at line 187 of file LiveVariables.h.
References llvm::MachineInstr::addRegisterKilled(), getVarInfo(), and llvm::LiveVariables::VarInfo::Kills.
Referenced by llvm::ARMBaseInstrInfo::convertToThreeAddress().
| bool llvm::LiveVariables::removeVirtualRegisterKilled | ( | unsigned | reg, | |
| MachineInstr * | MI | |||
| ) | [inline] |
removeVirtualRegisterKilled - Remove the specified kill of the virtual register from the live variable information. Returns true if the variable was marked as killed by the specified instruction, false otherwise.
Definition at line 197 of file LiveVariables.h.
References llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), getVarInfo(), llvm::MachineOperand::isKill(), llvm::MachineOperand::isReg(), and llvm::MachineOperand::setIsKill().
| void LiveVariables::removeVirtualRegistersKilled | ( | MachineInstr * | MI | ) |
removeVirtualRegistersKilled - Remove all killed info for the specified instruction.
removeVirtualRegistersKilled - Remove all killed info for the specified instruction.
Definition at line 663 of file LiveVariables.cpp.
References llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), getVarInfo(), llvm::MachineOperand::isKill(), llvm::MachineOperand::isReg(), llvm::TargetRegisterInfo::isVirtualRegister(), llvm::LiveVariables::VarInfo::removeKill(), and llvm::MachineOperand::setIsKill().
| void llvm::LiveVariables::addVirtualRegisterDead | ( | unsigned | IncomingReg, | |
| MachineInstr * | MI, | |||
| bool | AddIfNotFound = false | |||
| ) | [inline] |
addVirtualRegisterDead - Add information about the fact that the specified register is dead after being used by the specified instruction. If AddIfNotFound is true, add a implicit operand if it's not found.
Definition at line 222 of file LiveVariables.h.
References llvm::MachineInstr::addRegisterDead(), getVarInfo(), and llvm::LiveVariables::VarInfo::Kills.
Referenced by llvm::ARMBaseInstrInfo::convertToThreeAddress().
| bool llvm::LiveVariables::removeVirtualRegisterDead | ( | unsigned | reg, | |
| MachineInstr * | MI | |||
| ) | [inline] |
removeVirtualRegisterDead - Remove the specified kill of the virtual register from the live variable information. Returns true if the variable was marked dead at the specified instruction, false otherwise.
Definition at line 232 of file LiveVariables.h.
References llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), getVarInfo(), llvm::MachineOperand::isDef(), llvm::MachineOperand::isReg(), and llvm::MachineOperand::setIsDead().
| void LiveVariables::getAnalysisUsage | ( | AnalysisUsage & | AU | ) | const [virtual] |
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
For MachineFunctionPasses, calling AU.preservesCFG() indicates that the pass does not modify the MachineBasicBlock CFG.
Reimplemented from llvm::MachineFunctionPass.
Definition at line 48 of file LiveVariables.cpp.
References llvm::AnalysisUsage::addRequiredID(), llvm::MachineFunctionPass::getAnalysisUsage(), llvm::AnalysisUsage::setPreservesAll(), and llvm::UnreachableMachineBlockElimID.
| virtual void llvm::LiveVariables::releaseMemory | ( | ) | [inline, virtual] |
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memory when it is no longer needed. The default behavior of passes is to hold onto memory for the entire duration of their lifetime (which is the entire compile time). For pipelined passes, this is not a big deal because that memory gets recycled every time the pass is invoked on another program unit. For IP passes, it is more important to free memory when it is unused.
Optionally implement this function to release pass memory when it is no longer used.
Reimplemented from llvm::Pass.
Definition at line 251 of file LiveVariables.h.
| LiveVariables::VarInfo & LiveVariables::getVarInfo | ( | unsigned | RegIdx | ) |
getVarInfo - Get (possibly creating) a VarInfo object for the given vreg.
getVarInfo - Return the VarInfo structure for the specified VIRTUAL register.
Definition at line 70 of file LiveVariables.cpp.
References llvm::TargetRegisterInfo::FirstVirtualRegister, and llvm::TargetRegisterInfo::isVirtualRegister().
Referenced by addVirtualRegisterDead(), addVirtualRegisterKilled(), llvm::X86InstrInfo::convertToThreeAddress(), llvm::ARMBaseInstrInfo::convertToThreeAddress(), HandleVirtRegDef(), HandleVirtRegUse(), removeVirtualRegisterDead(), removeVirtualRegisterKilled(), removeVirtualRegistersKilled(), replaceKillInstruction(), and runOnMachineFunction().
| void LiveVariables::MarkVirtRegAliveInBlock | ( | VarInfo & | VRInfo, | |
| MachineBasicBlock * | DefBlock, | |||
| MachineBasicBlock * | BB | |||
| ) |
Definition at line 110 of file LiveVariables.cpp.
References llvm::BasicBlock::back(), Pred, and WorkList.
Referenced by HandleVirtRegUse(), and runOnMachineFunction().
| void LiveVariables::MarkVirtRegAliveInBlock | ( | VarInfo & | VRInfo, | |
| MachineBasicBlock * | DefBlock, | |||
| MachineBasicBlock * | BB, | |||
| std::vector< MachineBasicBlock * > & | WorkList | |||
| ) |
Definition at line 83 of file LiveVariables.cpp.
References llvm::LiveVariables::VarInfo::AliveBlocks, E, llvm::MachineBasicBlock::getNumber(), llvm::LiveVariables::VarInfo::Kills, PI, llvm::MachineBasicBlock::pred_rbegin(), llvm::MachineBasicBlock::pred_rend(), llvm::SparseBitVector< ElementSize >::set(), and llvm::SparseBitVector< ElementSize >::test().
| void LiveVariables::HandleVirtRegDef | ( | unsigned | reg, | |
| MachineInstr * | MI | |||
| ) |
Definition at line 175 of file LiveVariables.cpp.
References llvm::LiveVariables::VarInfo::AliveBlocks, llvm::SparseBitVector< ElementSize >::empty(), getVarInfo(), and llvm::LiveVariables::VarInfo::Kills.
Referenced by runOnMachineFunction().
| void LiveVariables::HandleVirtRegUse | ( | unsigned | reg, | |
| MachineBasicBlock * | MBB, | |||
| MachineInstr * | MI | |||
| ) |
Definition at line 123 of file LiveVariables.cpp.
References llvm::LiveVariables::VarInfo::AliveBlocks, E, llvm::MachineBasicBlock::getNumber(), llvm::MachineInstr::getParent(), getVarInfo(), llvm::MachineRegisterInfo::getVRegDef(), llvm::LiveVariables::VarInfo::Kills, MarkVirtRegAliveInBlock(), llvm::LiveVariables::VarInfo::NumUses, PI, llvm::MachineBasicBlock::pred_begin(), llvm::MachineBasicBlock::pred_end(), and llvm::SparseBitVector< ElementSize >::test().
Referenced by runOnMachineFunction().
char LiveVariables::ID = 0 [static] |
Definition at line 47 of file LiveVariables.h.