Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 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 AMDGPU_H |
| 12 | #define AMDGPU_H |
| 13 | |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 14 | #include "llvm/Support/TargetRegistry.h" |
| 15 | #include "llvm/Target/TargetMachine.h" |
| 16 | |
| 17 | namespace llvm { |
| 18 | |
Tom Stellard | a6c6e1b | 2013-06-07 20:37:48 +0000 | [diff] [blame] | 19 | class AMDGPUInstrPrinter; |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 20 | class AMDGPUTargetMachine; |
Tom Stellard | a6c6e1b | 2013-06-07 20:37:48 +0000 | [diff] [blame] | 21 | class FunctionPass; |
| 22 | class MCAsmInfo; |
| 23 | class raw_ostream; |
| 24 | class Target; |
| 25 | class TargetMachine; |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 26 | |
| 27 | // R600 Passes |
Vincent Lejeune | dec1875 | 2013-06-05 21:38:04 +0000 | [diff] [blame] | 28 | FunctionPass *createR600VectorRegMerger(TargetMachine &tm); |
Tom Stellard | a6c6e1b | 2013-06-07 20:37:48 +0000 | [diff] [blame] | 29 | FunctionPass *createR600TextureIntrinsicsReplacer(); |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 30 | FunctionPass *createR600ExpandSpecialInstrsPass(TargetMachine &tm); |
Tom Stellard | 1de5582 | 2013-12-11 17:51:41 +0000 | [diff] [blame] | 31 | FunctionPass *createR600EmitClauseMarkers(); |
Vincent Lejeune | a4da6fb | 2013-10-01 19:32:58 +0000 | [diff] [blame] | 32 | FunctionPass *createR600ClauseMergePass(TargetMachine &tm); |
Vincent Lejeune | 147700b | 2013-04-30 00:14:27 +0000 | [diff] [blame] | 33 | FunctionPass *createR600Packetizer(TargetMachine &tm); |
Vincent Lejeune | bfaa63a6 | 2013-04-01 21:48:05 +0000 | [diff] [blame] | 34 | FunctionPass *createR600ControlFlowFinalizer(TargetMachine &tm); |
Tom Stellard | f2ba972 | 2013-12-11 17:51:47 +0000 | [diff] [blame] | 35 | FunctionPass *createAMDGPUCFGStructurizerPass(); |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 36 | |
| 37 | // SI Passes |
Tom Stellard | 9fa1791 | 2013-08-14 23:24:45 +0000 | [diff] [blame] | 38 | FunctionPass *createSITypeRewriter(); |
Tom Stellard | f879435 | 2012-12-19 22:10:31 +0000 | [diff] [blame] | 39 | FunctionPass *createSIAnnotateControlFlowPass(); |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 40 | FunctionPass *createSILowerControlFlowPass(TargetMachine &tm); |
Tom Stellard | 2f7cdda | 2013-08-06 23:08:28 +0000 | [diff] [blame] | 41 | FunctionPass *createSIFixSGPRCopiesPass(TargetMachine &tm); |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 42 | FunctionPass *createSICodeEmitterPass(formatted_raw_ostream &OS); |
Tom Stellard | c4cabef | 2013-01-18 21:15:53 +0000 | [diff] [blame] | 43 | FunctionPass *createSIInsertWaits(TargetMachine &tm); |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 44 | |
| 45 | // Passes common to R600 and SI |
Tom Stellard | f879435 | 2012-12-19 22:10:31 +0000 | [diff] [blame] | 46 | Pass *createAMDGPUStructurizeCFGPass(); |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 47 | FunctionPass *createAMDGPUConvertToISAPass(TargetMachine &tm); |
Tom Stellard | a6c6e1b | 2013-06-07 20:37:48 +0000 | [diff] [blame] | 48 | FunctionPass *createAMDGPUISelDag(TargetMachine &tm); |
| 49 | |
Tom Stellard | 8b1e021 | 2013-07-27 00:01:07 +0000 | [diff] [blame] | 50 | /// \brief Creates an AMDGPU-specific Target Transformation Info pass. |
| 51 | ImmutablePass * |
| 52 | createAMDGPUTargetTransformInfoPass(const AMDGPUTargetMachine *TM); |
| 53 | |
Tom Stellard | a6c6e1b | 2013-06-07 20:37:48 +0000 | [diff] [blame] | 54 | extern Target TheAMDGPUTarget; |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 55 | |
| 56 | } // End namespace llvm |
| 57 | |
| 58 | namespace ShaderType { |
| 59 | enum Type { |
| 60 | PIXEL = 0, |
| 61 | VERTEX = 1, |
| 62 | GEOMETRY = 2, |
| 63 | COMPUTE = 3 |
| 64 | }; |
| 65 | } |
| 66 | |
Tom Stellard | a6c6e1b | 2013-06-07 20:37:48 +0000 | [diff] [blame] | 67 | /// OpenCL uses address spaces to differentiate between |
| 68 | /// various memory regions on the hardware. On the CPU |
| 69 | /// all of the address spaces point to the same memory, |
| 70 | /// however on the GPU, each address space points to |
Alp Toker | cb40291 | 2014-01-24 17:20:08 +0000 | [diff] [blame^] | 71 | /// a separate piece of memory that is unique from other |
Tom Stellard | a6c6e1b | 2013-06-07 20:37:48 +0000 | [diff] [blame] | 72 | /// memory locations. |
| 73 | namespace AMDGPUAS { |
| 74 | enum AddressSpaces { |
| 75 | PRIVATE_ADDRESS = 0, ///< Address space for private memory. |
| 76 | GLOBAL_ADDRESS = 1, ///< Address space for global memory (RAT0, VTX0). |
| 77 | CONSTANT_ADDRESS = 2, ///< Address space for constant memory |
| 78 | LOCAL_ADDRESS = 3, ///< Address space for local memory. |
| 79 | REGION_ADDRESS = 4, ///< Address space for region memory. |
| 80 | ADDRESS_NONE = 5, ///< Address space for unknown memory. |
| 81 | PARAM_D_ADDRESS = 6, ///< Address space for direct addressible parameter memory (CONST0) |
| 82 | PARAM_I_ADDRESS = 7, ///< Address space for indirect addressible parameter memory (VTX1) |
Tom Stellard | 1e80309 | 2013-07-23 01:48:18 +0000 | [diff] [blame] | 83 | |
| 84 | // Do not re-order the CONSTANT_BUFFER_* enums. Several places depend on this |
| 85 | // order to be able to dynamically index a constant buffer, for example: |
| 86 | // |
| 87 | // ConstantBufferAS = CONSTANT_BUFFER_0 + CBIdx |
| 88 | |
Tom Stellard | a6c6e1b | 2013-06-07 20:37:48 +0000 | [diff] [blame] | 89 | CONSTANT_BUFFER_0 = 8, |
| 90 | CONSTANT_BUFFER_1 = 9, |
| 91 | CONSTANT_BUFFER_2 = 10, |
| 92 | CONSTANT_BUFFER_3 = 11, |
| 93 | CONSTANT_BUFFER_4 = 12, |
| 94 | CONSTANT_BUFFER_5 = 13, |
| 95 | CONSTANT_BUFFER_6 = 14, |
| 96 | CONSTANT_BUFFER_7 = 15, |
| 97 | CONSTANT_BUFFER_8 = 16, |
| 98 | CONSTANT_BUFFER_9 = 17, |
| 99 | CONSTANT_BUFFER_10 = 18, |
| 100 | CONSTANT_BUFFER_11 = 19, |
| 101 | CONSTANT_BUFFER_12 = 20, |
| 102 | CONSTANT_BUFFER_13 = 21, |
| 103 | CONSTANT_BUFFER_14 = 22, |
| 104 | CONSTANT_BUFFER_15 = 23, |
| 105 | LAST_ADDRESS = 24 |
| 106 | }; |
| 107 | |
| 108 | } // namespace AMDGPUAS |
| 109 | |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 110 | #endif // AMDGPU_H |