LLVM 24.0.0git
NVPTXISelDAGToDAG.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "nvptx-isel"
#define PASS_NAME   "NVPTX DAG->DAG Pattern Instruction Selection"
#define TCGEN05_LD_OPCODE(SHAPE, NUM)
#define TCGEN05_ST_OPCODE(SHAPE, NUM)

Functions

static unsigned getTcgen05LdOpcode (unsigned IID, bool enablePack)
static NVPTX::Scope resolveScope (NVPTX::Scope S, const NVPTXSubtarget *T)
static bool canLowerToLDG (const MemSDNode &N, const NVPTXSubtarget &Subtarget, NVPTX::AddressSpace CodeAddrSpace)
static unsigned int getFenceOp (NVPTX::Ordering O, NVPTX::Scope S, NVPTXSubtarget const *T)
static std::optional< unsignedpickOpcodeForVT (MVT::SimpleValueType VT, std::optional< unsigned > Opcode_i16, std::optional< unsigned > Opcode_i32, std::optional< unsigned > Opcode_i64)
static bool isAddLike (const SDValue V)
static SDValue stripAssertAlign (SDValue N)
static SDValue selectBaseADDR (SDValue N, SelectionDAG *DAG)
static SDValue accumulateOffset (SDValue &Addr, SDLoc DL, SelectionDAG *DAG)
static std::pair< SDValue, SDValueselectADDR (SDValue Addr, SelectionDAG *DAG)
static void emitInvalidMemCacheHint (LLVMContext &Ctx, const Twine &Msg)
static std::optional< NVPTX::L1Eviction > parseL1Eviction (StringRef Str)
static std::optional< NVPTX::L2Eviction > parseL2Eviction (StringRef Str)
static std::optional< NVPTX::L2Prefetch > parseL2Prefetch (StringRef Str)
template<typename T>
static std::optional< TparseMemCacheHintStringValue (LLVMContext &Ctx, StringRef Key, const Metadata *Value, std::optional< T >(*Parse)(StringRef))
static bool isGlobalOrGeneric (NVPTX::AddressSpace AddrSpace)
static bool isL2PrefetchSupported (const NVPTXSubtarget &Subtarget, NVPTX::L2Prefetch Prefetch, NVPTXMemCacheHintAccess Access)
static bool isL2EvictionSupported (const NVPTXSubtarget &Subtarget, NVPTX::L2Eviction Eviction, NVPTXMemCacheHintAccess Access)
static unsigned getStoreVectorNumElts (SDNode *N)
static unsigned getTcgen05StOpcode (unsigned IID, bool enableUnpack)

Variables

static cl::opt< boolEnableRsqrtOpt ("nvptx-rsqrt-approx-opt", cl::init(true), cl::Hidden, cl::desc("Enable reciprocal sqrt optimization"))
static cl::opt< boolEnableMADWide ("nvptx-mad-wide-opt", cl::init(false), cl::Hidden, cl::desc("Enable MAD wide optimization"))

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "nvptx-isel"

Definition at line 48 of file NVPTXISelDAGToDAG.cpp.

◆ PASS_NAME

#define PASS_NAME   "NVPTX DAG->DAG Pattern Instruction Selection"

Definition at line 49 of file NVPTXISelDAGToDAG.cpp.

◆ TCGEN05_LD_OPCODE

