LLVM 20.0.0git
Macros | Functions | Variables
MoveAutoInit.cpp File Reference
#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< MemoryLocationwriteToAlloca (const Instruction &I)
 
static BasicBlockusersDominator (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< unsignedMoveAutoInitThreshold ("move-auto-init-threshold", cl::Hidden, cl::init(128), cl::desc("Maximum instructions to analyze per moved initialization"))
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "move-auto-init"

Definition at line 29 of file MoveAutoInit.cpp.

Function Documentation

◆ hasAutoInitMetadata()

static bool hasAutoInitMetadata ( const Instruction I)
static

Definition at line 37 of file MoveAutoInit.cpp.

References llvm::any_of(), and I.

Referenced by runMoveAutoInit().

◆ runMoveAutoInit()

static bool runMoveAutoInit ( Function F,
DominatorTree DT,
MemorySSA MSSA 
)
static

◆ STATISTIC()

STATISTIC ( NumMoved  ,
"Number of instructions moved"   
)

◆ usersDominator()

static BasicBlock * usersDominator ( const MemoryLocation ML,
Instruction I,
DominatorTree DT,
MemorySSA MSSA 
)
static

◆ writeToAlloca()

static std::optional< MemoryLocation > writeToAlloca ( const Instruction I)
static

Variable Documentation

◆ 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

Referenced by usersDominator().