LLVM 24.0.0git
llvm::NVPTX Namespace Reference

Namespaces

namespace  PTXCmpMode
 PTXCmpMode - Comparison mode enumeration.
namespace  PTXCvtMode
 PTXCvtMode - Conversion code enumeration.
namespace  PTXLdStInstCode
namespace  PTXPrmtMode

Typedefs

using OrderingUnderlyingType = unsigned int
using ScopeUnderlyingType = unsigned int
using AddressSpaceUnderlyingType = unsigned int
using L1EvictionBits
using L2EvictionBits = Bitfield::Element<L2Eviction, 3, 2, L2Eviction::Last>
using L2PrefetchBits
using L2CacheHintBit = Bitfield::Element<bool, 7, 1>

Enumerations

enum  GPUKind : uint8_t { GK_NONE = 0 , GK_LAST = GK_SM_121f }
 GPU kinds supported by the NVPTX target. More...
enum class  ArchSuffix { NONE , ACCELERATED , FAMILY }
 Suffix class of an NVPTX architecture name. More...
enum class  VirtualRegisterKind : unsigned {
  Physical = 0 , B1 = 1 , B16 = 2 , B32 = 3 ,
  B64 = 4 , B128 = 5
}
enum  DrvInterface { NVCL , CUDA }
enum  VecInstType {
  VecInstTypeShift = 0 , VecInstTypeMask = 0xF , VecNOP = 0 , VecLoad = 1 ,
  VecStore = 2 , VecBuild = 3 , VecShuffle = 4 , VecExtract = 5 ,
  VecInsert = 6 , VecDest = 7 , VecOther = 15
}
enum  SimpleMove { SimpleMoveMask = 0x10 , SimpleMoveShift = 4 }
enum  LoadStore { isLoadMask = 0x20 , isLoadShift = 5 , isStoreMask = 0x40 , isStoreShift = 6 }
enum  Ordering : OrderingUnderlyingType {
  NotAtomic , Relaxed = (OrderingUnderlyingType)AtomicOrdering::Monotonic , Acquire = (OrderingUnderlyingType)AtomicOrdering::Acquire , Release = (OrderingUnderlyingType)AtomicOrdering::Release ,
  AcquireRelease = (OrderingUnderlyingType)AtomicOrdering::AcquireRelease , SequentiallyConsistent , Volatile = SequentiallyConsistent + 1 , RelaxedMMIO = Volatile + 1
}
enum  Scope : ScopeUnderlyingType {
  Thread = 0 , Block = 1 , Cluster = 2 , Device = 3 ,
  System = 4 , DefaultDevice = 5 , LASTSCOPE = DefaultDevice
}
enum  AddressSpace : AddressSpaceUnderlyingType {
  Generic = NVPTXAS::ADDRESS_SPACE_GENERIC , Global = NVPTXAS::ADDRESS_SPACE_GLOBAL , Shared = NVPTXAS::ADDRESS_SPACE_SHARED , Const = NVPTXAS::ADDRESS_SPACE_CONST ,
  Local = NVPTXAS::ADDRESS_SPACE_LOCAL , SharedCluster = NVPTXAS::ADDRESS_SPACE_SHARED_CLUSTER , EntryParam = NVPTXAS::ADDRESS_SPACE_ENTRY_PARAM , DeviceParam
}
enum class  L1Eviction : uint8_t {
  Normal = 0 , Unchanged = 1 , First = 2 , Last = 3 ,
  NoAllocate = 4
}
enum class  L2Eviction : uint8_t { Normal = 0 , First = 1 , Last = 2 }
enum class  L2Prefetch : uint8_t { None = 0 , Bytes64 = 1 , Bytes128 = 2 , Bytes256 = 3 }
enum class  DivPrecisionLevel : unsigned { Approx = 0 , Full = 1 , IEEE754 = 2 , IEEE754_NoFTZ = 3 }

Functions

LLVM_ABI GPUKind parseArch (StringRef CPU)
 Parse CPU (e.g. "sm_90") into a GPUKind, or GK_NONE if unrecognized.
