class SSAUpdaterImpl

Declaration

template <typename UpdaterT>
class SSAUpdaterImpl { /* full declaration omitted */ };

Declared at: llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h:30

Templates

UpdaterT

Member Variables

private UpdaterT* Updater
private llvm::SSAUpdaterImpl::AvailableValsTy* AvailableVals
private SmallVectorImpl<llvm::SSAUpdaterImpl::PhiT*>* InsertedPHIs
private llvm::SSAUpdaterImpl::BBMapTy BBMap
private llvm::BumpPtrAllocator Allocator

Method Overview

  • public llvm::SSAUpdaterImpl::BBInfo * BuildBlockList(llvm::SSAUpdaterImpl::BlkT * BB, llvm::SSAUpdaterImpl::BlockListTy * BlockList)
  • public bool CheckIfPHIMatches(llvm::SSAUpdaterImpl::PhiT * PHI)
  • public void FindAvailableVals(llvm::SSAUpdaterImpl::BlockListTy * BlockList)
  • public void FindDominators(llvm::SSAUpdaterImpl::BlockListTy * BlockList, llvm::SSAUpdaterImpl::BBInfo * PseudoEntry)
  • public void FindExistingPHI(llvm::SSAUpdaterImpl::BlkT * BB, llvm::SSAUpdaterImpl::BlockListTy * BlockList)
  • public void FindPHIPlacement(llvm::SSAUpdaterImpl::BlockListTy * BlockList)
  • public bool FindSingularVal(llvm::SSAUpdaterImpl::BBInfo * Info)
  • public llvm::SSAUpdaterImpl::ValT GetValue(llvm::SSAUpdaterImpl::BlkT * BB)
  • public llvm::SSAUpdaterImpl::BBInfo * IntersectDominators(llvm::SSAUpdaterImpl::BBInfo * Blk1, llvm::SSAUpdaterImpl::BBInfo * Blk2)
  • public bool IsDefInDomFrontier(const llvm::SSAUpdaterImpl::BBInfo * Pred, const llvm::SSAUpdaterImpl::BBInfo * IDom)
  • public void RecordMatchingPHIs(llvm::SSAUpdaterImpl::BlockListTy * BlockList)
  • public SSAUpdaterImpl<UpdaterT>(UpdaterT * U, llvm::SSAUpdaterImpl::AvailableValsTy * A, SmallVectorImpl<llvm::SSAUpdaterImpl::PhiT *> * Ins)

Methods

llvm::SSAUpdaterImpl::BBInfo* BuildBlockList(
    llvm::SSAUpdaterImpl::BlkT* BB,
    llvm::SSAUpdaterImpl::BlockListTy* BlockList)

Description

BuildBlockList - Starting from the specified basic block, traverse back through its predecessors until reaching blocks with known values. Create BBInfo structures for the blocks and append them to the block list.

Declared at: llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h:115

Parameters

llvm::SSAUpdaterImpl::BlkT* BB
llvm::SSAUpdaterImpl::BlockListTy* BlockList

bool CheckIfPHIMatches(
    llvm::SSAUpdaterImpl::PhiT* PHI)

Description

CheckIfPHIMatches - Check if a PHI node matches the placement and values in the BBMap.

Declared at: llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h:430

Parameters

llvm::SSAUpdaterImpl::PhiT* PHI

void FindAvailableVals(
    llvm::SSAUpdaterImpl::BlockListTy* BlockList)

Description

FindAvailableVal - If this block requires a PHI, first check if an existing PHI matches the PHI placement and reaching definitions computed earlier, and if not, create a new PHI. Visit all the block's predecessors to calculate the available value for each one and fill in the incoming values for a new PHI.

Declared at: llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h:353

Parameters

llvm::SSAUpdaterImpl::BlockListTy* BlockList

void FindDominators(
    llvm::SSAUpdaterImpl::BlockListTy* BlockList,
    llvm::SSAUpdaterImpl::BBInfo* PseudoEntry)

Description

