34 return "NVPTX specific alloca hoisting";
42 bool functionModified =
false;
44 Instruction *firstTerminatorInst = (I++)->getTerminator();
49 if (allocaInst && isa<ConstantInt>(allocaInst->
getArraySize())) {
51 functionModified =
true;
56 return functionModified;
66 NVPTXAllocaHoisting,
"alloca-hoisting",
67 "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.
This class represents lattice values for constants.
FunctionPass * createAllocaHoisting()
static bool runOnFunction(Function &F, bool PostInlining)
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
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 &)
const Value * getArraySize() const
Get the number of elements allocated.
Iterator for intrusive lists based on ilist_node.
INITIALIZE_PASS(NVPTXAllocaHoisting, "alloca-hoisting", "Hoisting alloca instructions in non-entry blocks to the entry block", false, false) FunctionPass *llvm
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
void moveBefore(Instruction *MovePos)
Unlink this instruction from its current basic block and insert it into the basic block that MovePos ...
StringRef - Represent a constant reference to a string, i.e.
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
an instruction to allocate memory on the stack