13#ifndef LLVM_LIB_TARGET_SPIRV_SPIRVSUBTARGET_H
14#define LLVM_LIB_TARGET_SPIRV_SPIRVSUBTARGET_H
32#define GET_SUBTARGETINFO_HEADER
33#include "SPIRVGenSubtargetInfo.inc"
37class SPIRVTargetMachine;
45 const unsigned PointerSize;
51 std::unique_ptr<SPIRVGlobalRegistry> GR;
60 std::unique_ptr<CallLowering> CallLoweringInfo;
61 std::unique_ptr<RegisterBankInfo> RegBankInfo;
63 std::unique_ptr<InstructionSelector> InstSelector;
64 std::unique_ptr<InlineAsmLowering> InlineAsmInfo;
66 void initAvailableExtInstSets();
67 void accountForAMDShaderTrinaryMinmax();
77 const std::set<SPIRV::Extension::Extension> &AllowedExtIds);
84 unsigned getBound()
const {
return GR->getBound(); }
106 return AvailableExtensions;
115 return CallLoweringInfo.get();
118 return RegBankInfo.get();
121 return Legalizer.get();
124 return InstSelector.get();
127 return InlineAsmInfo.get();
131 return &FrameLowering;
137 return &InstrInfo.getRegisterInfo();
141 return ST->getTargetTriple().isSPIRV();
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This file describes how to lower LLVM calls to machine code calls.
Module.h This file contains the declarations for the Module class.
Interface for Targets to specify which operations they can successfully select and how the others sho...
This file defines the SmallSet class.
A Module instance is used to store all the information related to an LLVM module.
Holds all the information related to register banks.
unsigned getPointerSize() const
bool hasOpenCLImageSupport() const
SPIRVSubtarget & initSubtargetDependencies(StringRef CPU, StringRef FS)
static void addExtensionsToClOpt(const std::set< SPIRV::Extension::Extension > &AllowList)
bool isPhysicalSPIRV() const
InstructionSelector * getInstructionSelector() const override
const LegalizerInfo * getLegalizerInfo() const override
bool canDirectlyComparePointers() const
const SPIRVInstrInfo * getInstrInfo() const override
const SmallSet< SPIRV::Extension::Extension, 4 > & getAllAvailableExtensions() const
const std::string & getTargetTripleAsStr() const
bool isAtLeastSPIRVVer(VersionTuple VerToCompareTo) const
static bool classof(const TargetSubtargetInfo *ST)
static constexpr unsigned MaxLegalAddressSpace
SPIRVGlobalRegistry * getSPIRVGlobalRegistry() const
void resolveEnvFromModule(const Module &M)
const SPIRVRegisterInfo * getRegisterInfo() const override
bool isAtLeastOpenCLVer(VersionTuple VerToCompareTo) const
const SPIRVTargetLowering * getTargetLowering() const override
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
bool canUseExtInstSet(SPIRV::InstructionSet::InstructionSet E) const
void initAvailableExtensions(const std::set< SPIRV::Extension::Extension > &AllowedExtIds)
const RegisterBankInfo * getRegBankInfo() const override
const CallLowering * getCallLowering() const override
SPIRVSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS, const SPIRVTargetMachine &TM)
bool isLogicalSPIRV() const
const InlineAsmLowering * getInlineAsmLowering() const override
SPIRV::InstructionSet::InstructionSet getPreferredInstructionSet() const
VersionTuple getSPIRVVersion() const
unsigned getBound() const
SPIRVEnvType getEnv() const
bool hasOpenCLFullProfile() const
bool canUseExtension(SPIRV::Extension::Extension E) const
void setEnv(SPIRVEnvType E)
const SPIRVFrameLowering * getFrameLowering() const override
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.