13#ifndef LLVM_TARGETPARSER_AMDGPUTARGETPARSER_H
14#define LLVM_TARGETPARSER_AMDGPUTARGETPARSER_H
39#define GET_R600_GPU_ENUM
40#include "llvm/TargetParser/R600TargetParserDef.inc"
42#define GET_AMDGPU_GPU_ENUM
43#include "llvm/TargetParser/AMDGPUTargetParserDef.inc"
48#define GET_AMDGPU_FEATURE_ENUM
49#include "llvm/TargetParser/AMDGPUTargetParserDef.inc"
200LLVM_ABI std::pair<FeatureError, StringRef>
208 std::string TargetTripleString;
225 return XnackSetting != TargetIDSetting::Unsupported;
230 return XnackSetting == TargetIDSetting::On ||
231 XnackSetting == TargetIDSetting::Any;
247 XnackSetting = NewXnackSetting;
252 return SramEccSetting != TargetIDSetting::Unsupported;
257 return SramEccSetting == TargetIDSetting::On ||
258 SramEccSetting == TargetIDSetting::Any;
274 SramEccSetting = NewSramEccSetting;
288 static std::optional<TargetID>
parse(
const Triple &TT,
293 static std::optional<TargetID>
294 parseTargetIDString(
StringRef TargetIDDirective);
313 void printCanonicalTargetIDString(
raw_ostream &OS)
const;
318 std::string getCanonicalFeatureString()
const;
This file defines the StringMap class.
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static llvm::Error parse(GsymDataExtractor &Data, uint64_t BaseAddr, LineEntryCallback const &Callback)
static const char * toString(MIToken::TokenKind TokenKind)
bool operator==(const MergedFunctionsInfo &LHS, const MergedFunctionsInfo &RHS)
bool isXnackSupported() const
bool isXnackOnOrOff() const
void setSramEccSetting(TargetIDSetting NewSramEccSetting)
Sets sramecc setting to NewSramEccSetting.
void print(raw_ostream &OS) const
bool isSramEccOnOrOff() const
TargetIDSetting getXnackSetting() const
bool operator!=(const TargetID &Other) const
GPUKind getGPUKind() const
bool isSramEccOnOrAny() const
StringRef getTargetTripleString() const
TargetID(GPUKind Arch, const Triple &TT, TargetIDSetting XnackSetting, TargetIDSetting SramEccSetting)
bool isXnackOnOrAny() const
bool isSramEccSupported() const
void setXnackSetting(TargetIDSetting NewXnackSetting)
Sets xnack setting to NewXnackSetting.
TargetIDSetting getSramEccSetting() const
This is a constexpr reimplementation of a subset of std::bitset.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Represent a constant reference to a string, i.e.
Triple - Helper class for working with autoconf configuration names.
This class implements an extremely fast bulk output stream that can only output to a stream.
LLVM_ABI StringRef getArchNameR600(GPUKind AK)
@ FIXED_NUM_SGPRS_FOR_INIT_BUG
LLVM_ABI void fillValidArchListAMDGCN(SmallVectorImpl< StringRef > &Values, Triple::SubArchType SubArch=Triple::NoSubArch)
Append the valid AMDGCN GPU names to Values.
LLVM_ABI StringRef getCanonicalArchName(const Triple &T, StringRef Arch)
LLVM_ABI void fillValidArchListR600(SmallVectorImpl< StringRef > &Values)
LLVM_ABI R600FeatureKind getArchAttrR600(GPUKind AK)
LLVM_ABI std::string mergeSubArch(const Triple &A, const Triple &B)
Returns the effective triple appropriate to use when linking B into A by merging the subarches in cas...
LLVM_ABI bool isCPUValidForSubArch(Triple::SubArchType SubArch, GPUKind AK)
Return true if the GPU AK is usable with the triple subarch SubArch.
LLVM_ABI bool isSubArchCompatible(const Triple &A, const Triple &B)
Return true if subarch A is compatible with subarch B, i.e.
LLVM_ABI StringRef getArchFamilyNameAMDGCN(GPUKind AK)
LLVM_ABI StringRef getSubArchName(Triple::SubArchType SubArch)
Returns the triple subarch name for an AMDGPU subarch, e.g.
LLVM_ABI unsigned getAddressableNumSGPRs(GPUKind AK)
LLVM_ABI IsaVersion getIsaVersion(StringRef GPU)
LLVM_ABI unsigned getTotalNumSGPRs(GPUKind AK)
GPUKind
GPU kinds supported by the AMDGPU target.
Bitset< NUM_FEATURES > AMDGPUFeatureBitset
LLVM_ABI unsigned getSGPRAllocGranule(GPUKind AK)
LLVM_ABI Triple::SubArchType getSubArch(GPUKind AK)
LLVM_ABI StringRef getArchNameFromSubArch(Triple::SubArchType SubArch)
Returns the canonical GPU name for an AMDGPU subarch, e.g.
LLVM_ABI GPUKind parseArchAMDGCN(StringRef CPU)
AMDGPUFeature
One enumerator per frontend-visible feature bit; NUM_FEATURES is the count.
raw_ostream & operator<<(raw_ostream &OS, const TargetID &TargetID)
LLVM_ABI bool isPseudoTarget(GPUKind AK)
Return true if AK is a pseudo target (e.g.
@ UNSUPPORTED_TARGET_FEATURE
@ INVALID_FEATURE_COMBINATION
LLVM_ABI GPUKind getGPUKindFromSubArch(Triple::SubArchType SubArch)
@ FEATURE_FAST_DENORMAL_F32
@ FEATURE_XNACK_ON_OFF_MODES
LLVM_ABI std::pair< FeatureError, StringRef > fillAMDGPUFeatureMap(StringRef GPU, const Triple &T, StringMap< bool > &Features)
Fills Features map with default values for given target GPU.
LLVM_ABI void getFeatureNames(const AMDGPUFeatureBitset &Features, SmallVectorImpl< StringRef > &Names)
Appends the feature name of each bit set in Features to Names.
LLVM_ABI StringRef getArchNameAMDGCN(GPUKind AK)
LLVM_ABI unsigned getArchAttrAMDGCN(GPUKind AK)
LLVM_ABI Triple::SubArchType getMajorSubArch(Triple::SubArchType SubArch)
LLVM_ABI const AMDGPUFeatureBitset & getFeatureBitset(GPUKind AK)
Returns AK's feature bitset, or an empty bitset if unknown.
LLVM_ABI GPUKind parseArchR600(StringRef CPU)
This is an optimization pass for GlobalISel generic memory operations.
RelativeUniformCounterPtr Values
Instruction set architecture version.
bool operator==(const IsaVersion &Other) const
bool operator!=(const IsaVersion &Other) const