LLVM: llvm::LiveVariables Class Reference (original) (raw)
#include "[llvm/CodeGen/LiveVariables.h](LiveVariables%5F8h%5Fsource.html)"
| Classes | |
|---|---|
| struct | VarInfo |
| VarInfo - This represents the regions where a virtual register is live in the program. More... |
| Public Member Functions | |
|---|---|
| LLVM_ABI | LiveVariables (MachineFunction &MF) |
| LLVM_ABI void | print (raw_ostream &OS) const |
| LLVM_ABI void | recomputeForSingleDefVirtReg (Register Reg) |
| Recompute liveness from scratch for a virtual register Reg that is known to have a single def that dominates all uses. | |
| LLVM_ABI void | replaceKillInstruction (Register Reg, MachineInstr &OldMI, MachineInstr &NewMI) |
| replaceKillInstruction - Update register kill info by replacing a kill instruction with a new one. | |
| void | addVirtualRegisterKilled (Register IncomingReg, MachineInstr &MI, bool AddIfNotFound=false) |
| addVirtualRegisterKilled - Add information about the fact that the specified register is killed after being used by the specified instruction. | |
| bool | removeVirtualRegisterKilled (Register Reg, MachineInstr &MI) |
| removeVirtualRegisterKilled - Remove the specified kill of the virtual register from the live variable information. | |
| LLVM_ABI void | removeVirtualRegistersKilled (MachineInstr &MI) |
| removeVirtualRegistersKilled - Remove all killed info for the specified instruction. | |
| void | addVirtualRegisterDead (Register IncomingReg, MachineInstr &MI, bool AddIfNotFound=false) |
| addVirtualRegisterDead - Add information about the fact that the specified register is dead after being used by the specified instruction. | |
| bool | removeVirtualRegisterDead (Register Reg, MachineInstr &MI) |
| removeVirtualRegisterDead - Remove the specified kill of the virtual register from the live variable information. | |
| LLVM_ABI VarInfo & | getVarInfo (Register Reg) |
| getVarInfo - Return the VarInfo structure for the specified VIRTUAL register. | |
| LLVM_ABI void | MarkVirtRegAliveInBlock (VarInfo &VRInfo, MachineBasicBlock *DefBlock, MachineBasicBlock *BB) |
| LLVM_ABI void | MarkVirtRegAliveInBlock (VarInfo &VRInfo, MachineBasicBlock *DefBlock, MachineBasicBlock *BB, SmallVectorImpl< MachineBasicBlock * > &WorkList) |
| LLVM_ABI void | HandleVirtRegDef (Register reg, MachineInstr &MI) |
| LLVM_ABI void | HandleVirtRegUse (Register reg, MachineBasicBlock *MBB, MachineInstr &MI) |
| bool | isLiveIn (Register Reg, const MachineBasicBlock &MBB) |
| LLVM_ABI bool | isLiveOut (Register Reg, const MachineBasicBlock &MBB) |
| isLiveOut - Determine if Reg is live out from MBB, when not considering PHI nodes. | |
| LLVM_ABI void | addNewBlock (MachineBasicBlock *BB, MachineBasicBlock *DomBB, MachineBasicBlock *SuccBB) |
| addNewBlock - Add a new basic block BB between DomBB and SuccBB. | |
| LLVM_ABI void | addNewBlock (MachineBasicBlock *BB, MachineBasicBlock *DomBB, MachineBasicBlock *SuccBB, std::vector< SparseBitVector<> > &LiveInSets) |
| addNewBlock - Add a new basic block BB as an empty succcessor to DomBB. |
| Friends | |
|---|---|
| class | LiveVariablesWrapperPass |
Definition at line 49 of file LiveVariables.h.
◆ addNewBlock() [1/2]
addNewBlock - Add a new basic block BB between DomBB and SuccBB.
addNewBlock - Add a new basic block BB as an empty succcessor to DomBB.
All variables that are live out of DomBB and live into SuccBB will be marked as passing live through BB. This method assumes that the machine code is still in SSA form.
All variables that are live out of DomBB will be marked as passing live through BB.
Definition at line 814 of file LiveVariables.cpp.
References llvm::LiveVariables::VarInfo::AliveBlocks, llvm::MachineBasicBlock::begin(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::count(), llvm::MachineBasicBlock::end(), llvm::MachineBasicBlock::getNumber(), getVarInfo(), llvm::Register::index2VirtReg(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::insert(), and llvm::SparseBitVector< ElementSize >::set().
◆ addNewBlock() [2/2]
◆ addVirtualRegisterDead()
| void llvm::LiveVariables::addVirtualRegisterDead ( Register IncomingReg, MachineInstr & MI, bool AddIfNotFound = false ) | inline |
|---|
◆ addVirtualRegisterKilled()
| void llvm::LiveVariables::addVirtualRegisterKilled ( Register IncomingReg, MachineInstr & MI, bool AddIfNotFound = false ) | inline |
|---|
◆ getVarInfo()
getVarInfo - Return the VarInfo structure for the specified VIRTUAL register.
getVarInfo - Get (possibly creating) a VarInfo object for the given vreg.
Definition at line 113 of file LiveVariables.cpp.
References assert().
Referenced by addNewBlock(), addNewBlock(), addVirtualRegisterDead(), addVirtualRegisterKilled(), llvm::SIInstrInfo::convertToThreeAddress(), llvm::X86InstrInfo::convertToThreeAddress(), HandleVirtRegDef(), HandleVirtRegUse(), isLiveIn(), isLiveOut(), recomputeForSingleDefVirtReg(), removeVirtualRegisterDead(), removeVirtualRegisterKilled(), removeVirtualRegistersKilled(), and replaceKillInstruction().
◆ HandleVirtRegDef()
◆ HandleVirtRegUse()
◆ isLiveIn()
◆ isLiveOut()
◆ MarkVirtRegAliveInBlock() [1/2]
◆ MarkVirtRegAliveInBlock() [2/2]
◆ print()
◆ recomputeForSingleDefVirtReg()
| void LiveVariables::recomputeForSingleDefVirtReg | ( | Register | Reg | ) |
|---|
Recompute liveness from scratch for a virtual register Reg that is known to have a single def that dominates all uses.
This can be useful after removing some uses of Reg. It is not necessary for the whole machine function to be in SSA form.
Definition at line 648 of file LiveVariables.cpp.
References llvm::SmallVectorImpl< T >::append(), assert(), DefMI, llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::MachineBasicBlock::getNumber(), getVarInfo(), MI, llvm::SmallVectorImpl< T >::pop_back_val(), llvm::MachineBasicBlock::pred_begin(), llvm::MachineBasicBlock::pred_end(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::reverse(), llvm::SparseBitVector< ElementSize >::set(), and UseMI.
Referenced by llvm::PPCInstrInfo::promoteInstr32To64ForElimEXTSW().
◆ removeVirtualRegisterDead()
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 250 of file LiveVariables.h.
References assert(), getVarInfo(), MI, and Reg.
◆ removeVirtualRegisterKilled()
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 215 of file LiveVariables.h.
References assert(), getVarInfo(), MI, and Reg.
◆ removeVirtualRegistersKilled()
| void LiveVariables::removeVirtualRegistersKilled | ( | MachineInstr & | MI | ) |
|---|
◆ replaceKillInstruction()
◆ LiveVariablesWrapperPass
The documentation for this class was generated from the following files:
- include/llvm/CodeGen/LiveVariables.h
- lib/CodeGen/LiveVariables.cpp