LLVM 20.0.0git
|
#include "NVPTXISelDAGToDAG.h"
#include "NVPTXUtilities.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/CodeGen/ISDOpcodes.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicsNVPTX.h"
#include "llvm/IR/NVVMIntrinsicFlags.h"
#include "llvm/Support/AtomicOrdering.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Target/TargetIntrinsicInfo.h"
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "nvptx-isel" |
#define | PASS_NAME "NVPTX DAG->DAG Pattern Instruction Selection" |
#define | getOpcV2H(ty, opKind0, opKind1) NVPTX::StoreParamV2##ty##_##opKind0##opKind1 |
#define | getOpcV2H1(ty, opKind0, isImm1) (isImm1) ? getOpcV2H(ty, opKind0, i) : getOpcV2H(ty, opKind0, r) |
#define | getOpcodeForVectorStParamV2(ty, isimm) (isimm[0]) ? getOpcV2H1(ty, i, isimm[1]) : getOpcV2H1(ty, r, isimm[1]) |
#define | getOpcV4H(ty, opKind0, opKind1, opKind2, opKind3) NVPTX::StoreParamV4##ty##_##opKind0##opKind1##opKind2##opKind3 |
#define | getOpcV4H3(ty, opKind0, opKind1, opKind2, isImm3) |
#define | getOpcV4H2(ty, opKind0, opKind1, isImm2, isImm3) |
#define | getOpcV4H1(ty, opKind0, isImm1, isImm2, isImm3) |
#define | getOpcodeForVectorStParamV4(ty, isimm) |
#define | getOpcodeForVectorStParam(n, ty, isimm) |
#define | CP_ASYNC_BULK_TENSOR_OPCODE(dir, dim, mode, is_s32, suffix) |
#define | CP_ASYNC_BULK_TENSOR_OPCODE_S2G_IMPL(op, dim, mode, is_ch, is_s32) |
#define | GET_CP_ASYNC_BULK_TENSOR_OPCODE_S2G(dim, mode, is_reduce, is_ch, is_s32) |
#define | GET_CP_ASYNC_BULK_TENSOR_OPCODE_G2S(dim, mode, is_mc, is_ch, is_s32) |
#define | GET_CP_ASYNC_BULK_TENSOR_OPCODE_PREFETCH(dim, mode, is_ch) |
Functions | |
static unsigned | getPTXCmpMode (const CondCodeSDNode &CondCode, bool FTZ) |
static unsigned int | getCodeAddrSpace (MemSDNode *N) |
static bool | canLowerToLDG (MemSDNode *N, const NVPTXSubtarget &Subtarget, unsigned CodeAddrSpace, MachineFunction *F) |
static unsigned int | getFenceOp (NVPTX::Ordering O, NVPTX::Scope S, NVPTXSubtarget const *T) |
static std::optional< unsigned > | pickOpcodeForVT (MVT::SimpleValueType VT, unsigned Opcode_i8, unsigned Opcode_i16, unsigned Opcode_i32, std::optional< unsigned > Opcode_i64, unsigned Opcode_f32, std::optional< unsigned > Opcode_f64) |
static int | getLdStRegType (EVT VT) |
static bool | isVectorElementTypeUpsized (EVT EltVT) |
static unsigned | pickOpcodeForVectorStParam (SmallVector< SDValue, 8 > &Ops, unsigned NumElts, MVT::SimpleValueType MemTy, SelectionDAG *CurDAG, SDLoc DL) |
static unsigned | GetCpAsyncBulkTensorS2GOpcode (size_t Dim, bool IsShared32, bool IsCacheHint, bool IsIm2Col, bool IsReduce=false) |
static unsigned | GetCpAsyncBulkTensorG2SOpcode (size_t Dim, bool IsShared32, bool IsMultiCast, bool IsCacheHint, bool IsIm2Col) |
static unsigned | GetCpAsyncBulkTensorPrefetchOpcode (size_t Dim, bool IsCacheHint, bool IsIm2Col) |
static size_t | GetDimsFromIntrinsic (unsigned IID) |
Variables | |
static cl::opt< bool > | EnableRsqrtOpt ("nvptx-rsqrt-approx-opt", cl::init(true), cl::Hidden, cl::desc("Enable reciprocal sqrt optimization")) |
#define CP_ASYNC_BULK_TENSOR_OPCODE | ( | dir, | |
dim, | |||
mode, | |||
is_s32, | |||
suffix | |||
) |
Definition at line 2748 of file NVPTXISelDAGToDAG.cpp.
Definition at line 2753 of file NVPTXISelDAGToDAG.cpp.
#define DEBUG_TYPE "nvptx-isel" |
Definition at line 29 of file NVPTXISelDAGToDAG.cpp.
#define GET_CP_ASYNC_BULK_TENSOR_OPCODE_G2S | ( | dim, | |
mode, | |||
is_mc, | |||
is_ch, | |||
is_s32 | |||
) |
Definition at line 2764 of file NVPTXISelDAGToDAG.cpp.
#define GET_CP_ASYNC_BULK_TENSOR_OPCODE_PREFETCH | ( | dim, | |
mode, | |||
is_ch | |||
) |
#define GET_CP_ASYNC_BULK_TENSOR_OPCODE_S2G | ( | dim, | |
mode, | |||
is_reduce, | |||
is_ch, | |||
is_s32 | |||
) |
Definition at line 2757 of file NVPTXISelDAGToDAG.cpp.
#define getOpcodeForVectorStParam | ( | n, | |
ty, | |||
isimm | |||
) |
Definition at line 2053 of file NVPTXISelDAGToDAG.cpp.
#define getOpcodeForVectorStParamV2 | ( | ty, | |
isimm | |||
) | (isimm[0]) ? getOpcV2H1(ty, i, isimm[1]) : getOpcV2H1(ty, r, isimm[1]) |
Definition at line 2031 of file NVPTXISelDAGToDAG.cpp.
#define getOpcodeForVectorStParamV4 | ( | ty, | |
isimm | |||
) |
Definition at line 2049 of file NVPTXISelDAGToDAG.cpp.
#define getOpcV2H | ( | ty, | |
opKind0, | |||
opKind1 | |||
) | NVPTX::StoreParamV2##ty##_##opKind0##opKind1 |
Definition at line 2025 of file NVPTXISelDAGToDAG.cpp.
#define getOpcV2H1 | ( | ty, | |
opKind0, | |||
isImm1 | |||
) | (isImm1) ? getOpcV2H(ty, opKind0, i) : getOpcV2H(ty, opKind0, r) |
Definition at line 2028 of file NVPTXISelDAGToDAG.cpp.
#define getOpcV4H | ( | ty, | |
opKind0, | |||
opKind1, | |||
opKind2, | |||
opKind3 | |||
) | NVPTX::StoreParamV4##ty##_##opKind0##opKind1##opKind2##opKind3 |
Definition at line 2034 of file NVPTXISelDAGToDAG.cpp.
#define getOpcV4H1 | ( | ty, | |
opKind0, | |||
isImm1, | |||
isImm2, | |||
isImm3 | |||
) |
Definition at line 2045 of file NVPTXISelDAGToDAG.cpp.
#define getOpcV4H2 | ( | ty, | |
opKind0, | |||
opKind1, | |||
isImm2, | |||
isImm3 | |||
) |
Definition at line 2041 of file NVPTXISelDAGToDAG.cpp.
#define getOpcV4H3 | ( | ty, | |
opKind0, | |||
opKind1, | |||
opKind2, | |||
isImm3 | |||
) |
Definition at line 2037 of file NVPTXISelDAGToDAG.cpp.
#define PASS_NAME "NVPTX DAG->DAG Pattern Instruction Selection" |
Definition at line 30 of file NVPTXISelDAGToDAG.cpp.
|
static |
Definition at line 596 of file NVPTXISelDAGToDAG.cpp.
References A, llvm::all_of(), F, llvm::getUnderlyingObjects(), llvm::NVPTX::Global, llvm::NVPTXSubtarget::hasLDG(), if(), llvm::isKernelFunction(), and N.
Definition at line 336 of file NVPTXISelDAGToDAG.cpp.
References llvm::NVPTXAS::ADDRESS_SPACE_CONST, llvm::NVPTXAS::ADDRESS_SPACE_GENERIC, llvm::NVPTXAS::ADDRESS_SPACE_GLOBAL, llvm::NVPTXAS::ADDRESS_SPACE_LOCAL, llvm::NVPTXAS::ADDRESS_SPACE_PARAM, llvm::NVPTXAS::ADDRESS_SPACE_SHARED, llvm::NVPTX::Const, llvm::NVPTX::Generic, llvm::NVPTX::Global, llvm::NVPTX::Local, N, llvm::NVPTX::Param, and llvm::NVPTX::Shared.
|
static |
Definition at line 2821 of file NVPTXISelDAGToDAG.cpp.
References D, GET_CP_ASYNC_BULK_TENSOR_OPCODE_G2S, and llvm_unreachable.
|
static |
Definition at line 2863 of file NVPTXISelDAGToDAG.cpp.
References D, GET_CP_ASYNC_BULK_TENSOR_OPCODE_PREFETCH, and llvm_unreachable.
|
static |
Definition at line 2779 of file NVPTXISelDAGToDAG.cpp.
References D, GET_CP_ASYNC_BULK_TENSOR_OPCODE_S2G, and llvm_unreachable.
|
static |
Definition at line 2896 of file NVPTXISelDAGToDAG.cpp.
References llvm_unreachable.
|
static |
Definition at line 638 of file NVPTXISelDAGToDAG.cpp.
References llvm::NVPTX::Acquire, llvm::NVPTX::AcquireRelease, llvm::NVPTX::Block, llvm::NVPTX::Cluster, llvm::NVPTX::Device, llvm::formatv(), llvm_unreachable, llvm::NVPTX::NotAtomic, llvm::NVPTX::Relaxed, llvm::NVPTX::RelaxedMMIO, llvm::NVPTX::Release, llvm::report_fatal_error(), llvm::NVPTX::SequentiallyConsistent, llvm::NVPTX::System, llvm::NVPTX::Thread, and llvm::NVPTX::Volatile.
|
static |
Definition at line 851 of file NVPTXISelDAGToDAG.cpp.
References llvm::NVPTX::PTXLdStInstCode::Float, llvm::EVT::getSimpleVT(), llvm::EVT::isFloatingPoint(), llvm::MVT::SimpleTy, llvm::NVPTX::PTXLdStInstCode::Unsigned, and llvm::NVPTX::PTXLdStInstCode::Untyped.
|
static |
Definition at line 213 of file NVPTXISelDAGToDAG.cpp.
References CC, llvm::NVPTX::PTXCmpMode::FTZ_FLAG, llvm_unreachable, llvm::ISD::SETEQ, llvm::ISD::SETGE, llvm::ISD::SETGT, llvm::ISD::SETLE, llvm::ISD::SETLT, llvm::ISD::SETNE, llvm::ISD::SETO, llvm::ISD::SETOEQ, llvm::ISD::SETOGE, llvm::ISD::SETOGT, llvm::ISD::SETOLE, llvm::ISD::SETOLT, llvm::ISD::SETONE, llvm::ISD::SETUEQ, llvm::ISD::SETUGE, llvm::ISD::SETUGT, llvm::ISD::SETULE, llvm::ISD::SETULT, llvm::ISD::SETUNE, and llvm::ISD::SETUO.
Definition at line 985 of file NVPTXISelDAGToDAG.cpp.
References llvm::Isv2x16VT().
|
static |
Definition at line 2057 of file NVPTXISelDAGToDAG.cpp.
References assert(), DL, F32, F64, llvm::ConstantFPSDNode::getConstantFPValue(), llvm::ConstantSDNode::getConstantIntValue(), getOpcodeForVectorStParam, getOpcodeForVectorStParamV2, llvm::SelectionDAG::getTargetConstant(), llvm::SelectionDAG::getTargetConstantFP(), and llvm_unreachable.
|
static |
Definition at line 820 of file NVPTXISelDAGToDAG.cpp.