blob: 19419a29f5e0c2c8e80c3f47520f310cb41636b6 [file] [log] [blame]
Tom Stellard347ac792015-06-26 21:15:07 +00001//===-- 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
15namespace llvm {
16
17class FeatureBitset;
Tom Stellardac00eb52015-12-15 16:26:16 +000018class Function;
Tom Stellarde3b5aea2015-12-02 17:00:42 +000019class GlobalValue;
Tom Stellarde135ffd2015-09-25 21:41:28 +000020class MCContext;
21class MCSection;
Tom Stellard2b65ed32015-12-21 18:44:27 +000022class MCSubtargetInfo;
Tom Stellard347ac792015-06-26 21:15:07 +000023
24namespace AMDGPU {
25
26struct IsaVersion {
27 unsigned Major;
28 unsigned Minor;
29 unsigned Stepping;
30};
31
32IsaVersion getIsaVersion(const FeatureBitset &Features);
Tom Stellardff7416b2015-06-26 21:58:31 +000033void initDefaultAMDKernelCodeT(amd_kernel_code_t &Header,
34 const FeatureBitset &Features);
Tom Stellarde135ffd2015-09-25 21:41:28 +000035MCSection *getHSATextSection(MCContext &Ctx);
Tom Stellard347ac792015-06-26 21:15:07 +000036
Tom Stellard00f2f912015-12-02 19:47:57 +000037MCSection *getHSADataGlobalAgentSection(MCContext &Ctx);
38
39MCSection *getHSADataGlobalProgramSection(MCContext &Ctx);
40
Tom Stellard9760f032015-12-03 03:34:32 +000041MCSection *getHSARodataReadonlyAgentSection(MCContext &Ctx);
42
Tom Stellarde3b5aea2015-12-02 17:00:42 +000043bool isGroupSegment(const GlobalValue *GV);
Tom Stellard00f2f912015-12-02 19:47:57 +000044bool isGlobalSegment(const GlobalValue *GV);
45bool isReadOnlySegment(const GlobalValue *GV);
Tom Stellarde3b5aea2015-12-02 17:00:42 +000046
Tom Stellardac00eb52015-12-15 16:26:16 +000047unsigned getShaderType(const Function &F);
48
Tom Stellard2b65ed32015-12-21 18:44:27 +000049bool isSI(const MCSubtargetInfo &STI);
50bool isCI(const MCSubtargetInfo &STI);
51bool isVI(const MCSubtargetInfo &STI);
52
53/// If \p Reg is a pseudo reg, return the correct hardware register given
54/// \p STI otherwise return \p Reg.
55unsigned getMCReg(unsigned Reg, const MCSubtargetInfo &STI);
56
Tom Stellard347ac792015-06-26 21:15:07 +000057} // end namespace AMDGPU
58} // end namespace llvm
59
60#endif