R600: Make sure to inline all internal functions
[oota-llvm.git] / lib / Target / R600 / AMDGPU.h
1 //===-- AMDGPU.h - MachineFunction passes hw codegen --------------*- 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 /// \file
9 //===----------------------------------------------------------------------===//
10
11 #ifndef LLVM_LIB_TARGET_R600_AMDGPU_H
12 #define LLVM_LIB_TARGET_R600_AMDGPU_H
13
14 #include "llvm/Support/TargetRegistry.h"
15 #include "llvm/Target/TargetMachine.h"
16
17 namespace llvm {
18
19 class AMDGPUInstrPrinter;
20 class AMDGPUSubtarget;
21 class AMDGPUTargetMachine;
22 class FunctionPass;
23 class MCAsmInfo;
24 class raw_ostream;
25 class Target;
26 class TargetMachine;
27
28 // R600 Passes
29 FunctionPass *createR600VectorRegMerger(TargetMachine &tm);
30 FunctionPass *createR600TextureIntrinsicsReplacer();
31 FunctionPass *createR600ExpandSpecialInstrsPass(TargetMachine &tm);
32 FunctionPass *createR600EmitClauseMarkers();
33 FunctionPass *createR600ClauseMergePass(TargetMachine &tm);
34 FunctionPass *createR600Packetizer(TargetMachine &tm);
35 FunctionPass *createR600ControlFlowFinalizer(TargetMachine &tm);
36 FunctionPass *createAMDGPUCFGStructurizerPass();
37
38 // SI Passes
39 FunctionPass *createSITypeRewriter();
40 FunctionPass *createSIAnnotateControlFlowPass();
41 FunctionPass *createSILowerI1CopiesPass();
42 FunctionPass *createSIShrinkInstructionsPass();
43 FunctionPass *createSILoadStoreOptimizerPass(TargetMachine &tm);
44 FunctionPass *createSILowerControlFlowPass(TargetMachine &tm);
45 FunctionPass *createSIFixSGPRCopiesPass(TargetMachine &tm);
46 FunctionPass *createSIFixSGPRLiveRangesPass();
47 FunctionPass *createSICodeEmitterPass(formatted_raw_ostream &OS);
48 FunctionPass *createSIInsertWaits(TargetMachine &tm);
49
50 void initializeSILowerI1CopiesPass(PassRegistry &);
51 extern char &SILowerI1CopiesID;
52
53 void initializeSILoadStoreOptimizerPass(PassRegistry &);
54 extern char &SILoadStoreOptimizerID;
55
56 // Passes common to R600 and SI
57 FunctionPass *createAMDGPUPromoteAlloca(const AMDGPUSubtarget &ST);
58 Pass *createAMDGPUStructurizeCFGPass();
59 FunctionPass *createAMDGPUISelDag(TargetMachine &tm);
60 ModulePass *createAMDGPUAlwaysInlinePass();
61
62 /// \brief Creates an AMDGPU-specific Target Transformation Info pass.
63 ImmutablePass *
64 createAMDGPUTargetTransformInfoPass(const AMDGPUTargetMachine *TM);
65
66 void initializeSIFixSGPRLiveRangesPass(PassRegistry&);
67 extern char &SIFixSGPRLiveRangesID;
68
69
70 extern Target TheAMDGPUTarget;
71
72 namespace AMDGPU {
73 enum TargetIndex {
74   TI_CONSTDATA_START
75 };
76 }
77
78 #define END_OF_TEXT_LABEL_NAME "EndOfTextLabel"
79
80 } // End namespace llvm
81
82 namespace ShaderType {
83   enum Type {
84     PIXEL = 0,
85     VERTEX = 1,
86     GEOMETRY = 2,
87     COMPUTE = 3
88   };
89 }
90
91 /// OpenCL uses address spaces to differentiate between
92 /// various memory regions on the hardware. On the CPU
93 /// all of the address spaces point to the same memory,
94 /// however on the GPU, each address space points to
95 /// a separate piece of memory that is unique from other
96 /// memory locations.
97 namespace AMDGPUAS {
98 enum AddressSpaces {
99   PRIVATE_ADDRESS  = 0, ///< Address space for private memory.
100   GLOBAL_ADDRESS   = 1, ///< Address space for global memory (RAT0, VTX0).
101   CONSTANT_ADDRESS = 2, ///< Address space for constant memory
102   LOCAL_ADDRESS    = 3, ///< Address space for local memory.
103   FLAT_ADDRESS     = 4, ///< Address space for flat memory.
104   REGION_ADDRESS   = 5, ///< Address space for region memory.
105   PARAM_D_ADDRESS  = 6, ///< Address space for direct addressible parameter memory (CONST0)
106   PARAM_I_ADDRESS  = 7, ///< Address space for indirect addressible parameter memory (VTX1)
107
108   // Do not re-order the CONSTANT_BUFFER_* enums.  Several places depend on this
109   // order to be able to dynamically index a constant buffer, for example:
110   //
111   // ConstantBufferAS = CONSTANT_BUFFER_0 + CBIdx
112
113   CONSTANT_BUFFER_0 = 8,
114   CONSTANT_BUFFER_1 = 9,
115   CONSTANT_BUFFER_2 = 10,
116   CONSTANT_BUFFER_3 = 11,
117   CONSTANT_BUFFER_4 = 12,
118   CONSTANT_BUFFER_5 = 13,
119   CONSTANT_BUFFER_6 = 14,
120   CONSTANT_BUFFER_7 = 15,
121   CONSTANT_BUFFER_8 = 16,
122   CONSTANT_BUFFER_9 = 17,
123   CONSTANT_BUFFER_10 = 18,
124   CONSTANT_BUFFER_11 = 19,
125   CONSTANT_BUFFER_12 = 20,
126   CONSTANT_BUFFER_13 = 21,
127   CONSTANT_BUFFER_14 = 22,
128   CONSTANT_BUFFER_15 = 23,
129   ADDRESS_NONE = 24, ///< Address space for unknown memory.
130   LAST_ADDRESS = ADDRESS_NONE
131 };
132
133 } // namespace AMDGPUAS
134
135 #endif