AMDGPU/SI: Add getShaderType() function to Utils/
[oota-llvm.git] / lib / Target / AMDGPU / Utils / AMDGPUBaseInfo.h
1 //===-- AMDGPUBaseInfo.h - Top level definitions for AMDGPU -----*- 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 //===----------------------------------------------------------------------===//
9
10 #ifndef LLVM_LIB_TARGET_AMDGPU_UTILS_AMDGPUBASEINFO_H
11 #define LLVM_LIB_TARGET_AMDGPU_UTILS_AMDGPUBASEINFO_H
12
13 #include "AMDKernelCodeT.h"
14
15 namespace llvm {
16
17 class FeatureBitset;
18 class Function;
19 class GlobalValue;
20 class MCContext;
21 class MCSection;
22
23 namespace AMDGPU {
24
25 struct IsaVersion {
26   unsigned Major;
27   unsigned Minor;
28   unsigned Stepping;
29 };
30
31 IsaVersion getIsaVersion(const FeatureBitset &Features);
32 void initDefaultAMDKernelCodeT(amd_kernel_code_t &Header,
33                                const FeatureBitset &Features);
34 MCSection *getHSATextSection(MCContext &Ctx);
35
36 MCSection *getHSADataGlobalAgentSection(MCContext &Ctx);
37
38 MCSection *getHSADataGlobalProgramSection(MCContext &Ctx);
39
40 MCSection *getHSARodataReadonlyAgentSection(MCContext &Ctx);
41
42 bool isGroupSegment(const GlobalValue *GV);
43 bool isGlobalSegment(const GlobalValue *GV);
44 bool isReadOnlySegment(const GlobalValue *GV);
45
46 unsigned getShaderType(const Function &F);
47
48 } // end namespace AMDGPU
49 } // end namespace llvm
50
51 #endif