blob: 57cbe1b58f98497ab94213621ca3765e6c970fc9 [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);
Marek Olsakfccabaf2016-01-13 11:45:36 +000048unsigned getInitialPSInputAddr(const Function &F);
49
Tom Stellardac00eb52015-12-15 16:26:16 +000050
Tom Stellard2b65ed32015-12-21 18:44:27 +000051bool isSI(const MCSubtargetInfo &STI);
52bool isCI(const MCSubtargetInfo &STI);
53bool isVI(const MCSubtargetInfo &STI);
54
55/// If \p Reg is a pseudo reg, return the correct hardware register given
56/// \p STI otherwise return \p Reg.
57unsigned getMCReg(unsigned Reg, const MCSubtargetInfo &STI);
58
Tom Stellard347ac792015-06-26 21:15:07 +000059} // end namespace AMDGPU
60} // end namespace llvm
61
62#endif