LLVM 20.0.0git
Macros | Functions | Variables
NVPTXISelDAGToDAG.cpp File Reference
#include "NVPTXISelDAGToDAG.h"
#include "MCTargetDesc/NVPTXBaseInfo.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/Support/AtomicOrdering.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/raw_ostream.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)
 

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 std::optional< unsignedpickOpcodeForVT (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 unsigned pickOpcodeForVectorStParam (SmallVector< SDValue, 8 > &Ops, unsigned NumElts, MVT::SimpleValueType MemTy, SelectionDAG *CurDAG, SDLoc DL)
 

Variables

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

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "nvptx-isel"

Definition at line 31 of file NVPTXISelDAGToDAG.cpp.

◆ getOpcodeForVectorStParam

#define getOpcodeForVectorStParam (   n,
  ty,
  isimm 
)
Value:
(n == 2) ? getOpcodeForVectorStParamV2(ty, isimm) \
#define getOpcodeForVectorStParamV4(ty, isimm)
#define getOpcodeForVectorStParamV2(ty, isimm)

Definition at line 2364 of file NVPTXISelDAGToDAG.cpp.

◆ getOpcodeForVectorStParamV2

#define getOpcodeForVectorStParamV2 (   ty,
  isimm 
)     (isimm[0]) ? getOpcV2H1(ty, i, isimm[1]) : getOpcV2H1(ty, r, isimm[1])

Definition at line 2342 of file NVPTXISelDAGToDAG.cpp.

◆ getOpcodeForVectorStParamV4

#define getOpcodeForVectorStParamV4 (   ty,
  isimm 
)
Value:
(isimm[0]) ? getOpcV4H1(ty, i, isimm[1], isimm[2], isimm[3]) \
: getOpcV4H1(ty, r, isimm[1], isimm[2], isimm[3])
#define getOpcV4H1(ty, opKind0, isImm1, isImm2, isImm3)

Definition at line 2360 of file NVPTXISelDAGToDAG.cpp.

◆ getOpcV2H

#define getOpcV2H (   ty,
  opKind0,
  opKind1 
)     NVPTX::StoreParamV2##ty##_##opKind0##opKind1

Definition at line 2336 of file NVPTXISelDAGToDAG.cpp.

◆ getOpcV2H1

#define getOpcV2H1 (   ty,
  opKind0,
  isImm1 
)     (isImm1) ? getOpcV2H(ty, opKind0, i) : getOpcV2H(ty, opKind0, r)

Definition at line 2339 of file NVPTXISelDAGToDAG.cpp.

◆ getOpcV4H

#define getOpcV4H (   ty,
  opKind0,
  opKind1,
  opKind2,
  opKind3 
)     NVPTX::StoreParamV4##ty##_##opKind0##opKind1##opKind2##opKind3

Definition at line 2345 of file NVPTXISelDAGToDAG.cpp.

◆ getOpcV4H1

#define getOpcV4H1 (   ty,
  opKind0,
  isImm1,
  isImm2,
  isImm3 
)
Value:
(isImm1) ? getOpcV4H2(ty, opKind0, i, isImm2, isImm3) \
: getOpcV4H2(ty, opKind0, r, isImm2, isImm3)
#define getOpcV4H2(ty, opKind0, opKind1, isImm2, isImm3)

Definition at line 2356 of file NVPTXISelDAGToDAG.cpp.

◆ getOpcV4H2

#define getOpcV4H2 (   ty,
  opKind0,
  opKind1,
  isImm2,
  isImm3 
)
Value:
(isImm2) ? getOpcV4H3(ty, opKind0, opKind1, i, isImm3) \
: getOpcV4H3(ty, opKind0, opKind1, r, isImm3)
#define getOpcV4H3(ty, opKind0, opKind1, opKind2, isImm3)

Definition at line 2352 of file NVPTXISelDAGToDAG.cpp.

◆ getOpcV4H3

#define getOpcV4H3 (   ty,
  opKind0,
  opKind1,
  opKind2,
  isImm3 
)
Value:
(isImm3) ? getOpcV4H(ty, opKind0, opKind1, opKind2, i) \
: getOpcV4H(ty, opKind0, opKind1, opKind2, r)
#define getOpcV4H(ty, opKind0, opKind1, opKind2, opKind3)

Definition at line 2348 of file NVPTXISelDAGToDAG.cpp.

◆ PASS_NAME

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

Definition at line 32 of file NVPTXISelDAGToDAG.cpp.

Function Documentation

◆ canLowerToLDG()

static bool canLowerToLDG ( MemSDNode N,
const NVPTXSubtarget Subtarget,
unsigned  CodeAddrSpace,
MachineFunction F 
)
static

◆ getCodeAddrSpace()

static unsigned int getCodeAddrSpace ( MemSDNode N)
static

◆ getLdStRegType()

static int getLdStRegType ( EVT  VT)
static

◆ getPTXCmpMode()

static unsigned getPTXCmpMode ( const CondCodeSDNode CondCode,
bool  FTZ 
)
static

◆ pickOpcodeForVectorStParam()

static unsigned pickOpcodeForVectorStParam ( SmallVector< SDValue, 8 > &  Ops,
unsigned  NumElts,
MVT::SimpleValueType  MemTy,
SelectionDAG CurDAG,
SDLoc  DL 
)
static

◆ pickOpcodeForVT()

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

Definition at line 1088 of file NVPTXISelDAGToDAG.cpp.

Variable Documentation

◆ 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