LLVM API Documentation
#include <LiveVariables.h>
Definition at line 42 of file LiveVariables.h.
| llvm::LiveVariables::LiveVariables | ( | ) | [inline] |
Definition at line 45 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 504 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 666 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 188 of file LiveVariables.h.
References llvm::MachineInstr::addRegisterKilled(), getVarInfo(), and llvm::LiveVariables::VarInfo::Kills.
Referenced by llvm::ARMInstrInfo::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 198 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 674 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 223 of file LiveVariables.h.
References llvm::MachineInstr::addRegisterDead(), getVarInfo(), and llvm::LiveVariables::VarInfo::Kills.
Referenced by llvm::ARMInstrInfo::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 233 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 & | ) | const [virtual] |
getAnalysisUsage - This function should be overriden by passes that need analysis information to do their job. If a pass specifies that it uses a particular analysis result to this function, it can then use the getAnalysis<AnalysisType>() function, below.
Reimplemented from llvm::Pass.
Definition at line 48 of file LiveVariables.cpp.
References llvm::AnalysisUsage::addRequiredID(), 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 252 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 71 of file LiveVariables.cpp.
References llvm::LiveVariables::VarInfo::AliveBlocks, llvm::TargetRegisterInfo::FirstVirtualRegister, llvm::MachineFunction::getNumBlockIDs(), llvm::TargetRegisterInfo::isVirtualRegister(), llvm::BitVector::resize(), and llvm::LiveVariables::VarInfo::UsedBlocks.
Referenced by addVirtualRegisterDead(), addVirtualRegisterKilled(), llvm::X86InstrInfo::convertToThreeAddress(), llvm::ARMInstrInfo::convertToThreeAddress(), HandleVirtRegDef(), HandleVirtRegUse(), removeVirtualRegisterDead(), removeVirtualRegisterKilled(), removeVirtualRegistersKilled(), replaceKillInstruction(), and runOnMachineFunction().
| void LiveVariables::MarkVirtRegAliveInBlock | ( | VarInfo & | VRInfo, | |
| MachineBasicBlock * | DefBlock, | |||
| MachineBasicBlock * | BB | |||
| ) |
Definition at line 114 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 87 of file LiveVariables.cpp.
References llvm::LiveVariables::VarInfo::AliveBlocks, E, llvm::MachineBasicBlock::getNumber(), llvm::LiveVariables::VarInfo::Kills, PI, llvm::MachineBasicBlock::pred_rbegin(), and llvm::MachineBasicBlock::pred_rend().
| void LiveVariables::HandleVirtRegDef | ( | unsigned | reg, | |
| MachineInstr * | MI | |||
| ) |
Definition at line 180 of file LiveVariables.cpp.
References llvm::LiveVariables::VarInfo::AliveBlocks, getVarInfo(), llvm::LiveVariables::VarInfo::Kills, and llvm::BitVector::none().
Referenced by runOnMachineFunction().
| void LiveVariables::HandleVirtRegUse | ( | unsigned | reg, | |
| MachineBasicBlock * | MBB, | |||
| MachineInstr * | MI | |||
| ) |
Definition at line 127 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::LiveVariables::VarInfo::UsedBlocks.
Referenced by runOnMachineFunction().
char LiveVariables::ID = 0 [static] |
Definition at line 44 of file LiveVariables.h.