LLVM API Documentation

llvm::LiveVariables::VarInfo Struct Reference

#include <LiveVariables.h>

Collaboration diagram for llvm::LiveVariables::VarInfo:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 VarInfo ()
bool removeKill (MachineInstr *MI)
void dump () const

Public Attributes

BitVector AliveBlocks
BitVector UsedBlocks
unsigned NumUses
std::vector< MachineInstr * > Kills


Detailed Description

VarInfo - This represents the regions where a virtual register is live in the program. We represent this with three different pieces of information: the instruction that uniquely defines the value, the set of blocks the instruction is live into and live out of, and the set of non-phi instructions that are the last users of the value.

In the common case where a value is defined and killed in the same block, 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, 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 74 of file LiveVariables.h.


Constructor & Destructor Documentation

llvm::LiveVariables::VarInfo::VarInfo (  )  [inline]

Definition at line 94 of file LiveVariables.h.


Member Function Documentation

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 99 of file LiveVariables.h.

References I, and Kills.

Referenced by llvm::ARMInstrInfo::convertToThreeAddress(), and llvm::LiveVariables::removeVirtualRegistersKilled().

void LiveVariables::VarInfo::dump (  )  const

Definition at line 53 of file LiveVariables.cpp.

References AliveBlocks, llvm::cerr(), Kills, llvm::BitVector::size(), and UsedBlocks.


Member Data Documentation

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 79 of file LiveVariables.h.

Referenced by dump(), llvm::LiveVariables::getVarInfo(), llvm::LiveVariables::HandleVirtRegDef(), llvm::LiveVariables::HandleVirtRegUse(), and llvm::LiveVariables::MarkVirtRegAliveInBlock().

UsedBlocks - Set of blocks of which this value is actually used. This is a bit set which uses the basic block number as an index.

Definition at line 83 of file LiveVariables.h.

Referenced by dump(), llvm::LiveVariables::getVarInfo(), and llvm::LiveVariables::HandleVirtRegUse().

NumUses - Number of uses of this register across the entire function.

Definition at line 87 of file LiveVariables.h.

Referenced by llvm::LiveVariables::HandleVirtRegUse().


The documentation for this struct was generated from the following files:



This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.