LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NVPTXAllocaHoisting.h
Go to the documentation of this file.
1 //===-- AllocaHoisting.h - Hosist allocas to the entry block ----*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // Hoist the alloca instructions in the non-entry blocks to the entry blocks.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef NVPTX_ALLOCA_HOISTING_H_
15 #define NVPTX_ALLOCA_HOISTING_H_
16 
18 #include "llvm/IR/DataLayout.h"
19 #include "llvm/Pass.h"
20 
21 namespace llvm {
22 
23 class FunctionPass;
24 class Function;
25 
26 // Hoisting the alloca instructions in the non-entry blocks to the entry
27 // block.
29 public:
30  static char ID; // Pass ID
32 
33  void getAnalysisUsage(AnalysisUsage &AU) const {
34  AU.addRequired<DataLayout>();
36  }
37 
38  virtual const char *getPassName() const {
39  return "NVPTX specific alloca hoisting";
40  }
41 
42  virtual bool runOnFunction(Function &function);
43 };
44 
45 extern FunctionPass *createAllocaHoisting();
46 
47 } // end namespace llvm
48 
49 #endif // NVPTX_ALLOCA_HOISTING_H_
virtual bool runOnFunction(Function &function)
AnalysisUsage & addPreserved()
AnalysisUsage & addRequired()
virtual const char * getPassName() const
FunctionPass * createAllocaHoisting()
void getAnalysisUsage(AnalysisUsage &AU) const