LLVM API Documentation
#include <LiveVariables.h>
Collaboration diagram for llvm::LiveVariables::VarInfo:
Public Member Functions | |
VarInfo () | |
bool | removeKill (MachineInstr *MI) |
void | dump () const |
Public Attributes | |
MachineInstr * | DefInst |
std::vector< bool > | AliveBlocks |
std::vector< MachineInstr * > | Kills |
In the common case where a value is defined and killed in the same block, DefInst is the defining inst, there is one killing instruction, and AliveBlocks is empty.
Otherwise, the value is live out of the block. If the value is live across any blocks, these blocks are listed in AliveBlocks. Blocks where the liveness range ends are not included in AliveBlocks, instead being captured by the Kills set. In these blocks, the value is live into the block (unless the value is defined and killed in the same block) and lives until the specified instruction. Note that there cannot ever be a value whose Kills set contains two instructions from the same basic block.
PHI nodes complicate things a bit. If a PHI node is the last user of a value in one of its predecessor blocks, it is not listed in the kills set, but does include the predecessor block in the AliveBlocks set (unless that block also defines the value). This leads to the (perfectly sensical) situation where a value is defined in a block, and the last use is a phi node in the successor. In this case, DefInst will be the defining instruction, AliveBlocks is empty (the value is not live across any blocks) and Kills is empty (phi nodes are not included). This is sensical because the value must be live to the end of the block, but is not live in any successor blocks.
Definition at line 69 of file LiveVariables.h.
llvm::LiveVariables::VarInfo::VarInfo | ( | ) | [inline] |
Definition at line 85 of file LiveVariables.h.
void LiveVariables::VarInfo::dump | ( | ) | const |
bool llvm::LiveVariables::VarInfo::removeKill | ( | MachineInstr * | MI | ) | [inline] |
removeKill - Delete a kill corresponding to the specified machine instruction. Returns true if there was a kill corresponding to this instruction, false otherwise.
Definition at line 90 of file LiveVariables.h.
Referenced by llvm::LiveVariables::instructionChanged(), llvm::LiveVariables::removeVirtualRegistersDead(), and llvm::LiveVariables::removeVirtualRegistersKilled().
std::vector<bool> llvm::LiveVariables::VarInfo::AliveBlocks |
AliveBlocks - Set of blocks of which this value is alive completely through. This is a bit set which uses the basic block number as an index.
Definition at line 78 of file LiveVariables.h.
Referenced by dump(), and llvm::LiveVariables::MarkVirtRegAliveInBlock().
DefInst - The machine instruction that defines this register.
Definition at line 72 of file LiveVariables.h.
Referenced by dump(), llvm::LiveVariables::HandleVirtRegUse(), llvm::LiveVariables::instructionChanged(), llvm::LiveVariables::MarkVirtRegAliveInBlock(), and llvm::LiveVariables::runOnMachineFunction().
std::vector<MachineInstr*> llvm::LiveVariables::VarInfo::Kills |
Kills - List of MachineInstruction's which are the last use of this virtual register (kill it) in their basic block.
Definition at line 83 of file LiveVariables.h.
Referenced by llvm::LiveVariables::addVirtualRegisterDead(), llvm::LiveVariables::addVirtualRegisterKilled(), dump(), llvm::LiveVariables::HandleVirtRegUse(), llvm::LiveVariables::instructionChanged(), llvm::LiveVariables::MarkVirtRegAliveInBlock(), removeKill(), and llvm::LiveVariables::runOnMachineFunction().