Go to the documentation of this file.
33 return "NVPTX specific alloca hoisting";
41 bool functionModified =
false;
43 Instruction *firstTerminatorInst = (
I++)->getTerminator();
47 AllocaInst *allocaInst = dyn_cast<AllocaInst>(BI++);
48 if (allocaInst && isa<ConstantInt>(allocaInst->
getArraySize())) {
50 functionModified =
true;
55 return functionModified;
65 NVPTXAllocaHoisting,
"alloca-hoisting",
66 "Hoisting alloca instructions in non-entry blocks to the entry block",
This is an optimization pass for GlobalISel generic memory operations.
InstListType::iterator iterator
Instruction iterators...
void initializeNVPTXAllocaHoistingPass(PassRegistry &)
const_iterator end(StringRef path)
Get end iterator over path.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
INITIALIZE_PASS(NVPTXAllocaHoisting, "alloca-hoisting", "Hoisting alloca instructions in non-entry blocks to the entry block", false, false) FunctionPass *llvm
Represent the analysis usage information of a pass.
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
const Value * getArraySize() const
Get the number of elements allocated.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
StringRef - Represent a constant reference to a string, i.e.
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
static bool runOnFunction(Function &F, bool PostInlining)
FunctionPass class - This class is used to implement most global optimizations.
an instruction to allocate memory on the stack
void moveBefore(Instruction *MovePos)
Unlink this instruction from its current basic block and insert it into the basic block that MovePos ...
BasicBlockListType::iterator iterator
FunctionPass * createAllocaHoisting()