LLVM 18.0.0git
Namespaces | Macros | Functions
RISCVISelDAGToDAG.cpp File Reference
#include "RISCVISelDAGToDAG.h"
#include "MCTargetDesc/RISCVBaseInfo.h"
#include "MCTargetDesc/RISCVMCTargetDesc.h"
#include "MCTargetDesc/RISCVMatInt.h"
#include "RISCVISelLowering.h"
#include "RISCVMachineFunctionInfo.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/IR/IntrinsicsRISCV.h"
#include "llvm/Support/Alignment.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <optional>
#include "RISCVGenSearchableTables.inc"

Go to the source code of this file.

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 
namespace  llvm::RISCV
 

Macros

#define DEBUG_TYPE   "riscv-isel"
 
#define PASS_NAME   "RISC-V DAG->DAG Pattern Instruction Selection"
 
#define GET_RISCVVSSEGTable_IMPL
 
#define GET_RISCVVLSEGTable_IMPL
 
#define GET_RISCVVLXSEGTable_IMPL
 
#define GET_RISCVVSXSEGTable_IMPL
 
#define GET_RISCVVLETable_IMPL
 
#define GET_RISCVVSETable_IMPL
 
#define GET_RISCVVLXTable_IMPL
 
#define GET_RISCVVSXTable_IMPL
 
#define GET_RISCVMaskedPseudosTable_IMPL
 
#define CASE_VMSLT_VMNAND_VMSET_OPCODES(lmulenum, suffix, suffix_b)
 
#define CASE_VMSLT_OPCODES(lmulenum, suffix, suffix_b)
 
#define CASE_VMXOR_VMANDN_VMOR_OPCODES(lmulenum, suffix)
 
#define CASE_VMERGE_TO_VMV(lmul)
 

Functions

static SDValue selectImmSeq (SelectionDAG *CurDAG, const SDLoc &DL, const MVT VT, RISCVMatInt::InstSeq &Seq)
 
static SDValue selectImm (SelectionDAG *CurDAG, const SDLoc &DL, const MVT VT, int64_t Imm, const RISCVSubtarget &Subtarget)
 
static SDValue createTuple (SelectionDAG &CurDAG, ArrayRef< SDValue > Regs, unsigned NF, RISCVII::VLMUL LMUL)
 
static bool selectConstantAddr (SelectionDAG *CurDAG, const SDLoc &DL, const MVT VT, const RISCVSubtarget *Subtarget, SDValue Addr, SDValue &Base, SDValue &Offset)
 
static bool isWorthFoldingAdd (SDValue Add)
 
static SDValue findVSplat (SDValue N)
 
static bool selectVSplatImmHelper (SDValue N, SDValue &SplatVal, SelectionDAG &DAG, const RISCVSubtarget &Subtarget, std::function< bool(int64_t)> ValidateImm)
 
static bool usesAllOnesMask (SDValue MaskOp, SDValue GlueOp)
 
static bool usesAllOnesMask (SDNode *N, unsigned MaskOpIdx)
 
static bool isImplicitDef (SDValue V)
 
static bool IsVMerge (SDNode *N)
 
static bool IsVMv (SDNode *N)
 
static unsigned GetVMSetForLMul (RISCVII::VLMUL LMUL)
 

Macro Definition Documentation

◆ CASE_VMERGE_TO_VMV

#define CASE_VMERGE_TO_VMV (   lmul)
Value:
case RISCV::PseudoVMERGE_VVM_##lmul: \
NewOpc = RISCV::PseudoVMV_V_V_##lmul; \
break;

◆ CASE_VMSLT_OPCODES

#define CASE_VMSLT_OPCODES (   lmulenum,
  suffix,
  suffix_b 
)
Value:
case RISCVII::VLMUL::lmulenum: \
VMSLTOpcode = IsUnsigned ? RISCV::PseudoVMSLTU_VX_##suffix \
: RISCV::PseudoVMSLT_VX_##suffix; \
VMSLTMaskOpcode = IsUnsigned ? RISCV::PseudoVMSLTU_VX_##suffix##_MASK \
: RISCV::PseudoVMSLT_VX_##suffix##_MASK; \
break;

◆ CASE_VMSLT_VMNAND_VMSET_OPCODES

#define CASE_VMSLT_VMNAND_VMSET_OPCODES (   lmulenum,
  suffix,
  suffix_b 
)
Value:
case RISCVII::VLMUL::lmulenum: \
VMSLTOpcode = IsUnsigned ? RISCV::PseudoVMSLTU_VX_##suffix \
: RISCV::PseudoVMSLT_VX_##suffix; \
VMNANDOpcode = RISCV::PseudoVMNAND_MM_##suffix; \
VMSetOpcode = RISCV::PseudoVMSET_M_##suffix_b; \
break;

◆ CASE_VMXOR_VMANDN_VMOR_OPCODES

