LLVM API Documentation
00001 //===-- AMDGPU.h - MachineFunction passes hw codegen --------------*- C++ -*-=// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 /// \file 00009 //===----------------------------------------------------------------------===// 00010 00011 #ifndef LLVM_LIB_TARGET_R600_AMDGPU_H 00012 #define LLVM_LIB_TARGET_R600_AMDGPU_H 00013 00014 #include "llvm/Support/TargetRegistry.h" 00015 #include "llvm/Target/TargetMachine.h" 00016 00017 namespace llvm { 00018 00019 class AMDGPUInstrPrinter; 00020 class AMDGPUSubtarget; 00021 class AMDGPUTargetMachine; 00022 class FunctionPass; 00023 class MCAsmInfo; 00024 class raw_ostream; 00025 class Target; 00026 class TargetMachine; 00027 00028 // R600 Passes 00029 FunctionPass *createR600VectorRegMerger(TargetMachine &tm); 00030 FunctionPass *createR600TextureIntrinsicsReplacer(); 00031 FunctionPass *createR600ExpandSpecialInstrsPass(TargetMachine &tm); 00032 FunctionPass *createR600EmitClauseMarkers(); 00033 FunctionPass *createR600ClauseMergePass(TargetMachine &tm); 00034 FunctionPass *createR600Packetizer(TargetMachine &tm); 00035 FunctionPass *createR600ControlFlowFinalizer(TargetMachine &tm); 00036 FunctionPass *createAMDGPUCFGStructurizerPass(); 00037 00038 // SI Passes 00039 FunctionPass *createSITypeRewriter(); 00040 FunctionPass *createSIAnnotateControlFlowPass(); 00041 FunctionPass *createSILowerI1CopiesPass(); 00042 FunctionPass *createSIShrinkInstructionsPass(); 00043 FunctionPass *createSILowerControlFlowPass(TargetMachine &tm); 00044 FunctionPass *createSIFixSGPRCopiesPass(TargetMachine &tm); 00045 FunctionPass *createSIFixSGPRLiveRangesPass(); 00046 FunctionPass *createSICodeEmitterPass(formatted_raw_ostream &OS); 00047 FunctionPass *createSIInsertWaits(TargetMachine &tm); 00048 00049 void initializeSILowerI1CopiesPass(PassRegistry &); 00050 extern char &SILowerI1CopiesID; 00051 00052 // Passes common to R600 and SI 00053 FunctionPass *createAMDGPUPromoteAlloca(const AMDGPUSubtarget &ST); 00054 Pass *createAMDGPUStructurizeCFGPass(); 00055 FunctionPass *createAMDGPUISelDag(TargetMachine &tm); 00056 00057 /// \brief Creates an AMDGPU-specific Target Transformation Info pass. 00058 ImmutablePass * 00059 createAMDGPUTargetTransformInfoPass(const AMDGPUTargetMachine *TM); 00060 00061 void initializeSIFixSGPRLiveRangesPass(PassRegistry&); 00062 extern char &SIFixSGPRLiveRangesID; 00063 00064 00065 extern Target TheAMDGPUTarget; 00066 00067 namespace AMDGPU { 00068 enum TargetIndex { 00069 TI_CONSTDATA_START 00070 }; 00071 } 00072 00073 #define END_OF_TEXT_LABEL_NAME "EndOfTextLabel" 00074 00075 } // End namespace llvm 00076 00077 namespace ShaderType { 00078 enum Type { 00079 PIXEL = 0, 00080 VERTEX = 1, 00081 GEOMETRY = 2, 00082 COMPUTE = 3 00083 }; 00084 } 00085 00086 /// OpenCL uses address spaces to differentiate between 00087 /// various memory regions on the hardware. On the CPU 00088 /// all of the address spaces point to the same memory, 00089 /// however on the GPU, each address space points to 00090 /// a separate piece of memory that is unique from other 00091 /// memory locations. 00092 namespace AMDGPUAS { 00093 enum AddressSpaces { 00094 PRIVATE_ADDRESS = 0, ///< Address space for private memory. 00095 GLOBAL_ADDRESS = 1, ///< Address space for global memory (RAT0, VTX0). 00096 CONSTANT_ADDRESS = 2, ///< Address space for constant memory 00097 LOCAL_ADDRESS = 3, ///< Address space for local memory. 00098 FLAT_ADDRESS = 4, ///< Address space for flat memory. 00099 REGION_ADDRESS = 5, ///< Address space for region memory. 00100 PARAM_D_ADDRESS = 6, ///< Address space for direct addressible parameter memory (CONST0) 00101 PARAM_I_ADDRESS = 7, ///< Address space for indirect addressible parameter memory (VTX1) 00102 00103 // Do not re-order the CONSTANT_BUFFER_* enums. Several places depend on this 00104 // order to be able to dynamically index a constant buffer, for example: 00105 // 00106 // ConstantBufferAS = CONSTANT_BUFFER_0 + CBIdx 00107 00108 CONSTANT_BUFFER_0 = 8, 00109 CONSTANT_BUFFER_1 = 9, 00110 CONSTANT_BUFFER_2 = 10, 00111 CONSTANT_BUFFER_3 = 11, 00112 CONSTANT_BUFFER_4 = 12, 00113 CONSTANT_BUFFER_5 = 13, 00114 CONSTANT_BUFFER_6 = 14, 00115 CONSTANT_BUFFER_7 = 15, 00116 CONSTANT_BUFFER_8 = 16, 00117 CONSTANT_BUFFER_9 = 17, 00118 CONSTANT_BUFFER_10 = 18, 00119 CONSTANT_BUFFER_11 = 19, 00120 CONSTANT_BUFFER_12 = 20, 00121 CONSTANT_BUFFER_13 = 21, 00122 CONSTANT_BUFFER_14 = 22, 00123 CONSTANT_BUFFER_15 = 23, 00124 ADDRESS_NONE = 24, ///< Address space for unknown memory. 00125 LAST_ADDRESS = ADDRESS_NONE 00126 }; 00127 00128 } // namespace AMDGPUAS 00129 00130 #endif