LLVM 17.0.0git
|
#include "RISCVISelDAGToDAG.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) |
Typedefs | |
using | ValidateFn = bool(*)(int64_t) |
Functions | |
static unsigned | getLastNonGlueOrChainOpIdx (const SDNode *Node) |
static unsigned | getVecPolicyOpIdx (const SDNode *Node, const MCInstrDesc &MCID) |
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 | isAllUndef (ArrayRef< SDValue > Values) |
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 bool | selectVSplatSimmHelper (SDValue N, SDValue &SplatVal, SelectionDAG &DAG, const RISCVSubtarget &Subtarget, ValidateFn ValidateImm) |
static bool | usesAllOnesMask (SDNode *N, unsigned MaskOpIdx) |
#define CASE_VMSLT_OPCODES | ( | lmulenum, | |
suffix, | |||
suffix_b | |||
) |
#define CASE_VMSLT_VMNAND_VMSET_OPCODES | ( | lmulenum, | |
suffix, | |||
suffix_b | |||
) |
#define CASE_VMXOR_VMANDN_VMOR_OPCODES | ( | lmulenum, | |
suffix | |||
) |
#define DEBUG_TYPE "riscv-isel" |
Definition at line 28 of file RISCVISelDAGToDAG.cpp.
#define GET_RISCVMaskedPseudosTable_IMPL |
Definition at line 40 of file RISCVISelDAGToDAG.cpp.
#define GET_RISCVVLETable_IMPL |
Definition at line 36 of file RISCVISelDAGToDAG.cpp.
#define GET_RISCVVLSEGTable_IMPL |
Definition at line 33 of file RISCVISelDAGToDAG.cpp.
#define GET_RISCVVLXSEGTable_IMPL |
Definition at line 34 of file RISCVISelDAGToDAG.cpp.
#define GET_RISCVVLXTable_IMPL |
Definition at line 38 of file RISCVISelDAGToDAG.cpp.
#define GET_RISCVVSETable_IMPL |
Definition at line 37 of file RISCVISelDAGToDAG.cpp.
#define GET_RISCVVSSEGTable_IMPL |
Definition at line 32 of file RISCVISelDAGToDAG.cpp.
#define GET_RISCVVSXSEGTable_IMPL |
Definition at line 35 of file RISCVISelDAGToDAG.cpp.
#define GET_RISCVVSXTable_IMPL |
Definition at line 39 of file RISCVISelDAGToDAG.cpp.
#define PASS_NAME "RISC-V DAG->DAG Pattern Instruction Selection" |
Definition at line 29 of file RISCVISelDAGToDAG.cpp.
using ValidateFn = bool (*)(int64_t) |
Definition at line 2929 of file RISCVISelDAGToDAG.cpp.
|
static |
Definition at line 212 of file RISCVISelDAGToDAG.cpp.
References assert(), DL, llvm::SelectionDAG::getMachineNode(), llvm::SelectionDAG::getTargetConstant(), I, llvm_unreachable, llvm::RISCVII::LMUL_1, llvm::RISCVII::LMUL_2, llvm::RISCVII::LMUL_4, llvm::RISCVII::LMUL_F2, llvm::RISCVII::LMUL_F4, llvm::RISCVII::LMUL_F8, N, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::ArrayRef< T >::size().
Definition at line 44 of file RISCVISelDAGToDAG.cpp.
References assert().
Referenced by getVecPolicyOpIdx().
|
static |
Definition at line 54 of file RISCVISelDAGToDAG.cpp.
References assert(), getLastNonGlueOrChainOpIdx(), llvm::RISCVII::hasVecPolicyOp(), and llvm::MCInstrDesc::TSFlags.
Definition at line 309 of file RISCVISelDAGToDAG.cpp.
References llvm::all_of().
Referenced by llvm::RISCVDAGToDAGISel::selectVLSEG(), llvm::RISCVDAGToDAGISel::selectVLSEGFF(), and llvm::RISCVDAGToDAGISel::selectVLXSEG().
Definition at line 2235 of file RISCVISelDAGToDAG.cpp.
References llvm::Add, llvm::ISD::ATOMIC_LOAD, llvm::ISD::ATOMIC_STORE, llvm::EVT::isScalarInteger(), llvm::ISD::LOAD, and llvm::ISD::STORE.
Referenced by llvm::RISCVDAGToDAGISel::SelectAddrRegImm().
|
static |
Definition at line 2187 of file RISCVISelDAGToDAG.cpp.
References Addr, assert(), llvm::SmallVectorTemplateCommon< T, typename >::back(), llvm::sampleprof::Base, DL, llvm::SmallVectorBase< Size_T >::empty(), llvm::RISCVMatInt::generateInstSeq(), llvm::SelectionDAG::getMachineNode(), llvm::SelectionDAG::getRegister(), llvm::SelectionDAG::getTargetConstant(), llvm::Hi, llvm::RISCVSubtarget::is64Bit(), llvm::Offset, llvm::SmallVectorTemplateBase< T, bool >::pop_back(), and selectImmSeq().
Referenced by llvm::RISCVDAGToDAGISel::SelectAddrRegImm().
|
static |
Definition at line 204 of file RISCVISelDAGToDAG.cpp.
References DL, llvm::RISCVMatInt::generateInstSeq(), and selectImmSeq().
Referenced by llvm::RISCVDAGToDAGISel::Select(), and llvm::RISCVDAGToDAGISel::selectFPImm().
|
static |
Definition at line 175 of file RISCVISelDAGToDAG.cpp.
References DL, llvm::SelectionDAG::getMachineNode(), llvm::SelectionDAG::getRegister(), llvm::SelectionDAG::getTargetConstant(), llvm::RISCVMatInt::Imm, llvm::RISCVMatInt::RegImm, llvm::RISCVMatInt::RegReg, and llvm::RISCVMatInt::RegX0.
Referenced by selectConstantAddr(), and selectImm().
|
static |
Definition at line 2931 of file RISCVISelDAGToDAG.cpp.
References assert(), llvm::MVT::bitsLT(), llvm::MVT::getSizeInBits(), llvm::SelectionDAG::getTargetConstant(), llvm::RISCVSubtarget::getXLenVT(), N, llvm::SignExtend64(), and llvm::RISCVISD::VMV_V_X_VL.
Referenced by llvm::RISCVDAGToDAGISel::selectVSplatSimm5(), llvm::RISCVDAGToDAGISel::selectVSplatSimm5Plus1(), and llvm::RISCVDAGToDAGISel::selectVSplatSimm5Plus1NonZero().
Definition at line 3108 of file RISCVISelDAGToDAG.cpp.
References llvm::ISD::CopyToReg, llvm::SDValue::getMachineOpcode(), llvm::SDNode::getOperand(), llvm::SDNode::isMachineOpcode(), and N.