LLVM_ABI StringRef getArchName (GPUKind Kind)
 Return the canonical processor name (e.g.
LLVM_ABI StringRef getVirtualArch (GPUKind Kind)
 Return the virtual (compute_) arch name (e.g.
LLVM_ABI unsigned getSmVersion (GPUKind Kind)
 Return the numeric compute-capability id (e.g.
LLVM_ABI ArchSuffix getArchSuffix (GPUKind Kind)
 Return the suffix class of Kind.
bool isAcceleratedArch (GPUKind Kind)
 Whether Kind is an accelerated variant (e.g. sm_90a).
bool isFamilySpecificArch (GPUKind Kind)
 Whether Kind is a family-specific variant (e.g. sm_90f) or accelerated.
bool supportsUnifiedAddressing (GPUKind Kind)
 Whether Kind supports unified addressing.
StringRef getVirtualRegisterPrefix (VirtualRegisterKind Kind)
 The name prefix shared by all virtual registers of Kind.
unsigned encodeEvictionAndPrefetchHint (L1Eviction L1, L2Eviction L2, L2Prefetch P)
L1Eviction decodeL1Eviction (unsigned Hint)
L2Eviction decodeL2Eviction (unsigned Hint)
L2Prefetch decodeL2Prefetch (unsigned Hint)
bool isL2CacheHintMode (unsigned Hint)
auto packed_types ()
bool isPackedVectorTy (EVT VT)
bool isPackedElementTy (EVT ET)
std::string getValidPTXIdentifier (StringRef Name)
std::string OrderingToString (Ordering Order)
raw_ostreamoperator<< (raw_ostream &O, Ordering Order)
std::string ScopeToString (Scope S)
raw_ostreamoperator<< (raw_ostream &O, Scope S)
const charaddressSpaceToString (AddressSpace A, bool UseParamSubqualifiers=false)
raw_ostreamoperator<< (raw_ostream &O, AddressSpace A)

Variables

constexpr unsigned VirtualRegisterKindShift = 27
constexpr unsigned VirtualRegisterNumMask

Typedef Documentation

◆ AddressSpaceUnderlyingType

Definition at line 296 of file NVPTX.h.

◆ L1EvictionBits

Initial value:

Definition at line 348 of file NVPTX.h.

◆ L2CacheHintBit

Definition at line 353 of file NVPTX.h.

◆ L2EvictionBits

◆ L2PrefetchBits

◆ OrderingUnderlyingType

Definition at line 269 of file NVPTX.h.

◆ ScopeUnderlyingType

Definition at line 285 of file NVPTX.h.

Enumeration Type Documentation

◆ AddressSpace

Enumerator
Generic 
Global 
Shared 
Const 
Local 
SharedCluster 
EntryParam 
DeviceParam 

Definition at line 297 of file NVPTX.h.

◆ ArchSuffix

enum class llvm::NVPTX::ArchSuffix
strong

Suffix class of an NVPTX architecture name.

Enumerator spellings match the SUFFIX column tokens in NVPTXTargetParser.def.

Enumerator
NONE 
ACCELERATED 
FAMILY 

Definition at line 33 of file NVPTXTargetParser.h.

◆ DivPrecisionLevel

Enumerator
Approx 
Full 
IEEE754 
IEEE754_NoFTZ 

Definition at line 440 of file NVPTX.h.

◆ DrvInterface

Enumerator
NVCL 
CUDA 

Definition at line 232 of file NVPTX.h.

◆ GPUKind

GPU kinds supported by the NVPTX target.

Enumerator
GK_NONE 
GK_LAST 

Definition at line 20 of file NVPTXTargetParser.h.

◆ L1Eviction

enum class llvm::NVPTX::L1Eviction : uint8_t
strong
Enumerator
Normal 
Unchanged 
First 
Last 
NoAllocate 

Definition at line 317 of file NVPTX.h.

◆ L2Eviction

enum class llvm::NVPTX::L2Eviction : uint8_t
strong
Enumerator
Normal 
First 
Last 

Definition at line 326 of file NVPTX.h.

◆ L2Prefetch

enum class llvm::NVPTX::L2Prefetch : uint8_t
strong
Enumerator
None 
Bytes64 
Bytes128 
Bytes256 

Definition at line 333 of file NVPTX.h.

◆ LoadStore

Enumerator
isLoadMask 
isLoadShift 
isStoreMask 
isStoreShift 

Definition at line 261 of file NVPTX.h.

◆ Ordering

Enumerator
NotAtomic 
Relaxed 
Acquire 
Release 
AcquireRelease 
SequentiallyConsistent 
Volatile 
RelaxedMMIO 

Definition at line 270 of file NVPTX.h.

◆ Scope

Enumerator
Thread 
Block 
Cluster 
Device 
System 
DefaultDevice 
LASTSCOPE 

Definition at line 286 of file NVPTX.h.

◆ SimpleMove

Enumerator
SimpleMoveMask 
SimpleMoveShift 

Definition at line 257 of file NVPTX.h.

◆ VecInstType

Enumerator
VecInstTypeShift 
VecInstTypeMask 
VecNOP 
VecLoad 
VecStore 
VecBuild 
VecShuffle 
VecExtract 
VecInsert 
VecDest 
VecOther 

Definition at line 242 of file NVPTX.h.

◆ VirtualRegisterKind

Enumerator
Physical 
B1 
B16 
B32 
B64 
B128 

Definition at line 32 of file NVPTXBaseInfo.h.

Function Documentation

◆ addressSpaceToString()

const char * llvm::NVPTX::addressSpaceToString ( AddressSpace A,
bool UseParamSubqualifiers = false )
inline

◆ decodeL1Eviction()

L1Eviction llvm::NVPTX::decodeL1Eviction ( unsigned Hint)
inline

Definition at line 364 of file NVPTX.h.

References llvm::Bitfield::get().

Referenced by llvm::NVPTXInstPrinter::printEvictionAndPrefetchHint().

◆ decodeL2Eviction()

L2Eviction llvm::NVPTX::decodeL2Eviction ( unsigned Hint)
inline

Definition at line 368 of file NVPTX.h.

References llvm::Bitfield::get().

Referenced by llvm::NVPTXInstPrinter::printEvictionAndPrefetchHint().

◆ decodeL2Prefetch()

L2Prefetch llvm::NVPTX::decodeL2Prefetch ( unsigned Hint)
inline

Definition at line 372 of file NVPTX.h.

References llvm::Bitfield::get().

Referenced by llvm::NVPTXInstPrinter::printEvictionAndPrefetchHint().

◆ encodeEvictionAndPrefetchHint()

unsigned llvm::NVPTX::encodeEvictionAndPrefetchHint ( L1Eviction L1,
L2Eviction L2,
L2Prefetch P )
inline

Definition at line 355 of file NVPTX.h.

References P, and llvm::Bitfield::set().

◆ getArchName()

StringRef llvm::NVPTX::getArchName ( GPUKind Kind)

Return the canonical processor name (e.g.

"sm_90") for Kind, or "" if Kind is GK_NONE.

Definition at line 27 of file NVPTXTargetParser.cpp.

References GK_NONE, and llvm_unreachable.

Referenced by llvm::NVPTXSubtarget::getTargetName().

◆ getArchSuffix()

ArchSuffix llvm::NVPTX::getArchSuffix ( GPUKind Kind)

Return the suffix class of Kind.

Definition at line 63 of file NVPTXTargetParser.cpp.

References GK_NONE, llvm_unreachable, and NONE.

Referenced by isAcceleratedArch(), and isFamilySpecificArch().

◆ getSmVersion()

unsigned llvm::NVPTX::getSmVersion ( GPUKind Kind)

Return the numeric compute-capability id (e.g.

sm_90 -> 900) for Kind, or 0 if Kind is GK_NONE.

Definition at line 51 of file NVPTXTargetParser.cpp.

References GK_NONE, and llvm_unreachable.

Referenced by llvm::NVPTXSubtarget::getSmVersion(), and supportsUnifiedAddressing().

◆ getValidPTXIdentifier()

std::string llvm::NVPTX::getValidPTXIdentifier ( StringRef Name)
inline

Definition at line 97 of file NVPTXUtilities.h.

References C(), and llvm::isAlnum().

Referenced by assignValidName(), and llvm::NVPTXTargetStreamer::emitValue().

◆ getVirtualArch()

StringRef llvm::NVPTX::getVirtualArch ( GPUKind Kind)

Return the virtual (compute_) arch name (e.g.

"compute_90") for Kind, or "" if Kind is GK_NONE.

Definition at line 39 of file NVPTXTargetParser.cpp.

References GK_NONE, and llvm_unreachable.

◆ getVirtualRegisterPrefix()

StringRef llvm::NVPTX::getVirtualRegisterPrefix ( VirtualRegisterKind Kind)
inline

The name prefix shared by all virtual registers of Kind.

Definition at line 53 of file NVPTXBaseInfo.h.

References B1, B128, B16, B32, B64, llvm_unreachable, and Physical.

Referenced by llvm::NVPTXInstPrinter::printRegName().

◆ isAcceleratedArch()

bool llvm::NVPTX::isAcceleratedArch ( GPUKind Kind)
inline

Whether Kind is an accelerated variant (e.g. sm_90a).

Definition at line 54 of file NVPTXTargetParser.h.

References ACCELERATED, and getArchSuffix().

◆ isFamilySpecificArch()

bool llvm::NVPTX::isFamilySpecificArch ( GPUKind Kind)
inline

Whether Kind is a family-specific variant (e.g. sm_90f) or accelerated.

Definition at line 59 of file NVPTXTargetParser.h.

References ACCELERATED, FAMILY, and getArchSuffix().

◆ isL2CacheHintMode()

bool llvm::NVPTX::isL2CacheHintMode ( unsigned Hint)
inline

Definition at line 376 of file NVPTX.h.

References llvm::Bitfield::get().

Referenced by llvm::NVPTXInstPrinter::printEvictionAndPrefetchHint().

◆ isPackedElementTy()

bool llvm::NVPTX::isPackedElementTy ( EVT ET)
inline

◆ isPackedVectorTy()

bool llvm::NVPTX::isPackedVectorTy ( EVT VT)
inline

◆ operator<<() [1/3]

raw_ostream & llvm::NVPTX::operator<< ( raw_ostream & O,
AddressSpace A )
inline

Definition at line 187 of file NVPTXUtilities.h.

References A(), and addressSpaceToString().

◆ operator<<() [2/3]

raw_ostream & llvm::NVPTX::operator<< ( raw_ostream & O,
Ordering Order )
inline

Definition at line 134 of file NVPTXUtilities.h.

References OrderingToString().

◆ operator<<() [3/3]

raw_ostream & llvm::NVPTX::operator<< ( raw_ostream & O,
Scope S )
inline

Definition at line 158 of file NVPTXUtilities.h.

References ScopeToString().

◆ OrderingToString()

std::string llvm::NVPTX::OrderingToString ( Ordering Order)
inline

◆ packed_types()

auto llvm::NVPTX::packed_types ( )
inline

Definition at line 80 of file NVPTXUtilities.h.

Referenced by isPackedElementTy(), and isPackedVectorTy().

◆ parseArch()

GPUKind llvm::NVPTX::parseArch ( StringRef CPU)

Parse CPU (e.g. "sm_90") into a GPUKind, or GK_NONE if unrecognized.

Definition at line 19 of file NVPTXTargetParser.cpp.

References llvm::StringSwitch< T, R >::Default(), and GK_NONE.

Referenced by llvm::NVPTXSubtarget::initializeSubtargetDependencies().

◆ ScopeToString()

std::string llvm::NVPTX::ScopeToString ( Scope S)
inline

Definition at line 139 of file NVPTXUtilities.h.

References Block, Cluster, DefaultDevice, Device, llvm::formatv(), llvm::report_fatal_error(), System, and Thread.

Referenced by operator<<().

◆ supportsUnifiedAddressing()

bool llvm::NVPTX::supportsUnifiedAddressing ( GPUKind Kind)
inline

Whether Kind supports unified addressing.

Unified addressing was introduced with the Pascal generation (sm_60).

Definition at line 66 of file NVPTXTargetParser.h.

References getSmVersion().

Variable Documentation

◆ VirtualRegisterKindShift

unsigned llvm::NVPTX::VirtualRegisterKindShift = 27
constexpr

Definition at line 41 of file NVPTXBaseInfo.h.

Referenced by llvm::NVPTXInstPrinter::printRegName().

◆ VirtualRegisterNumMask

unsigned llvm::NVPTX::VirtualRegisterNumMask
constexpr
Initial value:
=
constexpr unsigned VirtualRegisterKindShift

Definition at line 42 of file NVPTXBaseInfo.h.

Referenced by llvm::NVPTXInstPrinter::printRegName().