FindDominators - Calculate the dominator tree for the subset of the CFG corresponding to the basic blocks on the BlockList. This uses the algorithm from: "A Simple, Fast Dominance Algorithm" by Cooper, Harvey and Kennedy, published in Software--Practice and Experience, 2001, 4:1-10. Because the CFG subset does not include any edges leading into blocks that define the value, the results are not the usual dominator tree. The CFG subset has a single pseudo-entry node with edges to a set of root nodes for blocks that define the value. The dominators for this subset CFG are not the standard dominators but they are adequate for placing PHIs within the subset CFG.

Declared at: llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h:240

Parameters

llvm::SSAUpdaterImpl::BlockListTy* BlockList
llvm::SSAUpdaterImpl::BBInfo* PseudoEntry

void FindExistingPHI(
    llvm::SSAUpdaterImpl::BlkT* BB,
    llvm::SSAUpdaterImpl::BlockListTy* BlockList)

Description

FindExistingPHI - Look through the PHI nodes in a block to see if any of them match what is needed.

Declared at: llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h:415

Parameters

llvm::SSAUpdaterImpl::BlkT* BB
llvm::SSAUpdaterImpl::BlockListTy* BlockList

void FindPHIPlacement(
    llvm::SSAUpdaterImpl::BlockListTy* BlockList)

Description

FindPHIPlacement - PHIs are needed in the iterated dominance frontiers of the known definitions. Iteratively add PHIs in the dom frontiers until nothing changes. Along the way, keep track of the nearest dominating definitions for non-PHI blocks.

Declared at: llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h:294

Parameters

llvm::SSAUpdaterImpl::BlockListTy* BlockList

bool FindSingularVal(
    llvm::SSAUpdaterImpl::BBInfo* Info)

Description

Check all predecessors and if all of them have the same AvailableVal use it as value for block represented by Info. Return true if singluar value is found.

Declared at: llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h:329

Parameters

llvm::SSAUpdaterImpl::BBInfo* Info

llvm::SSAUpdaterImpl::ValT GetValue(
    llvm::SSAUpdaterImpl::BlkT* BB)

Description

GetValue - Check to see if AvailableVals has an entry for the specified BB and if so, return it. If not, construct SSA form by first calculating the required placement of PHIs and then inserting new PHIs where needed.

Declared at: llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h:93

Parameters

llvm::SSAUpdaterImpl::BlkT* BB

llvm::SSAUpdaterImpl::BBInfo* IntersectDominators(
    llvm::SSAUpdaterImpl::BBInfo* Blk1,
    llvm::SSAUpdaterImpl::BBInfo* Blk2)

Description

IntersectDominators - This is the dataflow lattice "meet" operation for finding dominators. Given two basic blocks, it walks up the dominator tree until it finds a common dominator of both. It uses the postorder number of the blocks to determine how to do that.

Declared at: llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h:214

Parameters

llvm::SSAUpdaterImpl::BBInfo* Blk1
llvm::SSAUpdaterImpl::BBInfo* Blk2

bool IsDefInDomFrontier(
    const llvm::SSAUpdaterImpl::BBInfo* Pred,
    const llvm::SSAUpdaterImpl::BBInfo* IDom)

Description

IsDefInDomFrontier - Search up the dominator tree from Pred to IDom for any blocks containing definitions of the value. If one is found, then the successor of Pred is in the dominance frontier for the definition, and this function returns true.

Declared at: llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h:282

Parameters

const llvm::SSAUpdaterImpl::BBInfo* Pred
const llvm::SSAUpdaterImpl::BBInfo* IDom

void RecordMatchingPHIs(
    llvm::SSAUpdaterImpl::BlockListTy* BlockList)

Description

RecordMatchingPHIs - For each PHI node that matches, record it in both the BBMap and the AvailableVals mapping.

Declared at: llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h:477

Parameters

llvm::SSAUpdaterImpl::BlockListTy* BlockList

SSAUpdaterImpl<UpdaterT>(
    UpdaterT* U,
    llvm::SSAUpdaterImpl::AvailableValsTy* A,
    SmallVectorImpl<llvm::SSAUpdaterImpl::PhiT*>*
        Ins)

Declared at: llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h:85

Parameters

UpdaterT* U
llvm::SSAUpdaterImpl::AvailableValsTy* A
SmallVectorImpl<llvm::SSAUpdaterImpl::PhiT*>* Ins