2012-12-11 21:25:42 +00:00
|
|
|
//===-- AMDGPU.h - MachineFunction passes hw codegen --------------*- C++ -*-=//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
/// \file
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-13 16:26:38 +00:00
|
|
|
#ifndef LLVM_LIB_TARGET_R600_AMDGPU_H
|
|
|
|
#define LLVM_LIB_TARGET_R600_AMDGPU_H
|
2012-12-11 21:25:42 +00:00
|
|
|
|
|
|
|
#include "llvm/Support/TargetRegistry.h"
|
|
|
|
#include "llvm/Target/TargetMachine.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2013-06-07 20:37:48 +00:00
|
|
|
class AMDGPUInstrPrinter;
|
2014-06-17 16:53:14 +00:00
|
|
|
class AMDGPUSubtarget;
|
2012-12-11 21:25:42 +00:00
|
|
|
class AMDGPUTargetMachine;
|
2013-06-07 20:37:48 +00:00
|
|
|
class FunctionPass;
|
|
|
|
class MCAsmInfo;
|
|
|
|
class raw_ostream;
|
|
|
|
class Target;
|
|
|
|
class TargetMachine;
|
2012-12-11 21:25:42 +00:00
|
|
|
|
|
|
|
// R600 Passes
|
2013-06-05 21:38:04 +00:00
|
|
|
FunctionPass *createR600VectorRegMerger(TargetMachine &tm);
|
2013-06-07 20:37:48 +00:00
|
|
|
FunctionPass *createR600TextureIntrinsicsReplacer();
|
2012-12-11 21:25:42 +00:00
|
|
|
FunctionPass *createR600ExpandSpecialInstrsPass(TargetMachine &tm);
|
2013-12-11 17:51:41 +00:00
|
|
|
FunctionPass *createR600EmitClauseMarkers();
|
2013-10-01 19:32:58 +00:00
|
|
|
FunctionPass *createR600ClauseMergePass(TargetMachine &tm);
|
2013-04-30 00:14:27 +00:00
|
|
|
FunctionPass *createR600Packetizer(TargetMachine &tm);
|
2013-04-01 21:48:05 +00:00
|
|
|
FunctionPass *createR600ControlFlowFinalizer(TargetMachine &tm);
|
2013-12-11 17:51:47 +00:00
|
|
|
FunctionPass *createAMDGPUCFGStructurizerPass();
|
2012-12-11 21:25:42 +00:00
|
|
|
|
|
|
|
// SI Passes
|
2013-08-14 23:24:45 +00:00
|
|
|
FunctionPass *createSITypeRewriter();
|
2012-12-19 22:10:31 +00:00
|
|
|
FunctionPass *createSIAnnotateControlFlowPass();
|
2014-11-21 22:06:37 +00:00
|
|
|
FunctionPass *createSIFoldOperandsPass();
|
2014-04-30 15:31:33 +00:00
|
|
|
FunctionPass *createSILowerI1CopiesPass();
|
2014-07-21 16:55:33 +00:00
|
|
|
FunctionPass *createSIShrinkInstructionsPass();
|
2014-10-10 22:01:59 +00:00
|
|
|
FunctionPass *createSILoadStoreOptimizerPass(TargetMachine &tm);
|
2012-12-11 21:25:42 +00:00
|
|
|
FunctionPass *createSILowerControlFlowPass(TargetMachine &tm);
|
2013-08-06 23:08:28 +00:00
|
|
|
FunctionPass *createSIFixSGPRCopiesPass(TargetMachine &tm);
|
2014-07-02 20:53:48 +00:00
|
|
|
FunctionPass *createSIFixSGPRLiveRangesPass();
|
2012-12-11 21:25:42 +00:00
|
|
|
FunctionPass *createSICodeEmitterPass(formatted_raw_ostream &OS);
|
2013-01-18 21:15:53 +00:00
|
|
|
FunctionPass *createSIInsertWaits(TargetMachine &tm);
|
2015-01-14 15:42:31 +00:00
|
|
|
FunctionPass *createSIPrepareScratchRegs();
|
2012-12-11 21:25:42 +00:00
|
|
|
|
2014-11-21 22:06:37 +00:00
|
|
|
void initializeSIFoldOperandsPass(PassRegistry &);
|
|
|
|
extern char &SIFoldOperandsID;
|
|
|
|
|
2014-04-30 15:31:33 +00:00
|
|
|
void initializeSILowerI1CopiesPass(PassRegistry &);
|
|
|
|
extern char &SILowerI1CopiesID;
|
|
|
|
|
2014-10-10 22:01:59 +00:00
|
|
|
void initializeSILoadStoreOptimizerPass(PassRegistry &);
|
|
|
|
extern char &SILoadStoreOptimizerID;
|
|
|
|
|
2012-12-11 21:25:42 +00:00
|
|
|
// Passes common to R600 and SI
|
2014-06-17 16:53:14 +00:00
|
|
|
FunctionPass *createAMDGPUPromoteAlloca(const AMDGPUSubtarget &ST);
|
2012-12-19 22:10:31 +00:00
|
|
|
Pass *createAMDGPUStructurizeCFGPass();
|
2013-06-07 20:37:48 +00:00
|
|
|
FunctionPass *createAMDGPUISelDag(TargetMachine &tm);
|
2014-11-03 19:49:05 +00:00
|
|
|
ModulePass *createAMDGPUAlwaysInlinePass();
|
2013-06-07 20:37:48 +00:00
|
|
|
|
2014-07-02 20:53:48 +00:00
|
|
|
void initializeSIFixSGPRLiveRangesPass(PassRegistry&);
|
|
|
|
extern char &SIFixSGPRLiveRangesID;
|
|
|
|
|
|
|
|
|
2013-06-07 20:37:48 +00:00
|
|
|
extern Target TheAMDGPUTarget;
|
2015-01-06 18:00:21 +00:00
|
|
|
extern Target TheGCNTarget;
|
2012-12-11 21:25:42 +00:00
|
|
|
|
2014-07-21 14:01:14 +00:00
|
|
|
namespace AMDGPU {
|
|
|
|
enum TargetIndex {
|
2015-01-20 17:49:47 +00:00
|
|
|
TI_CONSTDATA_START,
|
|
|
|
TI_SCRATCH_RSRC_DWORD0,
|
|
|
|
TI_SCRATCH_RSRC_DWORD1,
|
|
|
|
TI_SCRATCH_RSRC_DWORD2,
|
|
|
|
TI_SCRATCH_RSRC_DWORD3
|
2014-07-21 14:01:14 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#define END_OF_TEXT_LABEL_NAME "EndOfTextLabel"
|
|
|
|
|
2012-12-11 21:25:42 +00:00
|
|
|
} // End namespace llvm
|
|
|
|
|
|
|
|
namespace ShaderType {
|
|
|
|
enum Type {
|
|
|
|
PIXEL = 0,
|
|
|
|
VERTEX = 1,
|
|
|
|
GEOMETRY = 2,
|
|
|
|
COMPUTE = 3
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2013-06-07 20:37:48 +00:00
|
|
|
/// OpenCL uses address spaces to differentiate between
|
|
|
|
/// various memory regions on the hardware. On the CPU
|
|
|
|
/// all of the address spaces point to the same memory,
|
|
|
|
/// however on the GPU, each address space points to
|
2014-01-24 17:20:08 +00:00
|
|
|
/// a separate piece of memory that is unique from other
|
2013-06-07 20:37:48 +00:00
|
|
|
/// memory locations.
|
|
|
|
namespace AMDGPUAS {
|
|
|
|
enum AddressSpaces {
|
|
|
|
PRIVATE_ADDRESS = 0, ///< Address space for private memory.
|
|
|
|
GLOBAL_ADDRESS = 1, ///< Address space for global memory (RAT0, VTX0).
|
|
|
|
CONSTANT_ADDRESS = 2, ///< Address space for constant memory
|
|
|
|
LOCAL_ADDRESS = 3, ///< Address space for local memory.
|
2014-05-22 18:27:07 +00:00
|
|
|
FLAT_ADDRESS = 4, ///< Address space for flat memory.
|
|
|
|
REGION_ADDRESS = 5, ///< Address space for region memory.
|
2013-06-07 20:37:48 +00:00
|
|
|
PARAM_D_ADDRESS = 6, ///< Address space for direct addressible parameter memory (CONST0)
|
|
|
|
PARAM_I_ADDRESS = 7, ///< Address space for indirect addressible parameter memory (VTX1)
|
2013-07-23 01:48:18 +00:00
|
|
|
|
|
|
|
// Do not re-order the CONSTANT_BUFFER_* enums. Several places depend on this
|
|
|
|
// order to be able to dynamically index a constant buffer, for example:
|
|
|
|
//
|
|
|
|
// ConstantBufferAS = CONSTANT_BUFFER_0 + CBIdx
|
|
|
|
|
2013-06-07 20:37:48 +00:00
|
|
|
CONSTANT_BUFFER_0 = 8,
|
|
|
|
CONSTANT_BUFFER_1 = 9,
|
|
|
|
CONSTANT_BUFFER_2 = 10,
|
|
|
|
CONSTANT_BUFFER_3 = 11,
|
|
|
|
CONSTANT_BUFFER_4 = 12,
|
|
|
|
CONSTANT_BUFFER_5 = 13,
|
|
|
|
CONSTANT_BUFFER_6 = 14,
|
|
|
|
CONSTANT_BUFFER_7 = 15,
|
|
|
|
CONSTANT_BUFFER_8 = 16,
|
|
|
|
CONSTANT_BUFFER_9 = 17,
|
|
|
|
CONSTANT_BUFFER_10 = 18,
|
|
|
|
CONSTANT_BUFFER_11 = 19,
|
|
|
|
CONSTANT_BUFFER_12 = 20,
|
|
|
|
CONSTANT_BUFFER_13 = 21,
|
|
|
|
CONSTANT_BUFFER_14 = 22,
|
|
|
|
CONSTANT_BUFFER_15 = 23,
|
2014-05-22 18:27:07 +00:00
|
|
|
ADDRESS_NONE = 24, ///< Address space for unknown memory.
|
|
|
|
LAST_ADDRESS = ADDRESS_NONE
|
2013-06-07 20:37:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace AMDGPUAS
|
|
|
|
|
2014-08-13 16:26:38 +00:00
|
|
|
#endif
|