LLVM 22.0.0git
|
#include "RISCVISelDAGToDAG.h"
#include "MCTargetDesc/RISCVBaseInfo.h"
#include "MCTargetDesc/RISCVMCTargetDesc.h"
#include "MCTargetDesc/RISCVMatInt.h"
#include "RISCVISelLowering.h"
#include "RISCVInstrInfo.h"
#include "RISCVSelectionDAGInfo.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/SDPatternMatch.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 "RISCVGenDAGISel.inc"
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "riscv-isel" |
#define | PASS_NAME "RISC-V DAG->DAG Pattern Instruction Selection" |
#define | GET_DAGISEL_BODY RISCVDAGToDAGISel |
#define | INST_NF_CASE(NAME, NF) |
#define | INST_NF_CASE_MASK(NAME, NF) |
#define | INST_NF_CASE_FF(NAME, NF) |
#define | INST_NF_CASE_FF_MASK(NAME, NF) |
#define | INST_ALL_NF_CASE_BASE(MACRO_NAME, NAME) |
#define | INST_ALL_NF_CASE(NAME) |
#define | INST_ALL_NF_CASE_WITH_FF(NAME) |
#define | CASE_VMSLT_OPCODES(lmulenum, suffix) |
#define | CASE_VMNAND_VMSET_OPCODES(lmulenum, suffix) |
#define | CASE_VMSLT_OPCODES(lmulenum, suffix) |
#define | CASE_VMXOR_VMANDN_VMOR_OPCODES(lmulenum, suffix) |
Variables | |
static cl::opt< bool > | UsePseudoMovImm ("riscv-use-rematerializable-movimm", cl::Hidden, cl::desc("Use a rematerializable pseudoinstruction for 2 instruction " "constant materialization"), cl::init(false)) |
#define CASE_VMNAND_VMSET_OPCODES | ( | lmulenum, | |
suffix ) |
Referenced by llvm::RISCVDAGToDAGISel::Select().
#define CASE_VMSLT_OPCODES | ( | lmulenum, | |
suffix ) |
Referenced by llvm::RISCVDAGToDAGISel::Select().
#define CASE_VMSLT_OPCODES | ( | lmulenum, | |
suffix ) |
#define CASE_VMXOR_VMANDN_VMOR_OPCODES | ( | lmulenum, | |
suffix ) |
Referenced by llvm::RISCVDAGToDAGISel::Select().
#define DEBUG_TYPE "riscv-isel" |
Definition at line 30 of file RISCVISelDAGToDAG.cpp.
#define GET_DAGISEL_BODY RISCVDAGToDAGISel |
Definition at line 39 of file RISCVISelDAGToDAG.cpp.
#define INST_ALL_NF_CASE | ( | NAME | ) |
Referenced by getSegInstNF().
#define INST_ALL_NF_CASE_BASE | ( | MACRO_NAME, | |
NAME ) |
#define INST_ALL_NF_CASE_WITH_FF | ( | NAME | ) |
Referenced by getSegInstNF().
#define INST_NF_CASE | ( | NAME, | |
NF ) |
#define INST_NF_CASE_FF | ( | NAME, | |
NF ) |
#define INST_NF_CASE_FF_MASK | ( | NAME, | |
NF ) |
#define INST_NF_CASE_MASK | ( | NAME, | |
NF ) |
#define PASS_NAME "RISC-V DAG->DAG Pattern Instruction Selection" |
Definition at line 31 of file RISCVISelDAGToDAG.cpp.
Definition at line 4071 of file RISCVISelDAGToDAG.cpp.
References assert(), llvm::ISD::INSERT_SUBVECTOR, N, SDValue(), and llvm::Splat.
Referenced by llvm::RISCVDAGToDAGISel::selectVSplat(), llvm::RISCVDAGToDAGISel::selectVSplatImm64Neg(), and selectVSplatImmHelper().
Definition at line 998 of file RISCVISelDAGToDAG.cpp.
References INST_ALL_NF_CASE, INST_ALL_NF_CASE_WITH_FF, and llvm_unreachable.
Referenced by llvm::RISCVDAGToDAGISel::Select().
Definition at line 4332 of file RISCVISelDAGToDAG.cpp.
References I, and isImplicitDef().
Referenced by isImplicitDef().
Definition at line 2908 of file RISCVISelDAGToDAG.cpp.
References llvm::Add, llvm::cast(), llvm::User::getOperand(), and getVal().
Referenced by llvm::RISCVDAGToDAGISel::areOffsetsWithinAlignment().
|
static |
Return true if this a load/store that we have a RegRegScale instruction for.
Definition at line 3165 of file RISCVISelDAGToDAG.cpp.
References llvm::Add, llvm::cast(), and llvm::EVT::isScalarInteger().
Referenced by isWorthFoldingIntoRegRegScale().
Definition at line 2879 of file RISCVISelDAGToDAG.cpp.
References llvm::Add, llvm::cast(), llvm::User::getOperand(), llvm::EVT::isScalarInteger(), and llvm::isStrongerThanMonotonic().
Referenced by llvm::RISCVDAGToDAGISel::SelectAddrRegImm().
|
static |
Is it profitable to fold this Add into RegRegScale load/store.
If Shift
is non-null, then we have matched a shl+add. We allow reassociating (add (add (shl A C2) B) C1) -> (add (add B C1) (shl A C2)) if there is a single addi and we don't have a SHXADD instruction we could use. FIXME: May still need to check how many and what kind of users the SHL has.
Definition at line 3188 of file RISCVISelDAGToDAG.cpp.
References llvm::ISD::ADD, llvm::Add, assert(), llvm::cast(), llvm::User::getOperand(), llvm::RISCVSubtarget::hasShlAdd(), llvm::isa(), llvm::isInt(), isRegRegScaleLoadOrStore(), SDValue(), llvm::ISD::SHL, and llvm::Value::users().
Referenced by llvm::RISCVDAGToDAGISel::SelectAddrRegRegScale().
|
static |
Definition at line 2827 of file RISCVISelDAGToDAG.cpp.
References assert(), llvm::SmallVectorTemplateCommon< T, typename >::back(), llvm::sampleprof::Base, llvm::cast(), DL, llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::RISCVMatInt::generateInstSeq(), llvm::SelectionDAG::getMachineNode(), llvm::SelectionDAG::getRegister(), llvm::SelectionDAG::getSignedTargetConstant(), llvm::SelectionDAG::getTargetConstant(), llvm::Hi, llvm::RISCVSubtarget::is64Bit(), llvm::isa(), llvm::isInt(), llvm::Offset, llvm::SmallVectorTemplateBase< T, bool >::pop_back(), SDValue(), selectImmSeq(), and llvm::SignExtend64().
Referenced by llvm::RISCVDAGToDAGISel::SelectAddrRegImm(), and llvm::RISCVDAGToDAGISel::SelectAddrRegImmLsb00000().
|
static |
Definition at line 208 of file RISCVISelDAGToDAG.cpp.
References DL, llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::RISCVMatInt::generateInstSeq(), llvm::RISCVMatInt::generateTwoRegInstSeq(), llvm::SelectionDAG::getMachineNode(), llvm::SelectionDAG::getSignedTargetConstant(), llvm::SelectionDAG::getTargetConstant(), llvm::Lo, SDValue(), selectImmSeq(), llvm::SmallVectorTemplateCommon< T, typename >::size(), and UsePseudoMovImm.
Referenced by llvm::RISCVDAGToDAGISel::Select(), llvm::RISCVDAGToDAGISel::selectInvLogicImm(), llvm::RISCVDAGToDAGISel::selectScalarFPAsInt(), and llvm::RISCVDAGToDAGISel::tryBitfieldInsertOpFromOrAndImm().
|
static |
Definition at line 179 of file RISCVISelDAGToDAG.cpp.
References DL, llvm::SelectionDAG::getMachineNode(), llvm::SelectionDAG::getRegister(), llvm::SelectionDAG::getSignedTargetConstant(), llvm::RISCVMatInt::Imm, llvm::RISCVMatInt::RegImm, llvm::RISCVMatInt::RegReg, llvm::RISCVMatInt::RegX0, and SDValue().
Referenced by selectConstantAddr(), and selectImm().
|
static |
Definition at line 4095 of file RISCVISelDAGToDAG.cpp.
References assert(), findVSplat(), llvm::APInt::getSExtValue(), llvm::SelectionDAG::getSignedTargetConstant(), llvm::RISCVSubtarget::getXLenVT(), llvm::isa(), N, and llvm::Splat.
Referenced by llvm::RISCVDAGToDAGISel::selectVSplatSimm5(), llvm::RISCVDAGToDAGISel::selectVSplatSimm5Plus1(), llvm::RISCVDAGToDAGISel::selectVSplatSimm5Plus1NoDec(), llvm::RISCVDAGToDAGISel::selectVSplatSimm5Plus1NonZero(), and llvm::RISCVDAGToDAGISel::selectVSplatUimm().
Definition at line 4318 of file RISCVISelDAGToDAG.cpp.
References llvm::SDValue::getMachineOpcode(), llvm::SDNode::isMachineOpcode(), and Opc.
|
static |
Definition at line 3816 of file RISCVISelDAGToDAG.cpp.
References assert(), llvm::User::getNumOperands(), llvm::User::getOperand(), llvm::RISCV::getRVVMCOpcode(), llvm::RISCV::getVectorLowDemandedScalarBits(), llvm::RISCVII::hasSEWOp(), llvm::RISCVII::hasVecPolicyOp(), llvm::RISCVII::hasVLOp(), and TII.
Referenced by llvm::RISCVDAGToDAGISel::hasAllNBitUsers().
|
static |
Referenced by selectImm().