LLVM 22.0.0git
|
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 | |
SSAUpdaterBulk & | operator= (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. |
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.
|
explicitdefault |
Referenced by operator=(), and SSAUpdaterBulk().
|
delete |
References SSAUpdaterBulk().
|
default |
References LLVM_ABI.
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.
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.
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.
|
delete |
References SSAUpdaterBulk().
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 112 of file SSAUpdaterBulk.cpp.
References assert(), B(), llvm::IDFCalculatorBase< NodeTy, IsPostDom >::calculate(), llvm::cast(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::clear(), ComputeLiveInBlocks(), llvm::dbgs(), llvm::from_range, llvm::BasicBlock::front(), llvm::UndefValue::get(), llvm::DomTreeNodeBase< NodeT >::getBlock(), llvm::DomTreeNodeBase< NodeT >::getIDom(), llvm::DominatorTreeBase< NodeT, IsPostDom >::getNode(), getUserBB(), llvm::Value::hasValueHandle(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::DominatorTree::isReachableFromEntry(), LLVM_DEBUG, llvm::make_first_range(), PHI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::reserve(), llvm::IDFCalculatorBase< NodeTy, IsPostDom >::setDefiningBlocks(), llvm::IDFCalculatorBase< NodeTy, IsPostDom >::setLiveInBlocks(), llvm::SmallPtrSetImplBase::size(), and llvm::ValueHandleBase::ValueIsRAUWd().