LLVM 20.0.0git
|
#include "llvm/Transforms/Utils/MoveAutoInit.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/MemorySSA.h"
#include "llvm/Analysis/MemorySSAUpdater.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/DebugInfo.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Transforms/Utils/LoopUtils.h"
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) |
Variables | |
static cl::opt< unsigned > | MoveAutoInitThreshold ("move-auto-init-threshold", cl::Hidden, cl::init(128), cl::desc("Maximum instructions to analyze per moved initialization")) |
#define DEBUG_TYPE "move-auto-init" |
Definition at line 29 of file MoveAutoInit.cpp.
|
static |
Definition at line 37 of file MoveAutoInit.cpp.
References llvm::any_of(), and I.
Referenced by runMoveAutoInit().
|
static |
Definition at line 104 of file MoveAutoInit.cpp.
References llvm::SmallPtrSetImpl< PtrType >::count(), llvm::SmallVectorImpl< T >::emplace_back(), llvm::SmallVectorBase< Size_T >::empty(), F, llvm::DominatorTree::findNearestCommonDominator(), llvm::BasicBlock::getFirstNonPHI(), llvm::MemorySSA::getMemoryAccess(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::BasicBlock::getUniquePredecessor(), hasAutoInitMetadata(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::DominatorTree::isReachableFromEntry(), ML, llvm::MemorySSAUpdater::moveToPlace(), llvm::SmallVectorImpl< T >::pop_back_val(), llvm::predecessors(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::reverse(), llvm::SmallVectorBase< Size_T >::size(), llvm::Successor, llvm::successors(), usersDominator(), llvm::MemorySSA::verifyMemorySSA(), llvm::VerifyMemorySSA, and writeToAlloca().
Referenced by llvm::MoveAutoInitPass::run().
STATISTIC | ( | NumMoved | , |
"Number of instructions moved" | |||
) |
|
static |
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::SmallVectorBase< Size_T >::empty(), llvm::DominatorTree::findNearestCommonDominator(), llvm::MemorySSA::getAA(), llvm::MemorySSA::getMemoryAccess(), llvm::BatchAAResults::getModRefInfo(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::map_range(), MI, ML, MoveAutoInitThreshold, llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallPtrSetImplBase::size(), and llvm::Value::users().
Referenced by runMoveAutoInit().
|
static |
Definition at line 43 of file MoveAutoInit.cpp.
References llvm::MemoryLocation::get(), llvm::MemoryLocation::getForDest(), llvm::getUnderlyingObject(), I, MI, and ML.
Referenced by runMoveAutoInit().
|
static |
Referenced by usersDominator().