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;
58char NVPTXAllocaHoisting::ID = 0;
65 NVPTXAllocaHoisting,
"alloca-hoisting",
66 "Hoisting alloca instructions in non-entry blocks to the entry block",
This file contains the declarations for the subclasses of Constant, which represent the different fla...
Performs the initial survey of the specified function
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
an instruction to allocate memory on the stack
const Value * getArraySize() const
Get the number of elements allocated.
Represent the analysis usage information of a pass.
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
InstListType::iterator iterator
Instruction iterators...
FunctionPass class - This class is used to implement most global optimizations.
virtual bool runOnFunction(Function &F)=0
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.
BasicBlockListType::iterator iterator
void moveBefore(Instruction *MovePos)
Unlink this instruction from its current basic block and insert it into the basic block that MovePos ...
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
virtual void getAnalysisUsage(AnalysisUsage &) const
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
virtual StringRef getPassName() const
getPassName - Return a nice clean name for a pass.
StringRef - Represent a constant reference to a string, i.e.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.
FunctionPass * createAllocaHoisting()
void initializeNVPTXAllocaHoistingPass(PassRegistry &)