35 const char *getPassName()
const override {
36 return "NVPTX specific alloca hoisting";
39 bool runOnFunction(
Function &
function)
override;
43 bool NVPTXAllocaHoisting::runOnFunction(
Function &
function) {
44 bool functionModified =
false;
51 if (allocaInst && isa<ConstantInt>(allocaInst->
getArraySize())) {
53 functionModified =
true;
58 return functionModified;
68 NVPTXAllocaHoisting,
"alloca-hoisting",
69 "Hoisting alloca instructions in non-entry blocks to the entry block",
const_iterator end(StringRef path)
Get end iterator over path.
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
FunctionPass * createAllocaHoisting()
MachineFunctionAnalysis - This class is a Pass that manages a MachineFunction object.
Subclasses of this class are all able to terminate a basic block.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
void initializeNVPTXAllocaHoistingPass(PassRegistry &)
INITIALIZE_PASS(NVPTXAllocaHoisting,"alloca-hoisting","Hoisting alloca instructions in non-entry blocks to the entry block", false, false) FunctionPass *llvm
LLVM_ATTRIBUTE_UNUSED_RESULT std::enable_if< !is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
const Value * getArraySize() const
getArraySize - Get the number of elements allocated.
void moveBefore(Instruction *MovePos)
moveBefore - Unlink this instruction from its current basic block and insert it into the basic block ...
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
AllocaInst - an instruction to allocate memory on the stack.