class PHITransAddr

Declaration

class PHITransAddr { /* full declaration omitted */ };

Description

PHITransAddr - An address value which tracks and handles phi translation. As we walk "up" the CFG through predecessors, we need to ensure that the address we're tracking is kept up to date. For example, if we're analyzing an address of "&A[i]" and walk through the definition of 'i' which is a PHI node, we *must* phi translate i to get "&A[j]" or else we will analyze an incorrect pointer in the predecessor block. This is designed to be a relatively small object that lives on the stack and is copyable.

Declared at: llvm/include/llvm/Analysis/PHITransAddr.h:35

Method Overview

Methods

bool IsPotentiallyPHITranslatable() const

Description

IsPotentiallyPHITranslatable - If this needs PHI translation, return true if we have some hope of doing it. This should be used as a filter to avoid calling PHITranslateValue in hopeless situations.

Declared at: llvm/include/llvm/Analysis/PHITransAddr.h:75

bool NeedsPHITranslationFromBlock(
    llvm::BasicBlock* BB) const

Description

NeedsPHITranslationFromBlock - Return true if moving from the specified BasicBlock to its predecessors requires PHI translation.

Declared at: llvm/include/llvm/Analysis/PHITransAddr.h:63

Parameters

llvm::BasicBlock* BB

PHITransAddr(llvm::Value* addr,
             const llvm::DataLayout& DL,
             llvm::AssumptionCache* AC)

Declared at: llvm/include/llvm/Analysis/PHITransAddr.h:52

Parameters

llvm::Value* addr
const llvm::DataLayout& DL
llvm::AssumptionCache* AC

bool PHITranslateValue(
    llvm::BasicBlock* CurBB,
    llvm::BasicBlock* PredBB,
    const llvm::DominatorTree* DT,
    bool MustDominate)

Description

PHITranslateValue - PHI translate the current address up the CFG from CurBB to Pred, updating our state to reflect any needed changes. If 'MustDominate' is true, the translated value must dominate PredBB. This returns true on failure and sets Addr to null.

Declared at: llvm/include/llvm/Analysis/PHITransAddr.h:81

Parameters

llvm::BasicBlock* CurBB
llvm::BasicBlock* PredBB
const llvm::DominatorTree* DT
bool MustDominate

llvm::Value* PHITranslateWithInsertion(
    llvm::BasicBlock* CurBB,
    llvm::BasicBlock* PredBB,
    const llvm::DominatorTree& DT,
    SmallVectorImpl<llvm::Instruction*>& NewInsts)

Description

PHITranslateWithInsertion - PHI translate this value into the specified predecessor block, inserting a computation of the value if it is unavailable. All newly created instructions are added to the NewInsts list. This returns null on failure.

Declared at: llvm/include/llvm/Analysis/PHITransAddr.h:91

Parameters

llvm::BasicBlock* CurBB
llvm::BasicBlock* PredBB
const llvm::DominatorTree& DT
SmallVectorImpl<llvm::Instruction*>& NewInsts

bool Verify() const

Description

Verify - Check internal consistency of this data structure. If the structure is valid, it returns true. If invalid, it prints errors and returns false.

Declared at: llvm/include/llvm/Analysis/PHITransAddr.h:100

void dump() const

Declared at: llvm/include/llvm/Analysis/PHITransAddr.h:95

llvm::Value* getAddr() const

Declared at: llvm/include/llvm/Analysis/PHITransAddr.h:59