class LiveVariables

Declaration

class LiveVariables : public MachineFunctionPass { /* full declaration omitted */ };

Description

MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of passes that operate on the MachineFunction representation. Instead of overriding runOnFunction, subclasses override runOnMachineFunction.

Declared at: llvm/include/llvm/CodeGen/LiveVariables.h:46

Inherits from: MachineFunctionPass

Member Variables

public static char ID

Method Overview

Inherited from MachineFunctionPass:

Inherited from FunctionPass:

Inherited from Pass:

Methods

void HandleVirtRegDef(unsigned int reg,
                      llvm::MachineInstr& MI)

Declared at: llvm/include/llvm/CodeGen/LiveVariables.h:280

Parameters

unsigned int reg
llvm::MachineInstr& MI

void HandleVirtRegUse(
    unsigned int reg,
    llvm::MachineBasicBlock* MBB,
    llvm::MachineInstr& MI)

Declared at: llvm/include/llvm/CodeGen/LiveVariables.h:281

Parameters

unsigned int reg
llvm::MachineBasicBlock* MBB
llvm::MachineInstr& MI

LiveVariables()

Declared at: llvm/include/llvm/CodeGen/LiveVariables.h:49

void MarkVirtRegAliveInBlock(
    llvm::LiveVariables::VarInfo& VRInfo,
    llvm::MachineBasicBlock* DefBlock,
    llvm::MachineBasicBlock* BB)

Declared at: llvm/include/llvm/CodeGen/LiveVariables.h:275

Parameters

llvm::LiveVariables::VarInfo& VRInfo
llvm::MachineBasicBlock* DefBlock
llvm::MachineBasicBlock* BB

void MarkVirtRegAliveInBlock(
    llvm::LiveVariables::VarInfo& VRInfo,
    llvm::MachineBasicBlock* DefBlock,
    llvm::MachineBasicBlock* BB,
    std::vector<MachineBasicBlock*>& WorkList)

Declared at: llvm/include/llvm/CodeGen/LiveVariables.h:277

Parameters

llvm::LiveVariables::VarInfo& VRInfo
llvm::MachineBasicBlock* DefBlock
llvm::MachineBasicBlock* BB
std::vector<MachineBasicBlock*>& WorkList

bool RegisterDefIsDead(llvm::MachineInstr& MI,
                       unsigned int Reg) const

Description

RegisterDefIsDead - Return true if the specified instruction defines the specified register, but that definition is dead.

Declared at: llvm/include/llvm/CodeGen/LiveVariables.h:187

Parameters

llvm::MachineInstr& MI
unsigned int Reg

void addNewBlock(llvm::MachineBasicBlock* BB,
                 llvm::MachineBasicBlock* DomBB,
                 llvm::MachineBasicBlock* SuccBB)

Description

addNewBlock - Add a new basic block BB between DomBB and SuccBB. 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.

Declared at: llvm/include/llvm/CodeGen/LiveVariables.h:296

Parameters

llvm::MachineBasicBlock* BB
llvm::MachineBasicBlock* DomBB
llvm::MachineBasicBlock* SuccBB

void addVirtualRegisterDead(
    unsigned int IncomingReg,
    llvm::MachineInstr& MI,
    bool AddIfNotFound = false)

Description

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.

Declared at: llvm/include/llvm/CodeGen/LiveVariables.h:237

Parameters

unsigned int IncomingReg
llvm::MachineInstr& MI
bool AddIfNotFound = false

void addVirtualRegisterKilled(
    unsigned int IncomingReg,
    llvm::MachineInstr& MI,
    bool AddIfNotFound = false)

Description

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.

Declared at: llvm/include/llvm/CodeGen/LiveVariables.h:201

Parameters

unsigned int IncomingReg
llvm::MachineInstr& MI
bool AddIfNotFound = false

void getAnalysisUsage(
    llvm::AnalysisUsage& AU) const

Description

getAnalysisUsage - Subclasses that override getAnalysisUsage must call this. For MachineFunctionPasses, calling AU.preservesCFG() indicates that the pass does not modify the MachineBasicBlock CFG.

Declared at: llvm/include/llvm/CodeGen/LiveVariables.h:265

Parameters

llvm::AnalysisUsage& AU

llvm::LiveVariables::VarInfo& getVarInfo(
    unsigned int RegIdx)

Description

getVarInfo - Return the VarInfo structure for the specified VIRTUAL register.

Declared at: llvm/include/llvm/CodeGen/LiveVariables.h:273

Parameters

unsigned int RegIdx

bool isLiveIn(unsigned int Reg,
              const llvm::MachineBasicBlock& MBB)

Declared at: llvm/include/llvm/CodeGen/LiveVariables.h:283

Parameters

unsigned int Reg
const llvm::MachineBasicBlock& MBB

bool isLiveOut(unsigned int Reg,
               const llvm::MachineBasicBlock& MBB)

Description

isLiveOut - Determine if Reg is live out from MBB, when not considering PHI nodes. This means that Reg is either killed by a successor block or passed through one.

Declared at: llvm/include/llvm/CodeGen/LiveVariables.h:290

Parameters

unsigned int Reg
const llvm::MachineBasicBlock& MBB

bool isPHIJoin(unsigned int Reg)

Description

isPHIJoin - Return true if Reg is a phi join register.

Declared at: llvm/include/llvm/CodeGen/LiveVariables.h:301

Parameters

unsigned int Reg

void releaseMemory()

Description

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.

Declared at: llvm/include/llvm/CodeGen/LiveVariables.h:267

bool removeVirtualRegisterDead(
    unsigned int reg,
    llvm::MachineInstr& MI)

Description

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.

Declared at: llvm/include/llvm/CodeGen/LiveVariables.h:247

Parameters

unsigned int reg
llvm::MachineInstr& MI

bool removeVirtualRegisterKilled(
    unsigned int reg,
    llvm::MachineInstr& MI)

Description

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.

Declared at: llvm/include/llvm/CodeGen/LiveVariables.h:211

Parameters

unsigned int reg
llvm::MachineInstr& MI

void removeVirtualRegistersKilled(
    llvm::MachineInstr& MI)

Description

removeVirtualRegistersKilled - Remove all killed info for the specified instruction.

Declared at: llvm/include/llvm/CodeGen/LiveVariables.h:232

Parameters

llvm::MachineInstr& MI

void replaceKillInstruction(
    unsigned int Reg,
    llvm::MachineInstr& OldMI,
    llvm::MachineInstr& NewMI)

Description

replaceKillInstruction - Update register kill info by replacing a kill instruction with a new one.

Declared at: llvm/include/llvm/CodeGen/LiveVariables.h:194

Parameters

unsigned int Reg
llvm::MachineInstr& OldMI
llvm::MachineInstr& NewMI

bool runOnMachineFunction(
    llvm::MachineFunction& MF)

Description

runOnMachineFunction - This method must be overloaded to perform the desired machine code transformation or analysis.

Declared at: llvm/include/llvm/CodeGen/LiveVariables.h:183

Parameters

llvm::MachineFunction& MF

void setPHIJoin(unsigned int Reg)

Description

setPHIJoin - Mark Reg as a phi join register.

Declared at: llvm/include/llvm/CodeGen/LiveVariables.h:304

Parameters

unsigned int Reg