LLVM  10.0.0svn
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 ()
 
 SSAUpdaterBulk (const SSAUpdaterBulk &)=delete
 
SSAUpdaterBulkoperator= (const SSAUpdaterBulk &)=delete
 
 ~SSAUpdaterBulk ()
 
unsigned AddVariable (StringRef Name, Type *Ty)
 Add a new variable to the SSA rewriter. More...
 
void AddAvailableValue (unsigned Var, BasicBlock *BB, Value *V)
 Indicate that a rewritten value is available in the specified block with the specified value. More...
 
void AddUse (unsigned Var, Use *U)
 Record a use of the symbolic value. More...
 
bool HasValueForBlock (unsigned Var, BasicBlock *BB)
 Return true if the SSAUpdater already has a value for the specified variable in the specified block. More...
 
void RewriteAllUses (DominatorTree *DT, SmallVectorImpl< PHINode *> *InsertedPHIs=nullptr)
 Perform all the necessary updates, including new PHI-nodes insertion and the requested uses update. More...
 

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 ( )
inlineexplicit

Definition at line 56 of file SSAUpdaterBulk.h.

References operator=().

◆ SSAUpdaterBulk() [2/2]

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

◆ ~SSAUpdaterBulk()

llvm::SSAUpdaterBulk::~SSAUpdaterBulk ( )
inline

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().

Referenced by ~SSAUpdaterBulk().

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

Referenced by ~SSAUpdaterBulk().

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

Referenced by ~SSAUpdaterBulk().

◆ HasValueForBlock()

bool SSAUpdaterBulk::HasValueForBlock ( unsigned  Var,
BasicBlock BB 
)

◆ operator=()

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

Referenced by SSAUpdaterBulk().

◆ 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 128 of file SSAUpdaterBulk.cpp.

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

Referenced by ~SSAUpdaterBulk().


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