#define TCGEN05_LD_OPCODE ( SHAPE,
NUM )
Value:
(enablePack ? NVPTX::TCGEN05_LD_##SHAPE##_##NUM##_PACK \
: NVPTX::TCGEN05_LD_##SHAPE##_##NUM)
#define _

Definition at line 330 of file NVPTXISelDAGToDAG.cpp.

Referenced by getTcgen05LdOpcode().

◆ TCGEN05_ST_OPCODE

#define TCGEN05_ST_OPCODE ( SHAPE,
NUM )
Value:
(enableUnpack ? NVPTX::TCGEN05_ST_##SHAPE##_##NUM##_UNPACK \
: NVPTX::TCGEN05_ST_##SHAPE##_##NUM)

Definition at line 2144 of file NVPTXISelDAGToDAG.cpp.

Referenced by getTcgen05StOpcode().

Function Documentation

◆ accumulateOffset()

◆ canLowerToLDG()

bool canLowerToLDG ( const MemSDNode & N,
const NVPTXSubtarget & Subtarget,
NVPTX::AddressSpace CodeAddrSpace )
static

Definition at line 908 of file NVPTXISelDAGToDAG.cpp.

References llvm::NVPTX::Global, llvm::NVPTXSubtarget::hasLDG(), and N.

◆ emitInvalidMemCacheHint()

void emitInvalidMemCacheHint ( LLVMContext & Ctx,
const Twine & Msg )
static

Definition at line 1148 of file NVPTXISelDAGToDAG.cpp.

References llvm::DS_Warning, and Msg.

Referenced by parseMemCacheHintStringValue().

◆ getFenceOp()

◆ getStoreVectorNumElts()

unsigned getStoreVectorNumElts ( SDNode * N)
static

◆ getTcgen05LdOpcode()

unsigned getTcgen05LdOpcode ( unsigned IID,
bool enablePack )
static

Definition at line 334 of file NVPTXISelDAGToDAG.cpp.

References llvm_unreachable, and TCGEN05_LD_OPCODE.

◆ getTcgen05StOpcode()

unsigned getTcgen05StOpcode ( unsigned IID,
bool enableUnpack )
static

Definition at line 2148 of file NVPTXISelDAGToDAG.cpp.

References llvm_unreachable, and TCGEN05_ST_OPCODE.

◆ isAddLike()

bool isAddLike ( const SDValue V)
inlinestatic

Definition at line 1082 of file NVPTXISelDAGToDAG.cpp.

References llvm::ISD::ADD, and llvm::ISD::OR.

Referenced by accumulateOffset(), and checkIfSafeAddSequence().

◆ isGlobalOrGeneric()

bool isGlobalOrGeneric ( NVPTX::AddressSpace AddrSpace)
static

◆ isL2EvictionSupported()

bool isL2EvictionSupported ( const NVPTXSubtarget & Subtarget,
NVPTX::L2Eviction Eviction,
NVPTXMemCacheHintAccess Access )
static

◆ isL2PrefetchSupported()

◆ parseL1Eviction()

◆ parseL2Eviction()

std::optional< NVPTX::L2Eviction > parseL2Eviction ( StringRef Str)
static

◆ parseL2Prefetch()

std::optional< NVPTX::L2Prefetch > parseL2Prefetch ( StringRef Str)
static

◆ parseMemCacheHintStringValue()

template<typename T>
std::optional< T > parseMemCacheHintStringValue ( LLVMContext & Ctx,
StringRef Key,
const Metadata * Value,
std::optional< T >(* Parse )(StringRef) )
static

◆ pickOpcodeForVT()

std::optional< unsigned > pickOpcodeForVT ( MVT::SimpleValueType VT,
std::optional< unsigned > Opcode_i16,
std::optional< unsigned > Opcode_i32,
std::optional< unsigned > Opcode_i64 )
static

Definition at line 1057 of file NVPTXISelDAGToDAG.cpp.

◆ resolveScope()

NVPTX::Scope resolveScope ( NVPTX::Scope S,
const NVPTXSubtarget * T )
static

Definition at line 667 of file NVPTXISelDAGToDAG.cpp.

References llvm::NVPTX::Block, llvm::NVPTX::Cluster, and T.

Referenced by getFenceOp().

◆ selectADDR()

std::pair< SDValue, SDValue > selectADDR ( SDValue Addr,
SelectionDAG * DAG )
static

◆ selectBaseADDR()

◆ stripAssertAlign()

SDValue stripAssertAlign ( SDValue N)
static

Definition at line 1087 of file NVPTXISelDAGToDAG.cpp.

References llvm::ISD::AssertAlign, and N.

Referenced by accumulateOffset(), and selectBaseADDR().

Variable Documentation

◆ EnableMADWide

cl::opt< bool > EnableMADWide("nvptx-mad-wide-opt", cl::init(false), cl::Hidden, cl::desc("Enable MAD wide optimization")) ( "nvptx-mad-wide-opt" ,
cl::init(false) ,
cl::Hidden ,
cl::desc("Enable MAD wide optimization")  )
static

◆ EnableRsqrtOpt

cl::opt< bool > EnableRsqrtOpt("nvptx-rsqrt-approx-opt", cl::init(true), cl::Hidden, cl::desc("Enable reciprocal sqrt optimization")) ( "nvptx-rsqrt-approx-opt" ,
cl::init(true) ,
cl::Hidden ,
cl::desc("Enable reciprocal sqrt optimization")  )
static