class ReachingDefAnalysis

Declaration

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

Description

This class provides the reaching def analysis.

Declared at: llvm/include/llvm/CodeGen/ReachingDefAnalysis.h:36

Inherits from: MachineFunctionPass

Member Variables

public static char ID

Method Overview

Inherited from MachineFunctionPass:

Inherited from FunctionPass:

Inherited from Pass:

Methods

ReachingDefAnalysis()

Declared at: llvm/include/llvm/CodeGen/ReachingDefAnalysis.h:76

void getAllInstWithUseBefore(
    llvm::MachineInstr* MI,
    int PhysReg,
    SmallVectorImpl<llvm::MachineInstr*>& Uses)

Description

Provides all instructions before MI that uses PhysReg

Declared at: llvm/include/llvm/CodeGen/ReachingDefAnalysis.h:126

Parameters

llvm::MachineInstr* MI
int PhysReg
SmallVectorImpl<llvm::MachineInstr*>& Uses

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/ReachingDefAnalysis.h:81

Parameters

llvm::AnalysisUsage& AU

int getClearance(llvm::MachineInstr* MI,
                 llvm::MCPhysReg PhysReg)

Description

Provides the clearance - the number of instructions since the closest reaching def instuction of PhysReg that reaches MI.

Declared at: llvm/include/llvm/CodeGen/ReachingDefAnalysis.h:131

Parameters

llvm::MachineInstr* MI
llvm::MCPhysReg PhysReg

llvm::MachineInstr* getInstFromId(
    llvm::MachineBasicBlock* MBB,
    int InstId)

Description

Provides the MI, from the given block, corresponding to the Id or a nullptr if the id does not refer to the block.

Declared at: llvm/include/llvm/CodeGen/ReachingDefAnalysis.h:104

Parameters

llvm::MachineBasicBlock* MBB
int InstId

llvm::MachineInstr* getInstWithUseBefore(
    llvm::MachineInstr* MI,
    int PhysReg)

Description

Provides the first instruction before MI that uses PhysReg

Declared at: llvm/include/llvm/CodeGen/ReachingDefAnalysis.h:123

Parameters

llvm::MachineInstr* MI
int PhysReg

llvm::MachineInstr* getLocalLiveOutMIDef(
    llvm::MachineBasicBlock* MBB,
    int PhysReg)

Description

Return the local MI that produces the live out value for PhysReg, or nullptr for a non-live out or non-local def.

Declared at: llvm/include/llvm/CodeGen/ReachingDefAnalysis.h:115

Parameters

llvm::MachineBasicBlock* MBB
int PhysReg

unsigned int getNumUses(llvm::MachineInstr* MI,
                        int PhysReg)

Description

Provide the number of uses, in the same block as MI, of the register that MI defines.

Declared at: llvm/include/llvm/CodeGen/ReachingDefAnalysis.h:140

Parameters

llvm::MachineInstr* MI
int PhysReg

int getReachingDef(llvm::MachineInstr* MI,
                   int PhysReg)

Description

Provides the instruction id of the closest reaching def instruction of PhysReg that reaches MI, relative to the begining of MI's basic block.

Declared at: llvm/include/llvm/CodeGen/ReachingDefAnalysis.h:96

Parameters

llvm::MachineInstr* MI
int PhysReg

void getReachingLocalUses(
    llvm::MachineInstr* MI,
    int PhysReg,
    SmallVectorImpl<llvm::MachineInstr*>& Uses)

Description

Provides the uses, in the same block as MI, of register that MI defines. This does not consider live-outs.

Declared at: llvm/include/llvm/CodeGen/ReachingDefAnalysis.h:135

Parameters

llvm::MachineInstr* MI
int PhysReg
SmallVectorImpl<llvm::MachineInstr*>& Uses

llvm::MachineInstr* getReachingMIDef(
    llvm::MachineInstr* MI,
    int PhysReg)

Description

Provides the instruction of the closest reaching def instruction of PhysReg that reaches MI, relative to the begining of MI's basic block.

Declared at: llvm/include/llvm/CodeGen/ReachingDefAnalysis.h:100

Parameters

llvm::MachineInstr* MI
int PhysReg

llvm::MachineFunctionProperties
getRequiredProperties() const

Declared at: llvm/include/llvm/CodeGen/ReachingDefAnalysis.h:88

bool hasSameReachingDef(llvm::MachineInstr* A,
                        llvm::MachineInstr* B,
                        int PhysReg)

Description

Return whether A and B use the same def of PhysReg.

Declared at: llvm/include/llvm/CodeGen/ReachingDefAnalysis.h:107

Parameters

llvm::MachineInstr* A
llvm::MachineInstr* B
int PhysReg

bool isReachingDefLiveOut(llvm::MachineInstr* MI,
                          int PhysReg)

Description

Return whether the reaching def for MI also is live out of its parent block.

Declared at: llvm/include/llvm/CodeGen/ReachingDefAnalysis.h:111

Parameters

llvm::MachineInstr* MI
int PhysReg

bool isRegUsedAfter(llvm::MachineInstr* MI,
                    int PhysReg)

Description

Return whether the given register is used after MI, whether it's a local use or a live out.

Declared at: llvm/include/llvm/CodeGen/ReachingDefAnalysis.h:120

Parameters

llvm::MachineInstr* MI
int PhysReg

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/ReachingDefAnalysis.h:79

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/ReachingDefAnalysis.h:86

Parameters

llvm::MachineFunction& MF