#define CASE_VMXOR_VMANDN_VMOR_OPCODES (   lmulenum,
  suffix 
)
Value:
case RISCVII::VLMUL::lmulenum: \
VMXOROpcode = RISCV::PseudoVMXOR_MM_##suffix; \
VMANDNOpcode = RISCV::PseudoVMANDN_MM_##suffix; \
VMOROpcode = RISCV::PseudoVMOR_MM_##suffix; \
break;

◆ DEBUG_TYPE

#define DEBUG_TYPE   "riscv-isel"

Definition at line 29 of file RISCVISelDAGToDAG.cpp.

◆ GET_RISCVMaskedPseudosTable_IMPL

#define GET_RISCVMaskedPseudosTable_IMPL

Definition at line 41 of file RISCVISelDAGToDAG.cpp.

◆ GET_RISCVVLETable_IMPL

#define GET_RISCVVLETable_IMPL

Definition at line 37 of file RISCVISelDAGToDAG.cpp.

◆ GET_RISCVVLSEGTable_IMPL

#define GET_RISCVVLSEGTable_IMPL

Definition at line 34 of file RISCVISelDAGToDAG.cpp.

◆ GET_RISCVVLXSEGTable_IMPL

#define GET_RISCVVLXSEGTable_IMPL

Definition at line 35 of file RISCVISelDAGToDAG.cpp.

◆ GET_RISCVVLXTable_IMPL

#define GET_RISCVVLXTable_IMPL

Definition at line 39 of file RISCVISelDAGToDAG.cpp.

◆ GET_RISCVVSETable_IMPL

#define GET_RISCVVSETable_IMPL

Definition at line 38 of file RISCVISelDAGToDAG.cpp.

◆ GET_RISCVVSSEGTable_IMPL

#define GET_RISCVVSSEGTable_IMPL

Definition at line 33 of file RISCVISelDAGToDAG.cpp.

◆ GET_RISCVVSXSEGTable_IMPL

#define GET_RISCVVSXSEGTable_IMPL

Definition at line 36 of file RISCVISelDAGToDAG.cpp.

◆ GET_RISCVVSXTable_IMPL

#define GET_RISCVVSXTable_IMPL

Definition at line 40 of file RISCVISelDAGToDAG.cpp.

◆ PASS_NAME

#define PASS_NAME   "RISC-V DAG->DAG Pattern Instruction Selection"

Definition at line 30 of file RISCVISelDAGToDAG.cpp.

Function Documentation

◆ createTuple()

static SDValue createTuple ( SelectionDAG CurDAG,
ArrayRef< SDValue Regs,
unsigned  NF,
RISCVII::VLMUL  LMUL 
)
static

◆ findVSplat()

static SDValue findVSplat ( SDValue  N)
static

◆ GetVMSetForLMul()

static unsigned GetVMSetForLMul ( RISCVII::VLMUL  LMUL)
static

◆ isImplicitDef()

static bool isImplicitDef ( SDValue  V)
static

Definition at line 3222 of file RISCVISelDAGToDAG.cpp.

◆ IsVMerge()

static bool IsVMerge ( SDNode N)
static

Definition at line 3282 of file RISCVISelDAGToDAG.cpp.

References N.

◆ IsVMv()

static bool IsVMv ( SDNode N)
static

Definition at line 3292 of file RISCVISelDAGToDAG.cpp.

References N.

◆ isWorthFoldingAdd()

static bool isWorthFoldingAdd ( SDValue  Add)
static

◆ selectConstantAddr()

static bool selectConstantAddr ( SelectionDAG CurDAG,
const SDLoc DL,
const MVT  VT,
const RISCVSubtarget Subtarget,
SDValue  Addr,
SDValue Base,
SDValue Offset 
)
static

◆ selectImm()

static SDValue selectImm ( SelectionDAG CurDAG,
const SDLoc DL,
const MVT  VT,
int64_t  Imm,
const RISCVSubtarget Subtarget 
)
static

◆ selectImmSeq()

static SDValue selectImmSeq ( SelectionDAG CurDAG,
const SDLoc DL,
const MVT  VT,
RISCVMatInt::InstSeq Seq 
)
static

◆ selectVSplatImmHelper()

static bool selectVSplatImmHelper ( SDValue  N,
SDValue SplatVal,
SelectionDAG DAG,
const RISCVSubtarget Subtarget,
std::function< bool(int64_t)>  ValidateImm 
)
static

◆ usesAllOnesMask() [1/2]

static bool usesAllOnesMask ( SDNode N,
unsigned  MaskOpIdx 
)
static

Definition at line 3217 of file RISCVISelDAGToDAG.cpp.

References N, and usesAllOnesMask().

◆ usesAllOnesMask() [2/2]

static bool usesAllOnesMask ( SDValue  MaskOp,
SDValue  GlueOp 
)
static