|
LLVM 24.0.0git
|
#include "llvm/TargetParser/AMDGPUTargetParser.h"
Public Member Functions | |
| TargetID (GPUKind Arch, const Triple &TT, TargetIDSetting XnackSetting, TargetIDSetting SramEccSetting) | |
| TargetID (const Triple &TT, StringRef TargetIDStr) | |
Construct a TargetID from a triple TT and the processor+features string e.g. | |
| ~TargetID ()=default | |
| bool | isXnackSupported () const |
| bool | isXnackOnOrAny () const |
| bool | isXnackOnOrOff () const |
| TargetIDSetting | getXnackSetting () const |
| void | setXnackSetting (TargetIDSetting NewXnackSetting) |
Sets xnack setting to NewXnackSetting. | |
| bool | isSramEccSupported () const |
| bool | isSramEccOnOrAny () const |
| bool | isSramEccOnOrOff () const |
| TargetIDSetting | getSramEccSetting () const |
| void | setSramEccSetting (TargetIDSetting NewSramEccSetting) |
Sets sramecc setting to NewSramEccSetting. | |
| GPUKind | getGPUKind () const |
| StringRef | getTargetTripleString () const |
| bool | isAMDHSA () const |
| bool | isEquivalent (const TargetID &Other) const |
Returns true if Other denotes the same target as *this, i.e. | |
| bool | providesFor (const TargetID &Other) const |
Returns true if a device image for *this can provide the device code for a request for Other. | |
| void | print (raw_ostream &OS) const |
| std::string | toString () const |
| void | printCanonicalTargetIDString (raw_ostream &OS) const |
| Print the canonical processor name followed by any explicit xnack and sramecc feature modifiers (e.g. | |
| std::string | getCanonicalFeatureString () const |
| bool | operator== (const TargetID &Other) const |
| bool | operator!= (const TargetID &Other) const |
Static Public Member Functions | |
| static std::optional< TargetID > | parse (const Triple &TT, StringRef ProcAndFeatures) |
Parse and validate a TargetID for triple TT from the processor+features string ProcAndFeatures (e.g. | |
| static std::optional< TargetID > | parseTargetIDString (StringRef TargetIDDirective) |
| Parse and validate a TargetID from a full "<triple>-<processor>:<features>" directive string. | |
| static TargetID | createFromSubtargetFeatures (const Triple &TT, StringRef CPU, StringRef FeatureString) |
Construct a TargetID for triple TT and processor CPU, taking the xnack/sramecc modes from the subtarget FeatureString (a comma-separated "+xnack,-sramecc" list). | |
Definition at line 296 of file AMDGPUTargetParser.h.
| TargetID::TargetID | ( | GPUKind | Arch, |
| const Triple & | TT, | ||
| TargetIDSetting | XnackSetting, | ||
| TargetIDSetting | SramEccSetting ) |
Definition at line 768 of file AMDGPUTargetParser.cpp.
Referenced by createFromSubtargetFeatures(), isEquivalent(), operator!=(), operator==(), providesFor(), and TargetID().
Construct a TargetID from a triple TT and the processor+features string e.g.
"gfx90a", "gfx90a:xnack+:sramecc-", "".
Definition at line 863 of file AMDGPUTargetParser.cpp.
References computeTargetIDFeatures(), getGPUKindFromTargetID(), TargetID(), and llvm::AMDGPU::Unsupported.
|
default |
|
static |
Construct a TargetID for triple TT and processor CPU, taking the xnack/sramecc modes from the subtarget FeatureString (a comma-separated "+xnack,-sramecc" list).
Unspecified modes keep the processor's default. The assembler uses this because it has no target directive to carry the mode.
Definition at line 871 of file AMDGPUTargetParser.cpp.
References getDefaultTargetIDFeatures(), getTargetIDSettingFromFeatureString(), llvm::AMDGPU::parseArchAMDGCN(), Sign, llvm::StringRef::split(), and TargetID().
Referenced by llvm::AMDGPU::createAMDGPUTargetID().
| std::string TargetID::getCanonicalFeatureString | ( | ) | const |
Definition at line 997 of file AMDGPUTargetParser.cpp.
References printCanonicalTargetIDString().
|
inline |
Definition at line 368 of file AMDGPUTargetParser.h.
Referenced by createOccupancy().
|
inline |
Definition at line 361 of file AMDGPUTargetParser.h.
Referenced by isSramEccOnOrOff(), print(), and printCanonicalTargetIDString().
|
inline |
Definition at line 370 of file AMDGPUTargetParser.h.
Referenced by isEquivalent(), and providesFor().
|
inline |
Definition at line 334 of file AMDGPUTargetParser.h.
Referenced by isXnackOnOrOff(), print(), and printCanonicalTargetIDString().
|
inline |
Definition at line 373 of file AMDGPUTargetParser.h.
Returns true if Other denotes the same target as *this, i.e.
the same processor and xnack/sramecc settings on a compatible triple. This is a semantic equality that looks through spelling differences.
Definition at line 1016 of file AMDGPUTargetParser.cpp.
References getTargetTripleString(), llvm::Triple::isCompatibleWith(), llvm::AMDGPU::Other, and TargetID().
Referenced by llvm::object::areTargetsEquivalent().
|
inline |
Definition at line 347 of file AMDGPUTargetParser.h.
|
inline |
Definition at line 354 of file AMDGPUTargetParser.h.
References getSramEccSetting().
|
inline |
Definition at line 342 of file AMDGPUTargetParser.h.
|
inline |
Definition at line 320 of file AMDGPUTargetParser.h.
Referenced by llvm::AMDGPUAsmPrinter::runOnMachineFunction().
|
inline |
Definition at line 327 of file AMDGPUTargetParser.h.
References getXnackSetting().
|
inline |
Definition at line 315 of file AMDGPUTargetParser.h.
Definition at line 420 of file AMDGPUTargetParser.h.
References llvm::AMDGPU::Other, and TargetID().
Definition at line 1004 of file AMDGPUTargetParser.cpp.
References llvm::AMDGPU::Other, and TargetID().
Parse and validate a TargetID for triple TT from the processor+features string ProcAndFeatures (e.g.
"gfx90a", "gfx90a:xnack+:sramecc-", ""). Returns std::nullopt if the triple is not AMDGCN, the processor is unrecognized, or a feature modifier is invalid for the processor.
Definition at line 898 of file AMDGPUTargetParser.cpp.
References computeTargetIDFeatures(), llvm::StringRef::empty(), getGPUKindFromTargetID(), llvm::AMDGPU::isCPUValidForSubArch(), llvm::Triple::NoSubArch, and llvm::StringRef::split().
Referenced by parseTargetIDString().
Parse and validate a TargetID from a full "<triple>-<processor>:<features>" directive string.
Definition at line 927 of file AMDGPUTargetParser.cpp.
References parse(), llvm::SmallVectorTemplateCommon< T, typename >::size(), and llvm::StringRef::split().
| void TargetID::print | ( | raw_ostream & | OS | ) | const |
Definition at line 975 of file AMDGPUTargetParser.cpp.
References llvm::AMDGPU::getArchNameAMDGCN(), getSramEccSetting(), getXnackSetting(), isSramEccHardwiredOn(), isXnackHardwiredOn(), and printFeatureModifiers().
Referenced by llvm::AMDGPU::operator<<().
| void TargetID::printCanonicalTargetIDString | ( | raw_ostream & | OS | ) | const |
Print the canonical processor name followed by any explicit xnack and sramecc feature modifiers (e.g.
"gfx908:sramecc-:xnack+"), without the triple prefix.
Definition at line 991 of file AMDGPUTargetParser.cpp.
References llvm::AMDGPU::getArchNameAMDGCN(), getSramEccSetting(), getXnackSetting(), isSramEccHardwiredOn(), isXnackHardwiredOn(), and printFeatureModifiers().
Referenced by getCanonicalFeatureString().
Returns true if a device image for *this can provide the device code for a request for Other.
This is directional and models logical-linking compatibility.
Definition at line 1026 of file AMDGPUTargetParser.cpp.
References featureProvidesFor(), llvm::AMDGPU::getMajorSubArch(), llvm::AMDGPU::getSubArch(), getTargetTripleString(), llvm::AMDGPU::GK_NONE, llvm::Triple::isCompatibleWith(), llvm::AMDGPU::Other, and TargetID().
Referenced by llvm::object::areTargetsCompatible().
|
inline |
Sets sramecc setting to NewSramEccSetting.
Definition at line 364 of file AMDGPUTargetParser.h.
|
inline |
Sets xnack setting to NewXnackSetting.
Definition at line 337 of file AMDGPUTargetParser.h.
| std::string TargetID::toString | ( | ) | const |
Definition at line 984 of file AMDGPUTargetParser.cpp.
Referenced by llvm::AMDGPU::HSAMD::MetadataStreamerMsgPackV4::emitTargetID().