LLVM: lib/Transforms/Utils/MoveAutoInit.cpp File Reference (original) (raw)
Go to the source code of this file.
| Macros | |
|---|---|
| #define | DEBUG_TYPE "move-auto-init" |
| Functions | |
|---|---|
| STATISTIC (NumMoved, "Number of instructions moved") | |
| static bool | hasAutoInitMetadata (const Instruction &I) |
| static std::optional< MemoryLocation > | writeToAlloca (const Instruction &I) |
| static BasicBlock * | usersDominator (const MemoryLocation &ML, Instruction *I, DominatorTree &DT, MemorySSA &MSSA) |
| Finds a BasicBlock in the CFG where instruction I can be moved to while not changing the Memory SSA ordering and being guarded by at least one condition. | |
| static bool | runMoveAutoInit (Function &F, DominatorTree &DT, MemorySSA &MSSA) |
◆ DEBUG_TYPE
#define DEBUG_TYPE "move-auto-init"
◆ hasAutoInitMetadata()
◆ runMoveAutoInit()
Definition at line 104 of file MoveAutoInit.cpp.
References llvm::MemorySSA::Beginning, llvm::SmallPtrSetImpl< PtrType >::count(), llvm::SmallVectorImpl< T >::emplace_back(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), F, llvm::DominatorTree::findNearestCommonDominator(), llvm::BasicBlock::getFirstNonPHIIt(), llvm::MemorySSA::getMemoryAccess(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::BasicBlock::getUniquePredecessor(), hasAutoInitMetadata(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::isa(), llvm::DominatorTree::isReachableFromEntry(), ML, llvm::MemorySSAUpdater::moveToPlace(), llvm::SmallVectorImpl< T >::pop_back_val(), llvm::predecessors(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::reverse(), llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::Successor, llvm::successors(), usersDominator(), llvm::VerifyMemorySSA, llvm::MemorySSA::verifyMemorySSA(), and writeToAlloca().
Referenced by llvm::MoveAutoInitPass::run().
◆ STATISTIC()
◆ usersDominator()
Finds a BasicBlock in the CFG where instruction I can be moved to while not changing the Memory SSA ordering and being guarded by at least one condition.
Definition at line 61 of file MoveAutoInit.cpp.
References llvm::append_range(), llvm::cast(), llvm::dyn_cast(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::DominatorTree::findNearestCommonDominator(), llvm::MemorySSA::getAA(), llvm::MemorySSA::getMemoryAccess(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::map_range(), MI, ML, MoveAutoInitThreshold, llvm::NoModRef, llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallPtrSetImplBase::size(), and llvm::Value::users().
Referenced by runMoveAutoInit().
◆ writeToAlloca()
◆ MoveAutoInitThreshold
| cl::opt< unsigned > MoveAutoInitThreshold("move-auto-init-threshold", cl::Hidden, cl::init(128), cl::desc("Maximum instructions to analyze per moved initialization")) ( "move-auto-init-threshold" , cl::Hidden , cl::init(128) , cl::desc("Maximum instructions to analyze per moved initialization") ) | static |
|---|