21 bool functionModified =
false;
23 Instruction *firstTerminatorInst = (
I++)->getTerminator();
30 functionModified =
true;
35 return functionModified;
41class NVPTXAllocaHoistingLegacyPass :
public FunctionPass {
44 NVPTXAllocaHoistingLegacyPass() : FunctionPass(ID) {}
46 void getAnalysisUsage(AnalysisUsage &AU)
const override {
51 StringRef getPassName()
const override {
52 return "NVPTX specific alloca hoisting";
61char NVPTXAllocaHoistingLegacyPass::ID = 0;
64 NVPTXAllocaHoistingLegacyPass,
"alloca-hoisting",
65 "Hoisting alloca instructions in non-entry blocks to the entry block",
69 return new NVPTXAllocaHoistingLegacyPass;
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This file contains the declarations for the subclasses of Constant, which represent the different fla...
static bool runOnFunction(Function &F, bool PostInlining)
static bool hoistAllocas(Function &function)
FunctionAnalysisManager FAM
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
dot regions Print regions of function to dot true view regions View regions of function(with no function bodies)"
an instruction to allocate memory on the stack
const Value * getArraySize() const
Get the number of elements allocated.
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
LLVM_ABI void setPreservesCFG()
This function should be called by the pass, iff they do not:
InstListType::iterator iterator
Instruction iterators...
Represents analyses that only rely on functions' control flow.
FunctionPass class - This class is used to implement most global optimizations.
BasicBlockListType::iterator iterator
LLVM_ABI void moveBefore(InstListType::iterator InsertPos)
Unlink this instruction from its current basic block and insert it into the basic block that MovePos ...
PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM)
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
PreservedAnalyses & preserveSet()
Mark an analysis set as preserved.
PreservedAnalyses & preserve()
Mark an analysis as preserved.
self_iterator getIterator()
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
FunctionPass * createNVPTXAllocaHoistingLegacyPass()
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.