LLVM: lib/Target/SPIRV/SPIRVSubtarget.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_LIB_TARGET_SPIRV_SPIRVSUBTARGET_H
14#define LLVM_LIB_TARGET_SPIRV_SPIRVSUBTARGET_H
15
30
31#define GET_SUBTARGETINFO_HEADER
32#include "SPIRVGenSubtargetInfo.inc"
33
34namespace llvm {
35class StringRef;
36class SPIRVTargetMachine;
37
39public:
40
42
43private:
44 const unsigned PointerSize;
47
50 std::unique_ptr GR;
51
56 SPIRVEnvType Env;
57
58
59 std::unique_ptr CallLoweringInfo;
60 std::unique_ptr RegBankInfo;
61 std::unique_ptr Legalizer;
62 std::unique_ptr InstSelector;
63 std::unique_ptr InlineAsmInfo;
64
65
66
67 void initAvailableExtInstSets();
68 void accountForAMDShaderTrinaryMinmax();
69
70public:
71
72
76
78 const std::setSPIRV::Extension::Extension &AllowedExtIds);
79
80
81
84 unsigned getBound() const { return GR->getBound(); }
108
113 return AvailableExtensions;
114 }
116 bool canUseExtInstSet(SPIRV::InstructionSet::InstructionSet E) const;
118
120
122 return CallLoweringInfo.get();
123 }
125 return RegBankInfo.get();
126 }
128 return Legalizer.get();
129 }
131 return InstSelector.get();
132 }
134 return InlineAsmInfo.get();
135 }
138 return &FrameLowering;
139 }
141 return &TLInfo;
142 }
144 return &InstrInfo.getRegisterInfo();
145 }
146
148 return ST->getTargetTriple().isSPIRV();
149 }
150
152
153
154
155
156 static void
157 addExtensionsToClOpt(const std::setSPIRV::Extension::Extension &AllowList);
158};
159}
160
161#endif
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This file describes how to lower LLVM calls to machine code calls.
Interface for Targets to specify which operations they can successfully select and how the others sho...
This file defines the SmallSet class.
Holds all the information related to register banks.
Definition SPIRVSubtarget.h:38
unsigned getPointerSize() const
Definition SPIRVSubtarget.h:83
bool hasOpenCLImageSupport() const
Definition SPIRVSubtarget.h:110
bool isShader() const
Definition SPIRVSubtarget.h:96
SPIRVSubtarget & initSubtargetDependencies(StringRef CPU, StringRef FS)
static void addExtensionsToClOpt(const std::set< SPIRV::Extension::Extension > &AllowList)
bool isPhysicalSPIRV() const
Definition SPIRVSubtarget.h:100
InstructionSelector * getInstructionSelector() const override
Definition SPIRVSubtarget.h:130
const LegalizerInfo * getLegalizerInfo() const override
Definition SPIRVSubtarget.h:127
bool canDirectlyComparePointers() const
const SPIRVInstrInfo * getInstrInfo() const override
Definition SPIRVSubtarget.h:136
const SmallSet< SPIRV::Extension::Extension, 4 > & getAllAvailableExtensions() const
Definition SPIRVSubtarget.h:112
const std::string & getTargetTripleAsStr() const
Definition SPIRVSubtarget.h:104
bool isAtLeastSPIRVVer(VersionTuple VerToCompareTo) const
static bool classof(const TargetSubtargetInfo *ST)
Definition SPIRVSubtarget.h:147
static constexpr unsigned MaxLegalAddressSpace
Definition SPIRVSubtarget.h:151
SPIRVGlobalRegistry * getSPIRVGlobalRegistry() const
Definition SPIRVSubtarget.h:119
const SPIRVRegisterInfo * getRegisterInfo() const override
Definition SPIRVSubtarget.h:143
bool isAtLeastOpenCLVer(VersionTuple VerToCompareTo) const
const SPIRVTargetLowering * getTargetLowering() const override
Definition SPIRVSubtarget.h:140
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
bool canUseExtInstSet(SPIRV::InstructionSet::InstructionSet E) const
SPIRVEnvType
Definition SPIRVSubtarget.h:41
@ Shader
Definition SPIRVSubtarget.h:41
@ Kernel
Definition SPIRVSubtarget.h:41
@ Unknown
Definition SPIRVSubtarget.h:41
void initAvailableExtensions(const std::set< SPIRV::Extension::Extension > &AllowedExtIds)
const RegisterBankInfo * getRegBankInfo() const override
Definition SPIRVSubtarget.h:124
const CallLowering * getCallLowering() const override
Definition SPIRVSubtarget.h:121
SPIRVSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS, const SPIRVTargetMachine &TM)
bool isLogicalSPIRV() const
Definition SPIRVSubtarget.h:97
const InlineAsmLowering * getInlineAsmLowering() const override
Definition SPIRVSubtarget.h:133
SPIRV::InstructionSet::InstructionSet getPreferredInstructionSet() const
VersionTuple getSPIRVVersion() const
Definition SPIRVSubtarget.h:105
unsigned getBound() const
Definition SPIRVSubtarget.h:84
bool isKernel() const
Definition SPIRVSubtarget.h:95
SPIRVEnvType getEnv() const
Definition SPIRVSubtarget.h:94
bool hasOpenCLFullProfile() const
Definition SPIRVSubtarget.h:109
bool canUseExtension(SPIRV::Extension::Extension E) const
void setEnv(SPIRVEnvType E)
Definition SPIRVSubtarget.h:86
const SPIRVFrameLowering * getFrameLowering() const override
Definition SPIRVSubtarget.h:137
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
StringRef - Represent a constant reference to a string, i.e.
TargetSubtargetInfo - Generic base class for all target subtargets.
Triple - Helper class for working with autoconf configuration names.
Represents a version number in the form major[.minor[.subminor[.build]]].
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)