LLVM 20.0.0git
Classes | Public Member Functions | List of all members
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
 
unsigned AddVariable (StringRef Name, Type *Ty)
 Add a new variable to the SSA rewriter.
 
void AddAvailableValue (unsigned Var, BasicBlock *BB, Value *V)
 Indicate that a rewritten value is available in the specified block with the specified value.
 
void AddUse (unsigned Var, Use *U)
 Record a use of the symbolic value.
 
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 39 of file SSAUpdaterBulk.h.

Constructor & Destructor Documentation

◆ SSAUpdaterBulk() [1/2]

llvm::SSAUpdaterBulk::SSAUpdaterBulk ( )
explicitdefault

◆ SSAUpdaterBulk() [2/2]

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

◆ ~SSAUpdaterBulk()

llvm::SSAUpdaterBulk::~SSAUpdaterBulk ( )
default

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(), LLVM_DEBUG, and llvm::SmallVectorBase< Size_T >::size().

◆ 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(), LLVM_DEBUG, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::SmallVectorBase< Size_T >::size().

◆ 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(), LLVM_DEBUG, Name, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::SmallVectorBase< Size_T >::size().

◆ operator=()

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

◆ RewriteAllUses()

void SSAUpdaterBulk::RewriteAllUses ( DominatorTree DT,
SmallVectorImpl< PHINode * > *  InsertedPHIs = nullptr 
)

Perform all the necessary updates, including new PHI-nodes insertion and the requested uses update.

The function requires dominator tree DT, which is used for computing locations for new phi-nodes insertions. If a nonnull pointer to a vector InsertedPHIs is passed, all the new phi-nodes will be added to this vector.

Definition at line 122 of file SSAUpdaterBulk.cpp.

References assert(), B, llvm::IDFCalculatorBase< NodeTy, IsPostDom >::calculate(), ComputeLiveInBlocks(), llvm::dbgs(), llvm::PredIteratorCache::get(), llvm::BasicBlock::getParent(), getUserBB(), llvm::Value::hasValueHandle(), llvm::SmallPtrSetImpl< PtrType >::insert(), LLVM_DEBUG, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::IDFCalculatorBase< NodeTy, IsPostDom >::resetLiveInBlocks(), llvm::IDFCalculatorBase< NodeTy, IsPostDom >::setDefiningBlocks(), llvm::IDFCalculatorBase< NodeTy, IsPostDom >::setLiveInBlocks(), and llvm::ValueHandleBase::ValueIsRAUWd().


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