class SSAUpdater

Declaration

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

Description

Helper class for SSA formation on a set of values defined in multiple blocks. This is used when code duplication or another unstructured transformation wants to rewrite a set of uses of one value with uses of a set of values.

Declared at: llvm/include/llvm/Transforms/Utils/SSAUpdater.h:38

Method Overview

Methods

void AddAvailableValue(llvm::BasicBlock* BB,
                       llvm::Value* V)

Description

Indicate that a rewritten value is available in the specified block with the specified value.

Declared at: llvm/include/llvm/Transforms/Utils/SSAUpdater.h:72

Parameters

llvm::BasicBlock* BB
llvm::Value* V

llvm::Value* FindValueForBlock(
    llvm::BasicBlock* BB) const

Description

Return the value for the specified block if the SSAUpdater has one, otherwise return nullptr.

Declared at: llvm/include/llvm/Transforms/Utils/SSAUpdater.h:80

Parameters

llvm::BasicBlock* BB

llvm::Value* GetValueAtEndOfBlock(
    llvm::BasicBlock* BB)

Description

Construct SSA form, materializing a value that is live at the end of the specified block.

Declared at: llvm/include/llvm/Transforms/Utils/SSAUpdater.h:84

Parameters

llvm::BasicBlock* BB

llvm::Value* GetValueInMiddleOfBlock(
    llvm::BasicBlock* BB)

Description

Construct SSA form, materializing a value that is live in the middle of the specified block. \c GetValueInMiddleOfBlock is the same as \c GetValueAtEndOfBlock except in one important case: if there is a definition of the rewritten value after the 'use' in BB. Consider code like this: In this case, there are two values (X1 and X2) added to the AvailableVals set by the client of the rewriter, and those values are both live out of their respective blocks. However, the use of X happens in the *middle* of a block. Because of this, we need to insert a new PHI node in SomeBB to merge the appropriate values, and this value isn't live out of the block.

Declared at: llvm/include/llvm/Transforms/Utils/SSAUpdater.h:106

Parameters

llvm::BasicBlock* BB

bool HasValueForBlock(llvm::BasicBlock* BB) const

Description

Return true if the SSAUpdater already has a value for the specified block.

Declared at: llvm/include/llvm/Transforms/Utils/SSAUpdater.h:76

Parameters

llvm::BasicBlock* BB

void Initialize(llvm::Type* Ty,
                llvm::StringRef Name)

Description

Reset this object to get ready for a new set of SSA updates with type 'Ty'. PHI nodes get a name based on 'Name'.

Declared at: llvm/include/llvm/Transforms/Utils/SSAUpdater.h:68

Parameters

llvm::Type* Ty
llvm::StringRef Name

void RewriteUse(llvm::Use& U)

Description

Rewrite a use of the symbolic value. This handles PHI nodes, which use their value in the corresponding predecessor. Note that this will not work if the use is supposed to be rewritten to a value defined in the same block as the use, but above it. Any 'AddAvailableValue's added for the use's block will be considered to be below it.

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

Parameters

llvm::Use& U

void RewriteUseAfterInsertions(llvm::Use& U)

Description

Rewrite a use like \c RewriteUse but handling in-block definitions. This version of the method can rewrite uses in the same block as a definition, because it assumes that all uses of a value are below any inserted values.

Declared at: llvm/include/llvm/Transforms/Utils/SSAUpdater.h:122

Parameters

llvm::Use& U

SSAUpdater(SmallVectorImpl<llvm::PHINode*>*
               InsertedPHIs = nullptr)

Description

If InsertedPHIs is specified, it will be filled in with all PHI Nodes created by rewriting.

Declared at: llvm/include/llvm/Transforms/Utils/SSAUpdater.h:59

Parameters

SmallVectorImpl<llvm::PHINode*>* InsertedPHIs = nullptr

SSAUpdater(const llvm::SSAUpdater&)

Declared at: llvm/include/llvm/Transforms/Utils/SSAUpdater.h:60

Parameters

const llvm::SSAUpdater&

~SSAUpdater()

Declared at: llvm/include/llvm/Transforms/Utils/SSAUpdater.h:62