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(TargetMachine &tm);
32 FunctionPass *createR600Packetizer(TargetMachine &tm);
33 FunctionPass *createR600ControlFlowFinalizer(TargetMachine &tm);
34 FunctionPass *createAMDGPUCFGStructurizerPass(TargetMachine &tm);
37 FunctionPass *createSIAnnotateControlFlowPass();
38 FunctionPass *createSILowerControlFlowPass(TargetMachine &tm);
39 FunctionPass *createSICodeEmitterPass(formatted_raw_ostream &OS);
40 FunctionPass *createSIInsertWaits(TargetMachine &tm);
42 // Passes common to R600 and SI
43 Pass *createAMDGPUStructurizeCFGPass();
44 FunctionPass *createAMDGPUConvertToISAPass(TargetMachine &tm);
45 FunctionPass *createAMDGPUIndirectAddressingPass(TargetMachine &tm);
46 FunctionPass *createAMDGPUISelDag(TargetMachine &tm);
48 extern Target TheAMDGPUTarget;
50 } // End namespace llvm
52 namespace ShaderType {
61 /// OpenCL uses address spaces to differentiate between
62 /// various memory regions on the hardware. On the CPU
63 /// all of the address spaces point to the same memory,
64 /// however on the GPU, each address space points to
65 /// a seperate piece of memory that is unique from other
69 PRIVATE_ADDRESS = 0, ///< Address space for private memory.
70 GLOBAL_ADDRESS = 1, ///< Address space for global memory (RAT0, VTX0).
71 CONSTANT_ADDRESS = 2, ///< Address space for constant memory
72 LOCAL_ADDRESS = 3, ///< Address space for local memory.
73 REGION_ADDRESS = 4, ///< Address space for region memory.
74 ADDRESS_NONE = 5, ///< Address space for unknown memory.
75 PARAM_D_ADDRESS = 6, ///< Address space for direct addressible parameter memory (CONST0)
76 PARAM_I_ADDRESS = 7, ///< Address space for indirect addressible parameter memory (VTX1)
78 // Do not re-order the CONSTANT_BUFFER_* enums. Several places depend on this
79 // order to be able to dynamically index a constant buffer, for example:
81 // ConstantBufferAS = CONSTANT_BUFFER_0 + CBIdx
83 CONSTANT_BUFFER_0 = 8,
84 CONSTANT_BUFFER_1 = 9,
85 CONSTANT_BUFFER_2 = 10,
86 CONSTANT_BUFFER_3 = 11,
87 CONSTANT_BUFFER_4 = 12,
88 CONSTANT_BUFFER_5 = 13,
89 CONSTANT_BUFFER_6 = 14,
90 CONSTANT_BUFFER_7 = 15,
91 CONSTANT_BUFFER_8 = 16,
92 CONSTANT_BUFFER_9 = 17,
93 CONSTANT_BUFFER_10 = 18,
94 CONSTANT_BUFFER_11 = 19,
95 CONSTANT_BUFFER_12 = 20,
96 CONSTANT_BUFFER_13 = 21,
97 CONSTANT_BUFFER_14 = 22,
98 CONSTANT_BUFFER_15 = 23,
102 } // namespace AMDGPUAS