LLVM 22.0.0git
llvm::SSAUpdaterBulk Class Reference

Helper class for SSA formation on a set of values defined in multiple blocks. More...

#include "llvm/Transforms/Utils/SSAUpdaterBulk.h"

Public Member Functions

 SSAUpdaterBulk ()=default
 SSAUpdaterBulk (const SSAUpdaterBulk &)=delete
SSAUpdaterBulkoperator= (const SSAUpdaterBulk &)=delete
 ~SSAUpdaterBulk ()=default
LLVM_ABI unsigned AddVariable (StringRef Name, Type *Ty)
 Add a new variable to the SSA rewriter.
LLVM_ABI void AddAvailableValue (unsigned Var, BasicBlock *BB, Value *V)
 Indicate that a rewritten value is available in the specified block with the specified value.
LLVM_ABI void AddUse (unsigned Var, Use *U)
 Record a use of the symbolic value.
LLVM_ABI void RewriteAllUses (DominatorTree *DT, SmallVectorImpl< PHINode * > *InsertedPHIs=nullptr)
 Perform all the necessary updates, including new PHI-nodes insertion and the requested uses update.

Detailed 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. The update is done only when RewriteAllUses is called, all other methods are used for book-keeping. That helps to share some common computations between updates of different uses (which is not the case when traditional SSAUpdater is used).

Definition at line 40 of file SSAUpdaterBulk.h.

Constructor & Destructor Documentation

◆ SSAUpdaterBulk() [1/2]

llvm::SSAUpdaterBulk::SSAUpdaterBulk ( )
explicitdefault

Referenced by operator=(), and SSAUpdaterBulk().

◆ SSAUpdaterBulk() [2/2]

llvm::SSAUpdaterBulk::SSAUpdaterBulk ( const SSAUpdaterBulk & )
delete

References SSAUpdaterBulk().

◆ ~SSAUpdaterBulk()

llvm::SSAUpdaterBulk::~SSAUpdaterBulk ( )
default

References LLVM_ABI.

Member Function Documentation

◆ AddAvailableValue()

void SSAUpdaterBulk::AddAvailableValue ( unsigned Var,
BasicBlock * BB,
Value * V )

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

Definition at line 51 of file SSAUpdaterBulk.cpp.

References assert(), llvm::dbgs(), llvm::Value::getName(), and LLVM_DEBUG.

◆ AddUse()

void SSAUpdaterBulk::AddUse ( unsigned Var,
Use * U )

Record a use of the symbolic value.

This use will be updated with a rewritten value when RewriteAllUses is called.

Definition at line 61 of file SSAUpdaterBulk.cpp.

References assert(), llvm::dbgs(), getName(), getUserBB(), and LLVM_DEBUG.

◆ AddVariable()

unsigned SSAUpdaterBulk::AddVariable ( StringRef Name,
Type * Ty )

Add a new variable to the SSA rewriter.

This needs to be called before AddAvailableValue or AddUse calls. The return value is the variable ID, which needs to be passed to AddAvailableValue and AddUse.

This needs to be called before AddAvailableValue or AddUse calls.

Definition at line 40 of file SSAUpdaterBulk.cpp.

References llvm::dbgs(), and LLVM_DEBUG.

◆ operator=()

SSAUpdaterBulk & llvm::SSAUpdaterBulk::operator= ( const SSAUpdaterBulk & )
delete

References SSAUpdaterBulk().

◆ RewriteAllUses()


The documentation for this class was generated from the following files: