1 //===-- AMDGPU.h - MachineFunction passes hw codegen --------------*- C++ -*-=//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
9 //===----------------------------------------------------------------------===//
14 #include "llvm/Support/TargetRegistry.h"
15 #include "llvm/Target/TargetMachine.h"
19 class AMDGPUInstrPrinter;
20 class AMDGPUTargetMachine;
28 FunctionPass *createR600VectorRegMerger(TargetMachine &tm);
29 FunctionPass *createR600TextureIntrinsicsReplacer();
30 FunctionPass *createR600ExpandSpecialInstrsPass(TargetMachine &tm);
31 FunctionPass *createR600EmitClauseMarkers();
32 FunctionPass *createR600ClauseMergePass(TargetMachine &tm);
33 FunctionPass *createR600Packetizer(TargetMachine &tm);
34 FunctionPass *createR600ControlFlowFinalizer(TargetMachine &tm);
35 FunctionPass *createAMDGPUCFGStructurizerPass();
38 FunctionPass *createSITypeRewriter();
39 FunctionPass *createSIAnnotateControlFlowPass();
40 FunctionPass *createSILowerI1CopiesPass();
41 FunctionPass *createSILowerControlFlowPass(TargetMachine &tm);
42 FunctionPass *createSIFixSGPRCopiesPass(TargetMachine &tm);
43 FunctionPass *createSICodeEmitterPass(formatted_raw_ostream &OS);
44 FunctionPass *createSIInsertWaits(TargetMachine &tm);
46 void initializeSILowerI1CopiesPass(PassRegistry &);
47 extern char &SILowerI1CopiesID;
49 // Passes common to R600 and SI
50 Pass *createAMDGPUStructurizeCFGPass();
51 FunctionPass *createAMDGPUISelDag(TargetMachine &tm);
53 /// \brief Creates an AMDGPU-specific Target Transformation Info pass.
55 createAMDGPUTargetTransformInfoPass(const AMDGPUTargetMachine *TM);
57 extern Target TheAMDGPUTarget;
59 } // End namespace llvm
61 namespace ShaderType {
70 /// OpenCL uses address spaces to differentiate between
71 /// various memory regions on the hardware. On the CPU
72 /// all of the address spaces point to the same memory,
73 /// however on the GPU, each address space points to
74 /// a separate piece of memory that is unique from other
78 PRIVATE_ADDRESS = 0, ///< Address space for private memory.
79 GLOBAL_ADDRESS = 1, ///< Address space for global memory (RAT0, VTX0).
80 CONSTANT_ADDRESS = 2, ///< Address space for constant memory
81 LOCAL_ADDRESS = 3, ///< Address space for local memory.
82 FLAT_ADDRESS = 4, ///< Address space for flat memory.
83 REGION_ADDRESS = 5, ///< Address space for region memory.
84 PARAM_D_ADDRESS = 6, ///< Address space for direct addressible parameter memory (CONST0)
85 PARAM_I_ADDRESS = 7, ///< Address space for indirect addressible parameter memory (VTX1)
87 // Do not re-order the CONSTANT_BUFFER_* enums. Several places depend on this
88 // order to be able to dynamically index a constant buffer, for example:
90 // ConstantBufferAS = CONSTANT_BUFFER_0 + CBIdx
92 CONSTANT_BUFFER_0 = 8,
93 CONSTANT_BUFFER_1 = 9,
94 CONSTANT_BUFFER_2 = 10,
95 CONSTANT_BUFFER_3 = 11,
96 CONSTANT_BUFFER_4 = 12,
97 CONSTANT_BUFFER_5 = 13,
98 CONSTANT_BUFFER_6 = 14,
99 CONSTANT_BUFFER_7 = 15,
100 CONSTANT_BUFFER_8 = 16,
101 CONSTANT_BUFFER_9 = 17,
102 CONSTANT_BUFFER_10 = 18,
103 CONSTANT_BUFFER_11 = 19,
104 CONSTANT_BUFFER_12 = 20,
105 CONSTANT_BUFFER_13 = 21,
106 CONSTANT_BUFFER_14 = 22,
107 CONSTANT_BUFFER_15 = 23,
108 ADDRESS_NONE = 24, ///< Address space for unknown memory.
109 LAST_ADDRESS = ADDRESS_NONE
112 } // namespace AMDGPUAS