|
LLVM 24.0.0git
|
#include "LoongArchISelLowering.h"#include "LoongArch.h"#include "LoongArchMachineFunctionInfo.h"#include "LoongArchRegisterInfo.h"#include "LoongArchSelectionDAGInfo.h"#include "LoongArchSubtarget.h"#include "MCTargetDesc/LoongArchBaseInfo.h"#include "MCTargetDesc/LoongArchMCTargetDesc.h"#include "MCTargetDesc/LoongArchMatInt.h"#include "llvm/ADT/SmallSet.h"#include "llvm/ADT/Statistic.h"#include "llvm/ADT/StringExtras.h"#include "llvm/CodeGen/ISDOpcodes.h"#include "llvm/CodeGen/MachineInstrBuilder.h"#include "llvm/CodeGen/RuntimeLibcallUtil.h"#include "llvm/CodeGen/SelectionDAGNodes.h"#include "llvm/IR/IRBuilder.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/IntrinsicsLoongArch.h"#include "llvm/Support/CodeGen.h"#include "llvm/Support/Debug.h"#include "llvm/Support/ErrorHandling.h"#include "llvm/Support/KnownBits.h"#include "llvm/Support/MathExtras.h"#include <llvm/Analysis/VectorUtils.h>#include "LoongArchGenAsmMatcher.inc"Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "loongarch-isel-lowering" |
| #define | IOCSRRD_CASE(NAME, NODE) |
| #define | IOCSRWR_CASE(NAME, NODE) |
| #define | ASRT_LE_GT_CASE(NAME) |
| #define | CRC_CASE_EXT_BINARYOP(NAME, NODE) |
| #define | CRC_CASE_EXT_UNARYOP(NAME, NODE) |
| #define | CSR_CASE(ID) |
| #define | IOCSRRD_CASE(NAME, NODE) |
| #define | GET_REGISTER_MATCHER |
Enumerations | |
| enum | MaterializeFPImm { NoMaterializeFPImm = 0 , MaterializeFPImm2Ins = 2 , MaterializeFPImm3Ins = 3 , MaterializeFPImm4Ins = 4 , MaterializeFPImm5Ins = 5 , MaterializeFPImm6Ins = 6 } |
Variables | |
| static cl::opt< MaterializeFPImm > | MaterializeFPImmInsNum ("loongarch-materialize-float-imm", cl::Hidden, cl::desc("Maximum number of instructions used (including code sequence " "to generate the value and moving the value to FPR) when " "materializing floating-point immediates (default = 3)"), cl::init(MaterializeFPImm3Ins), cl::values(clEnumValN(NoMaterializeFPImm, "0", "Use constant pool"), clEnumValN(MaterializeFPImm2Ins, "2", "Materialize FP immediate within 2 instructions"), clEnumValN(MaterializeFPImm3Ins, "3", "Materialize FP immediate within 3 instructions"), clEnumValN(MaterializeFPImm4Ins, "4", "Materialize FP immediate within 4 instructions"), clEnumValN(MaterializeFPImm5Ins, "5", "Materialize FP immediate within 5 instructions"), clEnumValN(MaterializeFPImm6Ins, "6", "Materialize FP immediate within 6 instructions " "(behaves same as 5 on loongarch64)"))) |
| static cl::opt< bool > | ZeroDivCheck ("loongarch-check-zero-division", cl::Hidden, cl::desc("Trap on integer division by zero."), cl::init(false)) |
| const MCPhysReg | ArgGPRs [] |
| const MCPhysReg | PreserveNoneArgGPRs [] |
| const MCPhysReg | ArgFPR32s [] |
| const MCPhysReg | ArgFPR64s [] |
| const MCPhysReg | ArgVRs [] |
| const MCPhysReg | ArgXRs [] |
| #define ASRT_LE_GT_CASE | ( | NAME | ) |
| #define CRC_CASE_EXT_BINARYOP | ( | NAME, | |
| NODE ) |
Referenced by llvm::LoongArchTargetLowering::ReplaceNodeResults().
| #define CRC_CASE_EXT_UNARYOP | ( | NAME, | |
| NODE ) |
Referenced by llvm::LoongArchTargetLowering::ReplaceNodeResults().
| #define CSR_CASE | ( | ID | ) |
Referenced by llvm::LoongArchTargetLowering::ReplaceNodeResults().
| #define DEBUG_TYPE "loongarch-isel-lowering" |
Definition at line 42 of file LoongArchISelLowering.cpp.
| #define GET_REGISTER_MATCHER |
Definition at line 11728 of file LoongArchISelLowering.cpp.
| #define IOCSRRD_CASE | ( | NAME, | |
| NODE ) |
Referenced by llvm::LoongArchTargetLowering::ReplaceNodeResults().
| #define IOCSRRD_CASE | ( | NAME, | |
| NODE ) |
| #define IOCSRWR_CASE | ( | NAME, | |
| NODE ) |
| enum MaterializeFPImm |
| Enumerator | |
|---|---|
| NoMaterializeFPImm | |
| MaterializeFPImm2Ins | |
| MaterializeFPImm3Ins | |
| MaterializeFPImm4Ins | |
| MaterializeFPImm5Ins | |
| MaterializeFPImm6Ins | |
Definition at line 46 of file LoongArchISelLowering.cpp.
Definition at line 9773 of file LoongArchISelLowering.cpp.
References ArgGPRs, llvm::CallingConv::PreserveNone, and PreserveNoneArgGPRs.
Referenced by CC_LoongArch(), and CC_LoongArchAssign2GRLen().
|
static |
Definition at line 2545 of file LoongArchISelLowering.cpp.
References I, isValid(), llvm::Off, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::V1.
Referenced by lowerVECTOR_SHUFFLE_VPERMI(), and lowerVECTOR_SHUFFLE_XVPERMI().
|
static |
Shuffle vectors by lane to generate more optimized instructions.
256-bit shuffles are always considered as 2-lane 128-bit shuffles.
Therefore, except for the following four cases, other cases are regarded as cross-lane shuffles, where optimization is relatively limited.
The first case is the closest to LoongArch instructions and the other cases need to be converted to it for processing.
This function will return true for the last three cases above and will modify V1, V2 and Mask. Otherwise, return false for the first case and cross-lane shuffle cases.
Definition at line 3270 of file LoongArchISelLowering.cpp.
References DL, llvm::SelectionDAG::getBitcast(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::SDValue::isUndef(), llvm::None, Subtarget, and llvm::V1.
Referenced by lower256BitShuffle().
|
static |
Definition at line 9822 of file LoongArchISelLowering.cpp.
References llvm::LoongArchABI::ABI_ILP32D, llvm::LoongArchABI::ABI_ILP32F, llvm::LoongArchABI::ABI_ILP32S, llvm::LoongArchABI::ABI_LP64D, llvm::LoongArchABI::ABI_LP64F, llvm::LoongArchABI::ABI_LP64S, allocateArgGPR(), ArgFPR32s, ArgFPR64s, ArgGPRs, ArgVRs, ArgXRs, assert(), llvm::CCValAssign::BCvt, CC_LoongArchAssign2GRLen(), llvm::SmallVectorImpl< T >::clear(), DL, llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::CCValAssign::Full, llvm::CCValAssign::getCustomMem(), llvm::CCValAssign::getCustomReg(), llvm::CCValAssign::getMem(), llvm::ISD::ArgFlagsTy::getNonZeroOrigAlign(), llvm::CCValAssign::getPending(), llvm::CCValAssign::getReg(), llvm::CCValAssign::Indirect, llvm::MVT::is128BitVector(), llvm::MVT::is256BitVector(), llvm::MVT::isFloatingPoint(), llvm::MVT::isScalarInteger(), llvm::ISD::ArgFlagsTy::isSplit(), llvm::ISD::ArgFlagsTy::isSplitEnd(), llvm::ISD::ArgFlagsTy::isVarArg(), llvm_unreachable, llvm::SmallVectorTemplateBase< T, bool >::push_back(), Reg, and llvm::SmallVectorTemplateCommon< T, typename >::size().
Referenced by llvm::LoongArchTargetLowering::CanLowerReturn(), llvm::LoongArchTargetLowering::LowerCall(), llvm::LoongArchTargetLowering::LowerFormalArguments(), and llvm::LoongArchTargetLowering::LowerReturn().
|
static |
Definition at line 10174 of file LoongArchISelLowering.cpp.
References llvm::CCValAssign::getReg(), Reg, and llvm::report_fatal_error().
Referenced by llvm::LoongArchTargetLowering::LowerCall(), and llvm::LoongArchTargetLowering::LowerFormalArguments().
|
static |
Definition at line 9786 of file LoongArchISelLowering.cpp.
References allocateArgGPR(), llvm::CCValAssign::Full, llvm::CCValAssign::getLocVT(), llvm::CCValAssign::getMem(), llvm::ISD::ArgFlagsTy::getNonZeroOrigAlign(), llvm::CCValAssign::getReg(), llvm::CCValAssign::getValNo(), llvm::CCValAssign::getValVT(), and Reg.
Referenced by CC_LoongArch().
Definition at line 6816 of file LoongArchISelLowering.cpp.
References llvm::ISD::AND, llvm::ISD::BUILD_VECTOR, checkBitcastSrcVectorSize(), llvm::Depth, llvm::ISD::FREEZE, llvm::ISD::isBuildVectorAllOnes(), llvm::ISD::isBuildVectorAllZeros(), llvm::SelectionDAG::MaxRecursionDepth, llvm::ISD::OR, llvm::ISD::SELECT, llvm::ISD::SETCC, llvm::Size, llvm::ISD::TRUNCATE, llvm::ISD::VSELECT, and llvm::ISD::XOR.
Referenced by checkBitcastSrcVectorSize(), checkBitcastSrcVectorSize(), combineBitcastvxi1(), and performBITCASTCombine().
|
static |
Definition at line 4860 of file LoongArchISelLowering.cpp.
References llvm::cast(), llvm::LLVMContext::emitError(), llvm::SelectionDAG::getContext(), llvm::SelectionDAG::getNode(), llvm::isInt(), llvm::isUInt(), SDValue(), and llvm::ISD::UNDEF.
|
static |
Definition at line 7263 of file LoongArchISelLowering.cpp.
References llvm::ISD::AssertSext, llvm::ISD::AssertZext, llvm::cast(), llvm::LoadSDNode::getExtensionType(), llvm::MemSDNode::getMemoryVT(), llvm::VTSDNode::getVT(), llvm::ISD::LOAD, llvm::ISD::NON_EXTLOAD, llvm::ISD::SEXTLOAD, V, and llvm::ISD::ZEXTLOAD.
|
static |
Definition at line 7607 of file LoongArchISelLowering.cpp.
References llvm::ISD::AND, llvm::cast(), CC, llvm::ISD::Constant, DL, llvm::ISD::EXTRACT_VECTOR_ELT, Folded, llvm::SelectionDAG::FoldSetCC(), llvm::APInt::getBitsSetFrom(), llvm::SelectionDAG::getCondCode(), llvm::SelectionDAG::getConstant(), llvm::SDValue::getConstantOperandVal(), llvm::SelectionDAG::getContext(), llvm::SelectionDAG::getDataLayout(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDValue::getScalarValueSizeInBits(), llvm::ISD::getSetCCInverse(), llvm::isa(), llvm::ISD::isIntEqualitySetCC(), llvm::isNullConstant(), llvm::isOneConstant(), llvm::isPowerOf2_64(), LHS, llvm::Log2_64(), llvm::SelectionDAG::MaskedValueIsZero(), RHS, llvm::ISD::SETCC, llvm::ISD::SETEQ, llvm::ISD::SETGE, llvm::ISD::SETLT, llvm::ISD::SETNE, llvm::ISD::SHL, llvm::ISD::SRA, llvm::ISD::SRL, Subtarget, TLI, translateSetCCForBranch(), and uint64_t.
Referenced by performBR_CCCombine(), llvm::RISCVTargetLowering::PerformDAGCombine(), and performSELECT_CCCombine().
|
static |
Try to fold: (and (xor X, -1), Y) -> (vandn X, Y).
Definition at line 6278 of file LoongArchISelLowering.cpp.
References llvm::ISD::AND, assert(), DL, llvm::SelectionDAG::getBitcast(), llvm::SelectionDAG::getNode(), llvm::MVT::is128BitVector(), llvm::MVT::is256BitVector(), isNOT(), N, SDValue(), X, and Y.
Referenced by performANDCombine().
|
static |
Definition at line 769 of file LoongArchISelLowering.cpp.
References assert(), llvm::cast(), llvm::ISD::CONCAT_VECTORS, DL, llvm::ISD::FP_ROUND, llvm::SelectionDAG::getBitcast(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SelectionDAG::getUNDEF(), llvm::SDValue::getValueType(), llvm::SelectionDAG::getVectorShuffle(), llvm::SDValue::hasOneUse(), Imm, llvm::EVT::is256BitVector(), llvm::SDValue::isUndef(), N, llvm::peekThroughBitcasts(), SDValue(), Subtarget, and llvm::Undef.
Referenced by performCONCAT_VECTORSCombine(), llvm::LoongArchTargetLowering::PerformDAGCombine(), and llvm::X86TargetLowering::PerformDAGCombine().
|
static |
Definition at line 1259 of file LoongArchISelLowering.cpp.
References llvm::ISD::ADD, llvm::ISD::AND, CC, DL, llvm::SelectionDAG::getAllOnesConstant(), llvm::SDNode::getAsAPIntVal(), llvm::SelectionDAG::getFreeze(), llvm::SelectionDAG::getNegative(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDValue::getOperandCondCode(), llvm::isa(), llvm::isAllOnesConstant(), llvm::isNullConstant(), LHS, matchSetCC(), N, llvm::ISD::OR, RHS, SDValue(), llvm::ISD::SETCC, Subtarget, and llvm::ISD::XOR.
|
static |
Compute whether each element of a shuffle is zeroable.
A "zeroable" vector shuffle element is one which can be lowered to zero.
Definition at line 1816 of file LoongArchISelLowering.cpp.
References assert(), llvm::SDValue::getNode(), llvm::APInt::getZero(), llvm::ISD::isBuildVectorAllZeros(), llvm::peekThroughBitcasts(), llvm::APInt::setBit(), llvm::Size, and llvm::V1.
Referenced by lower128BitShuffle(), lower256BitShuffle(), and lowerVECTOR_SHUFFLE().
|
static |
Definition at line 10047 of file LoongArchISelLowering.cpp.
References llvm::CCValAssign::BCvt, llvm::ISD::BITCAST, DL, llvm::CCValAssign::Full, llvm::CCValAssign::getLocInfo(), llvm::CCValAssign::getLocVT(), llvm::SelectionDAG::getNode(), llvm::CCValAssign::getValVT(), llvm::CCValAssign::Indirect, and llvm_unreachable.
|
static |
Definition at line 4226 of file LoongArchISelLowering.cpp.
References llvm::ISD::AND, DL, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::ISD::SRL, and llvm::ISD::XOR.
|
static |
Definition at line 10155 of file LoongArchISelLowering.cpp.
References llvm::CCValAssign::BCvt, llvm::ISD::BITCAST, DL, llvm::CCValAssign::Full, llvm::CCValAssign::getLocInfo(), llvm::CCValAssign::getLocVT(), llvm::SelectionDAG::getNode(), llvm::CCValAssign::getValVT(), and llvm_unreachable.
|
static |
Definition at line 5578 of file LoongArchISelLowering.cpp.
References llvm::ISD::ANY_EXTEND, DL, llvm::SelectionDAG::getConstant(), getLoongArchWOpcode(), llvm::SelectionDAG::getNode(), llvm_unreachable, N, llvm::ISD::ROTL, llvm::ISD::SUB, and llvm::ISD::TRUNCATE.
Referenced by llvm::LoongArchTargetLowering::ReplaceNodeResults(), and llvm::RISCVTargetLowering::ReplaceNodeResults().
|
static |
Definition at line 5612 of file LoongArchISelLowering.cpp.
References llvm::ISD::ANY_EXTEND, DL, llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getValueType(), N, llvm::ISD::SIGN_EXTEND_INREG, and llvm::ISD::TRUNCATE.
Referenced by llvm::LoongArchTargetLowering::ReplaceNodeResults(), and llvm::RISCVTargetLowering::ReplaceNodeResults().
|
static |
Definition at line 9459 of file LoongArchISelLowering.cpp.
References llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), DL, llvm::TargetSubtargetInfo::getInstrInfo(), llvm::getKillRegState(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), MI, MRI, Subtarget, and TII.
Referenced by llvm::RISCVTargetLowering::EmitInstrWithCustomInserter().
|
static |
Definition at line 5624 of file LoongArchISelLowering.cpp.
References llvm::LLVMContext::emitError(), llvm::SelectionDAG::getContext(), llvm::SelectionDAG::getUNDEF(), N, and Results.
Referenced by llvm::LoongArchTargetLowering::ReplaceNodeResults(), and replaceVPICKVE2GRResults().
|
static |
Definition at line 5276 of file LoongArchISelLowering.cpp.
References llvm::LLVMContext::emitError(), and llvm::SelectionDAG::getContext().
|
static |
Definition at line 5153 of file LoongArchISelLowering.cpp.
References llvm::LLVMContext::emitError(), llvm::SelectionDAG::getContext(), llvm::SelectionDAG::getMergeValues(), and llvm::SelectionDAG::getUNDEF().
|
static |
Definition at line 9275 of file LoongArchISelLowering.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), DL, llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getRegInfo(), llvm_unreachable, MI, MRI, Subtarget, and TII.
|
static |
Definition at line 9325 of file LoongArchISelLowering.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), DL, llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getRegInfo(), llvm::Hi, llvm_unreachable, Lo, MI, MRI, Subtarget, TII, and TRI.
|
static |
Definition at line 9206 of file LoongArchISelLowering.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), DL, llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getRegInfo(), llvm::Register::isVirtual(), llvm_unreachable, MI, MRI, Subtarget, and TII.
|
static |
Definition at line 9492 of file LoongArchISelLowering.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMBB(), llvm::MachineInstrBuilder::addReg(), llvm::MachineBasicBlock::addSuccessor(), llvm::any_of(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), CC, llvm::MachineInstr::collectDebugValues(), llvm::SmallSet< T, N, C >::count(), DL, E(), llvm::MachineBasicBlock::end(), llvm::MachineInstr::eraseFromParent(), F, llvm::MachineBasicBlock::getBasicBlock(), llvm::getImm(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineBasicBlock::getParent(), I, llvm::SmallSet< T, N, C >::insert(), isSelectPseudo(), LHS, MI, llvm::Next, llvm::MachineBasicBlock::push_back(), RHS, llvm::MachineBasicBlock::setCallFrameSize(), llvm::MachineBasicBlock::splice(), Subtarget, TII, and llvm::MachineBasicBlock::transferSuccessorsAndUpdatePHIs().
|
static |
Definition at line 9439 of file LoongArchISelLowering.cpp.
References llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), DL, llvm::TargetSubtargetInfo::getInstrInfo(), llvm::getKillRegState(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getSubtarget(), MI, Subtarget, and TII.
|
static |
Definition at line 8604 of file LoongArchISelLowering.cpp.
References DL, llvm::SelectionDAG::getContext(), llvm::MVT::getIntegerVT(), llvm::SelectionDAG::getNode(), llvm::EVT::getScalarSizeInBits(), llvm::EVT::getVectorNumElements(), llvm::EVT::getVectorVT(), N, and SDValue().
Referenced by performSINT_TO_FPCombine(), and performUINT_TO_FPCombine().
|
static |
Definition at line 3781 of file LoongArchISelLowering.cpp.
References AbstractManglingParser< Derived, Alloc >::Ops, assert(), DL, fillVector(), llvm::SelectionDAG::getUNDEF(), llvm::EVT::getVectorNumElements(), Subtarget, and llvm::Vector.
|
static |
Definition at line 3762 of file LoongArchISelLowering.cpp.
References AbstractManglingParser< Derived, Alloc >::Ops, assert(), DL, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::EVT::getVectorNumElements(), llvm::ISD::INSERT_VECTOR_ELT, llvm::SDValue::isUndef(), llvm::ISD::SCALAR_TO_VECTOR, Subtarget, and llvm::Vector.
Referenced by fillSubVectorFromBuildVector().
|
static |
Determine whether a range fits a regular pattern of values.
This function accounts for the possibility of jumping over the End iterator.
Definition at line 1794 of file LoongArchISelLowering.cpp.
Referenced by isVECTOR_SHUFFLE_SPLATI(), lowerVECTOR_SHUFFLE_ILVEV(), lowerVECTOR_SHUFFLE_ILVL(), lowerVECTOR_SHUFFLE_ILVOD(), lowerVECTOR_SHUFFLE_ILVR(), lowerVECTOR_SHUFFLE_PCKEV(), lowerVECTOR_SHUFFLE_PCKOD(), lowerVECTOR_SHUFFLE_VILVH(), lowerVECTOR_SHUFFLE_VILVL(), lowerVECTOR_SHUFFLE_VPACKEV(), lowerVECTOR_SHUFFLE_VPACKOD(), lowerVECTOR_SHUFFLE_VPICKEV(), lowerVECTOR_SHUFFLE_VPICKOD(), lowerVECTOR_SHUFFLE_VREPLVEI(), lowerVECTOR_SHUFFLE_XVILVH(), lowerVECTOR_SHUFFLE_XVILVL(), lowerVECTOR_SHUFFLE_XVPICKEV(), lowerVECTOR_SHUFFLE_XVPICKOD(), and lowerVECTOR_SHUFFLE_XVREPLVEI().
|
static |
Definition at line 1333 of file LoongArchISelLowering.cpp.
References DL, llvm::dyn_cast(), llvm::SelectionDAG::FoldConstantArithmetic(), llvm::SDNode::getAsAPIntVal(), llvm::SelectionDAG::getNode(), llvm::SDNode::getOpcode(), llvm::SDValue::getOpcode(), llvm::SDNode::getOperand(), llvm::SDValue::getOperand(), llvm::SelectionDAG::getSelect(), llvm::SDNode::getValueType(), llvm::SDValue::hasOneUse(), llvm::isa(), llvm::APInt::isAllOnes(), llvm::ConstantSDNode::isOpaque(), llvm::APInt::isZero(), SDValue(), llvm::ISD::SELECT, Subtarget, and std::swap().
|
static |
Definition at line 7308 of file LoongArchISelLowering.cpp.
References CC, llvm::SelectionDAG::ComputeNumSignBits(), DL, llvm::SelectionDAG::getNode(), llvm::EVT::getScalarSizeInBits(), llvm::isNullConstant(), llvm::EVT::isVector(), LHS, RHS, SDValue(), llvm::ISD::SETEQ, llvm::ISD::SETNE, and Subtarget.
Referenced by performBR_CCCombine(), and performSETCCCombine().
|
static |
Definition at line 11459 of file LoongArchISelLowering.cpp.
References llvm::EVT::getScalarType(), and Subtarget.
Referenced by llvm::LoongArchTargetLowering::getRecipEstimate(), and llvm::LoongArchTargetLowering::getSqrtEstimate().
|
static |
Definition at line 11280 of file LoongArchISelLowering.cpp.
References llvm::AtomicRMWInst::Add, llvm_unreachable, llvm::AtomicRMWInst::Max, llvm::AtomicRMWInst::Min, llvm::AtomicRMWInst::Nand, llvm::AtomicRMWInst::Sub, llvm::AtomicRMWInst::UMax, llvm::AtomicRMWInst::UMin, and llvm::AtomicRMWInst::Xchg.
Referenced by llvm::LoongArchTargetLowering::emitMaskedAtomicRMWIntrinsic(), and llvm::RISCVTargetLowering::emitMaskedAtomicRMWIntrinsic().
Definition at line 5545 of file LoongArchISelLowering.cpp.
References llvm::ISD::CTLZ, llvm::ISD::CTTZ, llvm_unreachable, llvm::ISD::ROTL, llvm::ISD::ROTR, llvm::ISD::SDIV, llvm::ISD::SHL, llvm::ISD::SRA, llvm::ISD::SREM, llvm::ISD::SRL, llvm::ISD::UDIV, and llvm::ISD::UREM.
Referenced by customLegalizeToWOp().
|
static |
Definition at line 10472 of file LoongArchISelLowering.cpp.
References llvm::SelectionDAG::getContext(), llvm::SelectionDAG::getDataLayout(), llvm::DataLayout::getPrefTypeAlign(), and llvm::EVT::getTypeForEVT().
Referenced by llvm::SelectionDAG::CreateStackTemporary(), llvm::LoongArchTargetLowering::LowerCall(), and llvm::RISCVTargetLowering::LowerCall().
|
static |
Definition at line 4587 of file LoongArchISelLowering.cpp.
References DL, llvm::SelectionDAG::getTargetBlockAddress(), and N.
|
static |
Definition at line 4593 of file LoongArchISelLowering.cpp.
References DL, llvm::SelectionDAG::getTargetConstantPool(), and N.
|
static |
Definition at line 4582 of file LoongArchISelLowering.cpp.
References DL, llvm::SelectionDAG::getTargetGlobalAddress(), and N.
|
static |
Definition at line 4599 of file LoongArchISelLowering.cpp.
References DL, llvm::SelectionDAG::getTargetJumpTable(), and N.
|
static |
Definition at line 9155 of file LoongArchISelLowering.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMBB(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::MachineFunction::CreateMachineBasicBlock(), DL, llvm::TargetSubtargetInfo::getInstrInfo(), llvm::getKillRegState(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getSubtarget(), llvm::MachineFunction::insert(), llvm::MachineOperand::isKill(), MBB, MI, llvm::MachineOperand::setIsKill(), TII, and ZeroDivCheck.
Referenced by llvm::MipsTargetLowering::EmitInstrWithCustomInserter().
Definition at line 6304 of file LoongArchISelLowering.cpp.
References llvm::dyn_cast(), N, and llvm::peekThroughBitcasts().
Referenced by llvm::ISD::isConstantSplatVectorAllOnes(), llvm::ISD::isConstantSplatVectorAllZeros(), performADDCombine(), performSHLCombine(), and performVSELECTCombine().
|
static |
Definition at line 707 of file LoongArchISelLowering.cpp.
References llvm::ISD::AND, llvm::ISD::BUILD_VECTOR, llvm::cast(), llvm::ISD::EXTRACT_SUBVECTOR, llvm::SelectionDAG::getBitcast(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getSplat(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::isAllOnesConstant(), llvm::ISD::isBuildVectorAllOnes(), isNOT(), llvm::isNullConstant(), llvm::TargetLoweringBase::isTypeLegal(), llvm::ISD::OR, llvm::peekThroughBitcasts(), SDValue(), V, and llvm::ISD::XOR.
Referenced by combineAndNotIntoVANDN(), llvm::X86InstrInfo::isDataInvariant(), isNOT(), and performVANDNCombine().
|
static |
Test whether a shuffle mask is equivalent within each sub-lane.
The specific repeated shuffle mask is populated in RepeatedMask, as it is non-trivial to compute in the face of undef lanes. The representation is suitable for use with existing 128-bit shuffles as entries from the second vector have been remapped to [LaneSize, 2*LaneSize).
Definition at line 1852 of file LoongArchISelLowering.cpp.
References assert(), llvm::SmallVectorImpl< T >::assign(), llvm::MVT::getScalarSizeInBits(), and llvm::Size.
Referenced by is128BitLaneRepeatedShuffleMask(), is128BitLaneRepeatedShuffleMask(), is256BitLaneRepeatedShuffleMask(), lowerVECTOR_SHUFFLEAsLanePermuteAndShuffle(), and matchShuffleAsByteRotate().
|
static |
Definition at line 9482 of file LoongArchISelLowering.cpp.
References MI.
Referenced by emitSelectPseudo().
|
static |
Definition at line 11468 of file LoongArchISelLowering.cpp.
References assert(), llvm::EVT::getSimpleVT(), llvm::EVT::isSimple(), llvm::MVT::SimpleTy, and Subtarget.
Referenced by llvm::LoongArchTargetLowering::getRecipEstimate(), and llvm::LoongArchTargetLowering::getSqrtEstimate().
|
static |
Definition at line 7785 of file LoongArchISelLowering.cpp.
References llvm::cast(), DL, llvm::LLVMContext::emitError(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getContext(), llvm::SelectionDAG::getNode(), llvm::isInt(), llvm::isUInt(), Subtarget, and llvm::ISD::UNDEF.
Referenced by performINTRINSIC_WO_CHAINCombine().
|
static |
Dispatching routine to lower various 128-bit LoongArch vector shuffles.
This routine breaks down the specific type of 128-bit shuffle and dispatches to the lowering routines accordingly.
Definition at line 2664 of file LoongArchISelLowering.cpp.
References assert(), computeZeroableShuffleElements(), DL, llvm::SDValue::getSimpleValueType(), llvm::MVT::getVectorNumElements(), llvm::SDValue::isUndef(), lowerVECTOR_SHUFFLE_IsReverse(), lowerVECTOR_SHUFFLE_VEXTRINS(), lowerVECTOR_SHUFFLE_VILVH(), lowerVECTOR_SHUFFLE_VILVL(), lowerVECTOR_SHUFFLE_VPACKEV(), lowerVECTOR_SHUFFLE_VPACKOD(), lowerVECTOR_SHUFFLE_VPERMI(), lowerVECTOR_SHUFFLE_VPICKEV(), lowerVECTOR_SHUFFLE_VPICKOD(), lowerVECTOR_SHUFFLE_VREPLVEI(), lowerVECTOR_SHUFFLE_VSHUF(), lowerVECTOR_SHUFFLE_VSHUF4I(), lowerVECTOR_SHUFFLEAsByteRotate(), lowerVECTOR_SHUFFLEAsShift(), lowerVECTOR_SHUFFLEAsZeroOrAnyExtend(), SDValue(), llvm::MVT::SimpleTy, Subtarget, llvm::V1, and widenShuffleMask().
Referenced by lowerVECTOR_SHUFFLE().
|
static |
Dispatching routine to lower various 256-bit LoongArch vector shuffles.
This routine breaks down the specific type of 256-bit shuffle and dispatches to the lowering routines accordingly.
Definition at line 3492 of file LoongArchISelLowering.cpp.
References assert(), canonicalizeShuffleVectorByLane(), computeZeroableShuffleElements(), DL, llvm::SDValue::getSimpleValueType(), llvm::MVT::getVectorNumElements(), llvm::SDValue::isUndef(), lower256BitShuffle(), lowerVECTOR_SHUFFLE_IsReverse(), lowerVECTOR_SHUFFLE_XVEXTRINS(), lowerVECTOR_SHUFFLE_XVILVH(), lowerVECTOR_SHUFFLE_XVILVL(), lowerVECTOR_SHUFFLE_XVINSVE0(), lowerVECTOR_SHUFFLE_XVPACKEV(), lowerVECTOR_SHUFFLE_XVPACKOD(), lowerVECTOR_SHUFFLE_XVPERM(), lowerVECTOR_SHUFFLE_XVPERMI(), lowerVECTOR_SHUFFLE_XVPERMIQ(), lowerVECTOR_SHUFFLE_XVPICKEV(), lowerVECTOR_SHUFFLE_XVPICKOD(), lowerVECTOR_SHUFFLE_XVREPLVE0(), lowerVECTOR_SHUFFLE_XVREPLVEI(), lowerVECTOR_SHUFFLE_XVSHUF(), lowerVECTOR_SHUFFLE_XVSHUF4I(), lowerVECTOR_SHUFFLEAsByteRotate(), lowerVECTOR_SHUFFLEAsLanePermuteAndShuffle(), lowerVECTOR_SHUFFLEAsShift(), SDValue(), llvm::MVT::SimpleTy, Subtarget, llvm::V1, and widenShuffleMask().
Referenced by lower256BitShuffle(), and lowerVECTOR_SHUFFLE().
|
static |
Definition at line 3716 of file LoongArchISelLowering.cpp.
References AbstractManglingParser< Derived, Alloc >::NumOps, AbstractManglingParser< Derived, Alloc >::Ops, assert(), llvm::cast(), DL, llvm::ISD::EXTLOAD, llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::SDNode::getNumOperands(), llvm::SDNode::getOperand(), llvm::MVT::getScalarSizeInBits(), llvm::SDNode::getSimpleValueType(), llvm::SDValue::getValue(), llvm::SelectionDAG::getVTList(), llvm::MVT::is128BitVector(), llvm::MVT::is256BitVector(), llvm::SDNode::isOnlyUserOf(), llvm::ISD::LOAD, llvm::ISD::NON_EXTLOAD, llvm::SelectionDAG::ReplaceAllUsesOfValueWith(), and SDValue().
|
static |
Lower VECTOR_SHUFFLE whose result is the reversed source vector.
It is possible to do optimization for VECTOR_SHUFFLE performing vector reverse whose mask likes: <7, 6, 5, 4, 3, 2, 1, 0>
When undef's appear in the mask they are treated as if they were whatever value is necessary in order to fit the above forms.
Definition at line 2189 of file LoongArchISelLowering.cpp.
References DL, llvm::SelectionDAG::getBitcast(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getUNDEF(), llvm::MVT::getVectorElementType(), llvm::MVT::getVectorNumElements(), llvm::SelectionDAG::getVectorShuffle(), llvm::MVT::getVectorVT(), llvm::ShuffleVectorInst::isReverseMask(), SDValue(), Subtarget, and llvm::V1.
Referenced by lower128BitShuffle(), and lower256BitShuffle().
|
static |
Lower VECTOR_SHUFFLE into VEXTRINS (if possible).
VEXTRINS copies one element of a vector into any place of the result vector and makes no change to the rest elements of the result vector.
It is possible to lower into VEXTRINS when the mask takes the form: <0, 1, 2, ..., n+i, ..., n-1> or <n, n+1, n+2, ..., i, ..., 2n-1> or <0, 1, 2, ..., i, ..., n-1> or <n, n+1, n+2, ..., n+i, ..., 2n-1> where n is the number of elements in the vector and i is in [0, n). For example: <0, 1, 2, 3, 4, 5, 6, 8> , <2, 9, 10, 11, 12, 13, 14, 15> , <0, 1, 2, 6, 4, 5, 6, 7> , <8, 9, 10, 11, 12, 9, 14, 15>
When undef's appear in the mask they are treated as if they were whatever value is necessary in order to fit the above forms.
Definition at line 2480 of file LoongArchISelLowering.cpp.
References llvm::sampleprof::Base, DL, llvm::ISD::EXTRACT_VECTOR_ELT, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::MVT::getVectorElementType(), llvm::MVT::getVectorNumElements(), llvm::ISD::INSERT_VECTOR_ELT, llvm::MVT::isFloatingPoint(), SDValue(), Subtarget, and llvm::V1.
Referenced by lower128BitShuffle().
|
static |
Lower VECTOR_SHUFFLE into VILVH (if possible).
VILVH interleaves consecutive elements from the left (highest-indexed) half of each vector.
It is possible to lower into VILVH when the mask consists of two of the following forms interleaved: <x, x+1, x+2, ...> <n+x, n+x+1, n+x+2, ...> where n is the number of elements in the vector and x is half n. For example: <x, x, x+1, x+1, x+2, x+2, ...> <x, n+x, x+1, n+x+1, x+2, n+x+2, ...>
When undef's appear in the mask they are treated as if they were whatever value is necessary in order to fit the above forms.
Definition at line 2313 of file LoongArchISelLowering.cpp.
References DL, llvm::End, fitsRegularPattern(), llvm::SelectionDAG::getNode(), SDValue(), and llvm::V1.
Referenced by lower128BitShuffle().
|
static |
Lower VECTOR_SHUFFLE into VILVL (if possible).
VILVL interleaves consecutive elements from the right (lowest-indexed) half of each vector.
It is possible to lower into VILVL when the mask consists of two of the following forms interleaved: <0, 1, 2, ...> <n, n+1, n+2, ...> where n is the number of elements in the vector. For example: <0, 0, 1, 1, 2, 2, ...> <0, n, 1, n+1, 2, n+2, ...>
When undef's appear in the mask they are treated as if they were whatever value is necessary in order to fit the above forms.
Definition at line 2356 of file LoongArchISelLowering.cpp.
References DL, llvm::End, fitsRegularPattern(), llvm::SelectionDAG::getNode(), SDValue(), and llvm::V1.
Referenced by lower128BitShuffle().
|
static |
Lower VECTOR_SHUFFLE into VPACKEV (if possible).
VPACKEV interleaves the even elements from each vector.
It is possible to lower into VPACKEV when the mask consists of two of the following forms interleaved: <0, 2, 4, ...> <n, n+2, n+4, ...> where n is the number of elements in the vector. For example: <0, 0, 2, 2, 4, 4, ...> <0, n, 2, n+2, 4, n+4, ...>
When undef's appear in the mask they are treated as if they were whatever value is necessary in order to fit the above forms.
Definition at line 2232 of file LoongArchISelLowering.cpp.
References DL, llvm::End, fitsRegularPattern(), llvm::SelectionDAG::getNode(), SDValue(), and llvm::V1.
Referenced by lower128BitShuffle(), and lowerVECTOR_SHUFFLE_XVPACKEV().
|
static |
Lower VECTOR_SHUFFLE into VPACKOD (if possible).
VPACKOD interleaves the odd elements from each vector.
It is possible to lower into VPACKOD when the mask consists of two of the following forms interleaved: <1, 3, 5, ...> <n+1, n+3, n+5, ...> where n is the number of elements in the vector. For example: <1, 1, 3, 3, 5, 5, ...> <1, n+1, 3, n+3, 5, n+5, ...>
When undef's appear in the mask they are treated as if they were whatever value is necessary in order to fit the above forms.
Definition at line 2272 of file LoongArchISelLowering.cpp.
References DL, llvm::End, fitsRegularPattern(), llvm::SelectionDAG::getNode(), SDValue(), and llvm::V1.
Referenced by lower128BitShuffle(), and lowerVECTOR_SHUFFLE_XVPACKOD().
|
static |
Lower VECTOR_SHUFFLE into VPERMI (if possible).
VPERMI selects two elements from each of the two vectors based on the mask and places them in the corresponding positions of the result vector in order. Only v4i32 and v4f32 types are allowed.
It is possible to lower into VPERMI when the mask consists of two of the following forms concatenated: <i, j, u, v> <u, v, i, j> where i,j are in [0,4) and u,v are in [4, 8). For example: <2, 3, 4, 5> <5, 7, 0, 2>
When undef's appear in the mask they are treated as if they were whatever value is necessary in order to fit the above forms.
Definition at line 2617 of file LoongArchISelLowering.cpp.
References buildVPERMIInfo(), DL, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::MVT::getVectorNumElements(), SDValue(), Subtarget, and llvm::V1.
Referenced by lower128BitShuffle().
|
static |
Lower VECTOR_SHUFFLE into VPICKEV (if possible).
VPICKEV copies the even elements of each vector into the result vector.
It is possible to lower into VPICKEV when the mask consists of two of the following forms concatenated: <0, 2, 4, ...> <n, n+2, n+4, ...> where n is the number of elements in the vector. For example: <0, 2, 4, ..., 0, 2, 4, ...> <0, 2, 4, ..., n, n+2, n+4, ...>
When undef's appear in the mask they are treated as if they were whatever value is necessary in order to fit the above forms.
Definition at line 2396 of file LoongArchISelLowering.cpp.
References DL, llvm::End, fitsRegularPattern(), llvm::SelectionDAG::getNode(), SDValue(), and llvm::V1.
Referenced by lower128BitShuffle().
|
static |
Lower VECTOR_SHUFFLE into VPICKOD (if possible).
VPICKOD copies the odd elements of each vector into the result vector.
It is possible to lower into VPICKOD when the mask consists of two of the following forms concatenated: <1, 3, 5, ...> <n+1, n+3, n+5, ...> where n is the number of elements in the vector. For example: <1, 3, 5, ..., 1, 3, 5, ...> <1, 3, 5, ..., n+1, n+3, n+5, ...>
When undef's appear in the mask they are treated as if they were whatever value is necessary in order to fit the above forms.
Definition at line 2438 of file LoongArchISelLowering.cpp.
References DL, llvm::End, fitsRegularPattern(), llvm::SelectionDAG::getNode(), SDValue(), and llvm::V1.
Referenced by lower128BitShuffle().
|
static |
Lower VECTOR_SHUFFLE into VREPLVEI (if possible).
VREPLVEI performs vector broadcast based on an element specified by an integer immediate, with its mask being similar to: <x, x, x, ...> where x is any valid index.
When undef's appear in the mask they are treated as if they were whatever value is necessary in order to fit the above form.
Definition at line 2083 of file LoongArchISelLowering.cpp.
References assert(), DL, fitsRegularPattern(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getUNDEF(), SDValue(), Subtarget, and llvm::V1.
Referenced by lower128BitShuffle().
|
static |
Lower VECTOR_SHUFFLE into VSHUF.
This mostly consists of converting the shuffle mask into a BUILD_VECTOR and adding it as an operand to the resulting VSHUF.
Definition at line 2638 of file LoongArchISelLowering.cpp.
References AbstractManglingParser< Derived, Alloc >::Ops, llvm::MVT::changeVectorElementTypeToInteger(), DL, llvm::SelectionDAG::getBuildVector(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getSignedConstant(), Subtarget, and llvm::V1.
Referenced by lower128BitShuffle().
|
static |
Lower VECTOR_SHUFFLE into VSHUF4I (if possible).
VSHUF4I splits the vector into blocks of four elements, then shuffles these elements according to a <4 x i2> constant (encoded as an integer immediate).
It is therefore possible to lower into VSHUF4I when the mask takes the form: <a, b, c, d, a+4, b+4, c+4, d+4, a+8, b+8, c+8, d+8, ...> When undef's appear they are treated as if they were whatever value is necessary in order to fit the above forms.
For example: %2 = shufflevector <8 x i16> %0, <8 x i16> undef, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 7, i32 6, i32 5, i32 4> is lowered to: (VSHUF4I_H $v0, $v1, 27) where the 27 comes from: 3 + (2 << 2) + (1 << 4) + (0 << 6)
Definition at line 2125 of file LoongArchISelLowering.cpp.
References DL, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), Imm, SDValue(), Subtarget, and llvm::V1.
Referenced by lower128BitShuffle(), and lowerVECTOR_SHUFFLE_XVSHUF4I().
|
static |
Lower VECTOR_SHUFFLE into XVEXTRINS (if possible).
Definition at line 3072 of file LoongArchISelLowering.cpp.
References llvm::sampleprof::Base, llvm::SmallVectorTemplateCommon< T, typename >::begin(), DL, llvm::ISD::EXTRACT_VECTOR_ELT, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::MVT::getVectorElementType(), llvm::MVT::getVectorNumElements(), llvm::SmallVectorImpl< T >::insert(), llvm::ISD::INSERT_VECTOR_ELT, llvm::MVT::isFloatingPoint(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), SDValue(), llvm::SmallVectorTemplateCommon< T, typename >::size(), Subtarget, and llvm::V1.
Referenced by lower256BitShuffle().
|
static |
Lower VECTOR_SHUFFLE into XVILVH (if possible).
Definition at line 2927 of file LoongArchISelLowering.cpp.
References DL, llvm::End, fitsRegularPattern(), llvm::SelectionDAG::getNode(), SDValue(), and llvm::V1.
Referenced by lower256BitShuffle().
|
static |
Lower VECTOR_SHUFFLE into XVILVL (if possible).
Definition at line 2966 of file LoongArchISelLowering.cpp.
References DL, llvm::End, fitsRegularPattern(), llvm::SelectionDAG::getNode(), SDValue(), and llvm::V1.
Referenced by lower256BitShuffle().
|
static |
Lower VECTOR_SHUFFLE into XVINSVE0 (if possible).
Definition at line 3154 of file LoongArchISelLowering.cpp.
References assert(), llvm::sampleprof::Base, DL, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::MVT::getVectorNumElements(), SDValue(), Subtarget, and llvm::V1.
Referenced by lower256BitShuffle().
|
static |
Lower VECTOR_SHUFFLE into XVPACKEV (if possible).
Definition at line 2913 of file LoongArchISelLowering.cpp.
References DL, lowerVECTOR_SHUFFLE_VPACKEV(), and llvm::V1.
Referenced by lower256BitShuffle().
|
static |
Lower VECTOR_SHUFFLE into XVPACKOD (if possible).
Definition at line 2920 of file LoongArchISelLowering.cpp.
References DL, lowerVECTOR_SHUFFLE_VPACKOD(), and llvm::V1.
Referenced by lower256BitShuffle().
|
static |
Lower VECTOR_SHUFFLE into XVPERM (if possible).
Definition at line 2870 of file LoongArchISelLowering.cpp.
References DL, llvm::SelectionDAG::getBuildVector(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getUNDEF(), llvm::MVT::getVectorNumElements(), inRange(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), SDValue(), Subtarget, and llvm::V1.
Referenced by lower256BitShuffle().
|
static |
Lower VECTOR_SHUFFLE into XVPERMI (if possible).
Definition at line 2832 of file LoongArchISelLowering.cpp.
References buildVPERMIInfo(), DL, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::MVT::getVectorNumElements(), SDValue(), Subtarget, and llvm::V1.
Referenced by lower256BitShuffle().
|
static |
Lower VECTOR_SHUFFLE into XVPERMI_Q (if possible).
For example: %2 = shufflevector <4 x i64> %0, <4 x i64> %1, <4 x i32> <i32 2, i32 3, i32 4, i32 5> is lowered to: (XVPERMI_Q $xr1, $xr0, 33)
Definition at line 3379 of file LoongArchISelLowering.cpp.
References DL, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::Hi, Lo, SDValue(), Subtarget, llvm::V1, and llvm::widenShuffleMaskElts().
Referenced by lower256BitShuffle().
|
static |
Lower VECTOR_SHUFFLE into XVPICKEV (if possible).
Definition at line 3000 of file LoongArchISelLowering.cpp.
References DL, llvm::End, fitsRegularPattern(), llvm::SelectionDAG::getNode(), SDValue(), and llvm::V1.
Referenced by lower256BitShuffle().
|
static |
Lower VECTOR_SHUFFLE into XVPICKOD (if possible).
Definition at line 3035 of file LoongArchISelLowering.cpp.
References DL, llvm::End, fitsRegularPattern(), llvm::SelectionDAG::getNode(), SDValue(), and llvm::V1.
Referenced by lower256BitShuffle().
|
static |
Lower VECTOR_SHUFFLE into XVREPLVE0 (if possible).
It is a XVREPLVE0 when the VECTOR_SHUFFLE is a broadcast of element 0, i.e. the mask is: <0, 0, 0, ...>
When undef's appear in the mask they are treated as if they were whatever value is necessary in order to fit the above form.
Definition at line 2821 of file LoongArchISelLowering.cpp.
References DL, llvm::SelectionDAG::getNode(), llvm::ShuffleVectorInst::isZeroEltSplatMask(), SDValue(), and llvm::V1.
Referenced by lower256BitShuffle().
|
static |
Lower VECTOR_SHUFFLE into XVREPLVEI (if possible).
It is a XVREPLVEI when the mask is: <x, x, x, ..., x+n, x+n, x+n, ...> where the number of x is equal to n and n is half the length of vector.
When undef's appear in the mask they are treated as if they were whatever value is necessary in order to fit the above form.
Definition at line 2749 of file LoongArchISelLowering.cpp.
References assert(), DL, llvm::End, fitsRegularPattern(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getUNDEF(), SDValue(), Subtarget, and llvm::V1.
Referenced by lower256BitShuffle().
|
static |
Lower VECTOR_SHUFFLE into XVSHUF (if possible).
Definition at line 3200 of file LoongArchISelLowering.cpp.
References assert(), llvm::MVT::changeVectorElementTypeToInteger(), DL, llvm::End, llvm::SelectionDAG::getBuildVector(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getTargetConstant(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), SDValue(), llvm::SmallVectorTemplateCommon< T, typename >::size(), and llvm::V1.
Referenced by lower256BitShuffle().
|
static |
Lower VECTOR_SHUFFLE into XVSHUF4I (if possible).
Definition at line 2783 of file LoongArchISelLowering.cpp.
References DL, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), lowerVECTOR_SHUFFLE_VSHUF4I(), SDValue(), Subtarget, and llvm::V1.
Referenced by lower256BitShuffle().
|
static |
Lower VECTOR_SHUFFLE as byte rotate (if possible).
For example: shuffle = shufflevector <2 x i64> a, <2 x i64> b, <2 x i32> <i32 3, i32 0> is lowered to: (VBSRL_V $v1, $v1, 8) (VBSLL_V $v0, $v0, 8) (VOR_V $v0, $V0, $v1)
Definition at line 1956 of file LoongArchISelLowering.cpp.
References DL, llvm::SelectionDAG::getBitcast(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::MVT::getSizeInBits(), llvm::MVT::getVectorVT(), llvm::Hi, Lo, matchShuffleAsByteRotate(), llvm::ISD::OR, SDValue(), Subtarget, and llvm::V1.
Referenced by lower128BitShuffle(), and lower256BitShuffle().
|
static |
Lower VECTOR_SHUFFLE as lane permute and then shuffle (if possible).
Only for 256-bit vector.
Each 128-bit lane of the result may use at most two lanes of the inputs. These lanes are first moved into place, then shuffled within the lane.
For example: %2 = shufflevector <4 x i64> %0, <4 x i64> posion, <4 x i64> <i32 0, i32 3, i32 2, i32 0> is lowerded to: (XVPERMI $xr2, $xr0, 78) (XVSHUF $xr1, $xr2, $xr0) (XVORI $xr0, $xr1, 0)
and the splice: %2 = shufflevector <8 x i32> %0, <8 x i32> %1, <8 x i32> <i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14> is lowered to: (XVBSLL_V $xr2, $xr1, 4) (XVPERMI_Q $xr1, $xr0, 33) (XVBSRL_V $xr0, $xr1, 12) (XVOR_V $xr0, $xr2, $xr0)
Definition at line 3419 of file LoongArchISelLowering.cpp.
References AbstractManglingParser< Derived, Alloc >::Ops, assert(), DL, llvm::dyn_cast(), llvm::SelectionDAG::getVectorShuffle(), llvm::MVT::is256BitVector(), isRepeatedShuffleMask(), SDValue(), llvm::Size, std::swap(), and llvm::V1.
Referenced by lower256BitShuffle().
|
static |
Lower VECTOR_SHUFFLE as shift (if possible).
For example: %2 = shufflevector <4 x i32> %0, <4 x i32> zeroinitializer, <4 x i32> <i32 4, i32 0, i32 1, i32 2> is lowered to: (VBSLL_V $v0, $v0, 4)
%2 = shufflevector <4 x i32> %0, <4 x i32> zeroinitializer, <4 x i32> <i32 4, i32 0, i32 4, i32 2> is lowered to: (VSLLI_D $v0, $v0, 32)
Definition at line 1756 of file LoongArchISelLowering.cpp.
References assert(), DL, llvm::SelectionDAG::getBitcast(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::MVT::getScalarSizeInBits(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::MVT::getVectorNumElements(), llvm::TargetLoweringBase::isTypeLegal(), matchShuffleAsShift(), SDValue(), llvm::Size, Subtarget, V, and llvm::V1.
Referenced by lower128BitShuffle(), and lower256BitShuffle().
|
static |
Lower VECTOR_SHUFFLE as ZERO_EXTEND Or ANY_EXTEND (if possible).
For example: %2 = shufflevector <4 x i32> %0, <4 x i32> zeroinitializer, <4 x i32> <i32 0, i32 4, i32 1, i32 4> %3 = bitcast <4 x i32> %2 to <2 x i64> is lowered to: (VREPLI $v1, 0) (VILVL $v0, $v1, $v0)
Definition at line 1989 of file LoongArchISelLowering.cpp.
References DL, llvm::SelectionDAG::getBitcast(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getFreeze(), llvm::MVT::getIntegerVT(), llvm::SelectionDAG::getNode(), llvm::MVT::getScalarSizeInBits(), llvm::MVT::getSizeInBits(), llvm::MVT::getVectorNumElements(), llvm::MVT::getVectorVT(), llvm::APInt::isAllOnes(), llvm::Lower, Lower, llvm::Offset, SDValue(), V, and llvm::V1.
Referenced by lower128BitShuffle().
|
static |
Definition at line 7829 of file LoongArchISelLowering.cpp.
References llvm::ISD::AND, DL, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getNOT(), llvm::ISD::SHL, and truncateVecElts().
Referenced by performINTRINSIC_WO_CHAINCombine().
|
static |
Definition at line 7841 of file LoongArchISelLowering.cpp.
References llvm::ISD::AND, llvm::cast(), DL, llvm::LLVMContext::emitError(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getContext(), llvm::SelectionDAG::getNode(), llvm::EVT::getScalarSizeInBits(), llvm::isUInt(), and llvm::ISD::UNDEF.
Referenced by performINTRINSIC_WO_CHAINCombine().
|
static |
Definition at line 7876 of file LoongArchISelLowering.cpp.
References llvm::cast(), DL, llvm::LLVMContext::emitError(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getContext(), llvm::SelectionDAG::getNode(), llvm::EVT::getScalarSizeInBits(), Imm, llvm::isUInt(), llvm::ISD::UNDEF, and llvm::ISD::XOR.
Referenced by performINTRINSIC_WO_CHAINCombine().
|
static |
Definition at line 7859 of file LoongArchISelLowering.cpp.
References llvm::cast(), DL, llvm::LLVMContext::emitError(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getContext(), llvm::SelectionDAG::getNode(), llvm::EVT::getScalarSizeInBits(), Imm, llvm::isUInt(), llvm::ISD::OR, and llvm::ISD::UNDEF.
Referenced by performINTRINSIC_WO_CHAINCombine().
|
static |
Definition at line 7893 of file LoongArchISelLowering.cpp.
References DL, llvm::LLVMContext::emitError(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getContext(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getUNDEF(), llvm::SDValue::getValueType(), llvm::SelectionDAG::getValueType(), llvm::EVT::getVectorElementType(), Imm, llvm::isUInt(), and N.
Referenced by performINTRINSIC_WO_CHAINCombine().
|
static |
Definition at line 7802 of file LoongArchISelLowering.cpp.
References llvm::cast(), DL, llvm::LLVMContext::emitError(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getContext(), llvm::SelectionDAG::getNode(), llvm::EVT::getScalarType(), llvm::EVT::getSizeInBits(), llvm::isInt(), llvm::isUInt(), and llvm::ISD::UNDEF.
Referenced by performINTRINSIC_WO_CHAINCombine().
Definition at line 7503 of file LoongArchISelLowering.cpp.
References llvm::ISD::ADD, Opc, llvm::ISD::OR, SDValue(), stripSignExtendInReg(), llvm::ISD::SUB, X, and llvm::ISD::XOR.
Referenced by performSELECTCombine().
Definition at line 6321 of file LoongArchISelLowering.cpp.
References llvm::dyn_cast(), llvm::ISD::EXTRACT_VECTOR_ELT, N, and SDValue().
Referenced by performHorizWideningCombine().
Definition at line 6638 of file LoongArchISelLowering.cpp.
References llvm::dyn_cast(), llvm::ISD::EXTRACT_SUBVECTOR, llvm::ISD::EXTRACT_VECTOR_ELT, llvm::SDValue::getOpcode(), llvm::SDNode::getOperand(), llvm::SDValue::getOperand(), llvm::EVT::getSizeInBits(), llvm::EVT::getVectorNumElements(), I, llvm::EVT::is128BitVector(), llvm::EVT::is256BitVector(), llvm::SDValue::isUndef(), llvm::EVT::isVector(), N, llvm::peekThroughBitcasts(), and SDValue().
Referenced by performEXTENDCombine(), and performSHLCombine().
|
static |
Definition at line 1236 of file LoongArchISelLowering.cpp.
References assert(), CC, llvm::SDNode::getOpcode(), llvm::SDValue::getOperand(), llvm::SDValue::getOperandCondCode(), llvm::ISD::getSetCCInverse(), llvm::ISD::getSetCCSwappedOperands(), llvm::SDValue::getValueType(), LHS, RHS, and llvm::ISD::SETCC.
Referenced by combineSelectToBinOp(), and lowerSelectToBinOp().
Attempts to match vector shuffle as byte rotation.
Definition at line 1881 of file LoongArchISelLowering.cpp.
References assert(), llvm::Hi, isRepeatedShuffleMask(), Lo, llvm::SmallVectorTemplateCommon< T, typename >::size(), and llvm::V1.
Referenced by lowerShuffleAsByteRotate(), lowerVECTOR_SHUFFLEAsByteRotate(), and matchBinaryPermuteShuffle().
|
static |
Attempts to match a shuffle mask against the VBSLL, VBSRL, VSLLI and VSRLI instruction.
Definition at line 1681 of file LoongArchISelLowering.cpp.
References llvm::MVT::getIntegerVT(), llvm::MVT::getVectorVT(), isSequentialOrUndefInRange(), llvm::Left, llvm::Low, and llvm::Size.
Referenced by lowerShuffleAsShift(), lowerVECTOR_SHUFFLEAsShift(), and matchUnaryPermuteShuffle().
|
static |
Definition at line 8632 of file LoongArchISelLowering.cpp.
References llvm::ISD::CONCAT_VECTORS, DL, llvm::ISD::EXTRACT_SUBVECTOR, llvm::SelectionDAG::getBitcast(), llvm::SelectionDAG::getNode(), llvm::MVT::getScalarSizeInBits(), llvm::MVT::getScalarType(), llvm::MVT::getSizeInBits(), llvm::SelectionDAG::getUNDEF(), llvm::SelectionDAG::getVectorIdxConstant(), llvm::SelectionDAG::getVectorShuffle(), llvm::MVT::getVectorVT(), llvm::Hi, Lo, N, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorTemplateCommon< T, typename >::size(), and llvm::Undef.
Referenced by performFP_TO_INTCombine(), and performSINT_TO_FPCombine().
|
static |
Definition at line 6426 of file LoongArchISelLowering.cpp.
References llvm::ISD::AND, DL, llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::EVT::getSizeInBits(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::EVT::getVectorElementType(), llvm::TargetLowering::DAGCombinerInfo::isBeforeLegalizeOps(), isConstantSplatVector(), llvm::EVT::isInteger(), llvm::TargetLoweringBase::isTypeLegal(), llvm::EVT::isVector(), N, performHorizWideningCombine(), SDValue(), llvm::ISD::SRA, llvm::ISD::SRL, Subtarget, V, and X.
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine(), llvm::MipsTargetLowering::PerformDAGCombine(), and llvm::RISCVTargetLowering::PerformDAGCombine().
|
static |
Definition at line 6543 of file LoongArchISelLowering.cpp.
References combineAndNotIntoVANDN(), DL, llvm::dyn_cast(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::ConstantSDNode::getSExtValue(), llvm::EVT::getSizeInBits(), llvm::ConstantSDNode::getZExtValue(), llvm::TargetLowering::DAGCombinerInfo::isBeforeLegalizeOps(), llvm::isShiftedMask_64(), N, SDValue(), llvm::ISD::SHL, llvm::ISD::SRA, llvm::ISD::SRL, Subtarget, uint64_t, and llvm::SDNode::use_size().
|
static |
Definition at line 6944 of file LoongArchISelLowering.cpp.
References checkBitcastSrcVectorSize(), DL, llvm::SelectionDAG::getBitcast(), llvm::SelectionDAG::getContext(), llvm::EVT::getIntegerVT(), llvm::SelectionDAG::getNode(), llvm::EVT::getScalarType(), llvm::SelectionDAG::getShiftAmountConstant(), llvm::EVT::getSimpleVT(), llvm::EVT::getSizeInBits(), llvm::EVT::getVectorNumElements(), llvm::SelectionDAG::getZExtOrTrunc(), llvm::Hi, llvm::TargetLowering::DAGCombinerInfo::isBeforeLegalizeOps(), llvm::EVT::isSimple(), Lo, N, Opc, llvm::ISD::OR, performSETCC_BITCASTCombine(), SDValue(), llvm::ISD::SETCC, llvm::ISD::SHL, llvm::ISD::SIGN_EXTEND, signExtendBitcastSrcVector(), llvm::MVT::SimpleTy, llvm::SelectionDAG::SplitVector(), Subtarget, T, and V.
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine().
|
static |
Definition at line 7592 of file LoongArchISelLowering.cpp.
References llvm::SelectionDAG::getNode(), llvm::TargetLowering::DAGCombinerInfo::isBeforeLegalizeOps(), N, SDValue(), and Subtarget.
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine().
|
static |
Definition at line 7710 of file LoongArchISelLowering.cpp.
References llvm::cast(), CC, combine_CC(), DL, foldVMskZeroTest(), llvm::get(), llvm::SelectionDAG::getCondCode(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), LHS, N, RHS, SDValue(), llvm::ISD::SETNE, Subtarget, and V.
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine().
|
static |
Definition at line 8941 of file LoongArchISelLowering.cpp.
References combineFP_ROUND(), DL, llvm::EVT::isVector(), N, SDValue(), and Subtarget.
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine(), and llvm::RISCVTargetLowering::PerformDAGCombine().
|
static |
Definition at line 8496 of file LoongArchISelLowering.cpp.
References llvm::APInt::getAllOnes(), llvm::MVT::getScalarSizeInBits(), llvm::SelectionDAG::getTargetLoweringInfo(), N, SDValue(), and TLI.
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine().
|
static |
Definition at line 8915 of file LoongArchISelLowering.cpp.
References DL, llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::TargetLoweringBase::isTypeLegal(), llvm::EVT::isVector(), matchHalfOf128BitLanes(), N, PromoteMaskArithmetic(), SDValue(), llvm::ISD::SIGN_EXTEND, Subtarget, and llvm::ISD::ZERO_EXTEND.
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine().
|
static |
Definition at line 8764 of file LoongArchISelLowering.cpp.
References DL, llvm::ISD::FP_TO_SINT, llvm::MVT::getIntegerVT(), llvm::SelectionDAG::getNode(), llvm::EVT::getScalarSizeInBits(), llvm::EVT::getSizeInBits(), llvm::EVT::getVectorNumElements(), llvm::MVT::getVectorVT(), llvm::isPowerOf2_32(), llvm::EVT::isSimple(), llvm::EVT::isVector(), MergeBlocksConvert(), N, SDValue(), Subtarget, and llvm::ISD::TRUNCATE.
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine(), and llvm::RISCVTargetLowering::PerformDAGCombine().
|
static |
Definition at line 6361 of file LoongArchISelLowering.cpp.
References llvm::ISD::ADD, assert(), DL, llvm::SelectionDAG::getNode(), llvm::EVT::getSizeInBits(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::SDValue::getValueType(), llvm::EVT::getVectorElementType(), llvm::EVT::isInteger(), isSigned(), llvm::EVT::isVector(), LHS, matchDeinterleaveBuildVector(), N, Opc, RHS, SDValue(), llvm::ISD::SIGN_EXTEND, llvm::ISD::SUB, Subtarget, TLI, and llvm::ISD::ZERO_EXTEND.
Referenced by performADDCombine(), and performSUBCombine().
|
static |
Definition at line 7909 of file LoongArchISelLowering.cpp.
References llvm::ISD::ADD, llvm::ISD::AND, llvm::ISD::ANY_EXTEND, llvm::ISD::CONCAT_VECTORS, llvm::ISD::CTLZ, llvm::ISD::CTPOP, DL, llvm::ISD::FADD, llvm::ISD::FDIV, llvm::ISD::FMA, llvm::ISD::FMUL, llvm::ISD::FSUB, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getNOT(), llvm::SDNode::getValueType(), llvm::ISD::INSERT_VECTOR_ELT, legalizeIntrinsicImmArg(), lowerVectorBitClear(), lowerVectorBitClearImm(), lowerVectorBitRevImm(), lowerVectorBitSetImm(), lowerVectorPickVE2GR(), lowerVectorSplatImm(), llvm::ISD::MUL, N, llvm::ISD::OR, llvm::ISD::SDIV, SDValue(), llvm::ISD::SHL, llvm::ISD::SMAX, llvm::ISD::SMIN, llvm::ISD::SRA, llvm::ISD::SREM, llvm::ISD::SRL, llvm::ISD::SUB, Subtarget, truncateVecElts(), llvm::ISD::UDIV, llvm::ISD::UMAX, llvm::ISD::UMIN, llvm::ISD::UREM, and llvm::ISD::XOR.
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine().
|
static |
Definition at line 8480 of file LoongArchISelLowering.cpp.
References assert(), llvm::SDNode::getOpcode(), llvm::SDValue::getOperand(), llvm::SDValue::getValueType(), N, SDValue(), and Subtarget.
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine().
|
static |
Definition at line 8468 of file LoongArchISelLowering.cpp.
References llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), N, SDValue(), and Subtarget.
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine().
|
static |
Definition at line 7039 of file LoongArchISelLowering.cpp.
References llvm::ISD::AND, llvm::SelectionDAG::computeKnownBits(), llvm::dbgs(), DL, llvm::dyn_cast(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::ConstantSDNode::getSExtValue(), llvm::SelectionDAG::getSignedConstant(), llvm::EVT::getSizeInBits(), llvm::ConstantSDNode::getZExtValue(), llvm::TargetLowering::DAGCombinerInfo::isBeforeLegalizeOps(), llvm::isShiftedMask_64(), llvm::APInt::isSubsetOf(), LLVM_DEBUG, N, SDValue(), llvm::ISD::SHL, llvm::ISD::SRL, Subtarget, std::swap(), and llvm::KnownBits::Zero.
|
static |
Definition at line 7733 of file LoongArchISelLowering.cpp.
References llvm::ISD::ADD, llvm::ISD::AND, llvm::cast(), CC, combine_CC(), DL, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getSignedConstant(), llvm::isa(), llvm::isInt(), llvm::isNullConstant(), LHS, N, RHS, SDValue(), llvm::ISD::SETGE, llvm::ISD::SETLT, llvm::ISD::SRA, Subtarget, and std::swap().
|
static |
Definition at line 7535 of file LoongArchISelLowering.cpp.
References Cond, DL, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getSelect(), llvm::SelectionDAG::getValueType(), llvm::TargetLowering::DAGCombinerInfo::isBeforeLegalizeOps(), matchBinOpWithSharedOperand(), N, Opc, SDValue(), llvm::ISD::SIGN_EXTEND_INREG, Subtarget, and Zero.
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine(), llvm::MipsTargetLowering::PerformDAGCombine(), and llvm::RISCVTargetLowering::PerformDAGCombine().
|
static |
Definition at line 6871 of file LoongArchISelLowering.cpp.
References llvm::ISD::DELETED_NODE, DL, llvm::SelectionDAG::getBitcast(), llvm::SelectionDAG::getContext(), llvm::EVT::getIntegerVT(), llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOperand(), llvm::EVT::getSizeInBits(), llvm::EVT::getVectorElementType(), llvm::EVT::getVectorNumElements(), llvm::SelectionDAG::getZExtOrTrunc(), llvm::ISD::isBuildVectorAllOnes(), llvm::ISD::isBuildVectorAllZeros(), N, Opc, SDValue(), llvm::ISD::SETCC, llvm::ISD::SETEQ, llvm::ISD::SETGE, llvm::ISD::SETGT, llvm::ISD::SETLE, llvm::ISD::SETLT, llvm::ISD::SETNE, Subtarget, T, and V.
Referenced by performBITCASTCombine().
|
static |
Definition at line 7394 of file LoongArchISelLowering.cpp.
References llvm::ISD::AND, CC, checkValueWidth(), llvm::dyn_cast(), foldVMskZeroTest(), llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::SDNode::getOpcode(), llvm::SDValue::getOpcode(), llvm::SDNode::getOperand(), llvm::SDValue::getOperand(), llvm::SelectionDAG::getSetCC(), llvm::SDNode::getValueType(), llvm::ConstantSDNode::isAllOnes(), llvm::ConstantSDNode::isZero(), N, llvm::SelectionDAG::ReplaceAllUsesWith(), SDValue(), llvm::ISD::SETEQ, llvm::ISD::SETNE, llvm::ISD::SEXTLOAD, Subtarget, llvm::ISD::TRUNCATE, V, llvm::ISD::XOR, llvm::ISD::ZERO_EXTEND, and llvm::ISD::ZEXTLOAD.
|
static |
Definition at line 6715 of file LoongArchISelLowering.cpp.
References assert(), DL, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::EVT::getSizeInBits(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::SDValue::getValueType(), llvm::EVT::getVectorElementType(), Imm, isConstantSplatVector(), isSigned(), llvm::TargetLoweringBase::isTypeLegal(), LHS, matchHalfOf128BitLanes(), N, Opc, RHS, SDValue(), llvm::ISD::SHL, llvm::ISD::SIGN_EXTEND, Subtarget, and llvm::ISD::ZERO_EXTEND.
|
static |
Definition at line 8682 of file LoongArchISelLowering.cpp.
References llvm::cast(), DL, ExtendSrcToDst(), llvm::MemSDNode::getAlign(), llvm::LoadSDNode::getBasePtr(), llvm::MemSDNode::getChain(), llvm::MachineMemOperand::getFlags(), llvm::SelectionDAG::getLoad(), llvm::MemSDNode::getMemOperand(), llvm::SelectionDAG::getNode(), llvm::MemSDNode::getPointerInfo(), llvm::EVT::getScalarSizeInBits(), llvm::EVT::getSizeInBits(), llvm::EVT::getVectorNumElements(), llvm::ISD::isNormalLoad(), llvm::isPowerOf2_32(), llvm::EVT::isSimple(), llvm::EVT::isVector(), llvm::Load, MergeBlocksConvert(), N, llvm::SelectionDAG::ReplaceAllUsesOfValueWith(), SDValue(), llvm::ISD::SIGN_EXTEND, and Subtarget.
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine().
|
static |
Definition at line 8511 of file LoongArchISelLowering.cpp.
References C(), llvm::TargetLowering::DAGCombinerInfo::CombineTo(), DL, llvm::dyn_cast(), llvm::SelectionDAG::getConstant(), llvm::SDNode::getOpcode(), llvm::SDValue::getOperand(), llvm::SelectionDAG::getUNDEF(), llvm::Hi, llvm::SDNode::isUndef(), Lo, N, SDValue(), Subtarget, and V.
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine().
|
static |
Definition at line 6760 of file LoongArchISelLowering.cpp.
References llvm::ISD::AND, DL, llvm::dyn_cast(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDNode::getOperand(), llvm::SDValue::getOperand(), llvm::ConstantSDNode::getZExtValue(), llvm::TargetLowering::DAGCombinerInfo::isBeforeLegalizeOps(), llvm::isShiftedMask_64(), N, SDValue(), Subtarget, and uint64_t.
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine(), llvm::MipsSETargetLowering::PerformDAGCombine(), and llvm::RISCVTargetLowering::PerformDAGCombine().
|
static |
Definition at line 6805 of file LoongArchISelLowering.cpp.
References N, performHorizWideningCombine(), SDValue(), Subtarget, and V.
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine(), llvm::MipsTargetLowering::PerformDAGCombine(), and llvm::RISCVTargetLowering::PerformDAGCombine().
|
static |
Definition at line 8746 of file LoongArchISelLowering.cpp.
References DL, ExtendSrcToDst(), llvm::EVT::isVector(), N, SDValue(), Subtarget, and llvm::ISD::ZERO_EXTEND.
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine().
|
static |
Do target-specific dag combines on LoongArchISD::VANDN nodes.
Definition at line 8542 of file LoongArchISelLowering.cpp.
References llvm::ISD::AND, llvm::ISD::BUILD_VECTOR, C(), llvm::cast(), DL, llvm::dyn_cast(), llvm::SelectionDAG::getBitcast(), llvm::SelectionDAG::getConstant(), llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getNOT(), llvm::SDValue::getOpcode(), llvm::SelectionDAG::getSplat(), llvm::SelectionDAG::getTargetConstant(), llvm::SDNode::hasOneUse(), llvm::TargetLowering::DAGCombinerInfo::isBeforeLegalizeOps(), llvm::ISD::isBuildVectorAllOnes(), llvm::ISD::isBuildVectorAllZeros(), isNOT(), llvm::SDNode::isOnlyUserOf(), llvm::SDValue::isUndef(), N, llvm::ISD::OR, SDValue(), and Subtarget.
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine().
|
static |
Definition at line 8954 of file LoongArchISelLowering.cpp.
References llvm::ISD::ADD, llvm::ISD::AND, Cond, DL, llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::EVT::getSizeInBits(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::EVT::getVectorElementType(), llvm::TargetLowering::DAGCombinerInfo::isBeforeLegalizeOps(), isConstantSplatVector(), llvm::ISD::isConstantSplatVectorAllOnes(), llvm::ISD::isConstantSplatVectorAllZeros(), llvm::EVT::isInteger(), llvm::TargetLoweringBase::isTypeLegal(), llvm::EVT::isVector(), N, llvm::peekThroughBitcasts(), SDValue(), llvm::ISD::SETCC, llvm::ISD::SETEQ, llvm::ISD::SRA, llvm::ISD::SRL, Subtarget, and X.
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine(), llvm::MipsSETargetLowering::PerformDAGCombine(), and llvm::RISCVTargetLowering::PerformDAGCombine().
|
static |
Definition at line 8821 of file LoongArchISelLowering.cpp.
References llvm::Depth, DL, llvm::SelectionDAG::FoldConstantArithmetic(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::SDValue::getValueType(), llvm::SDValue::hasOneUse(), llvm::EVT::is256BitVector(), llvm::ISD::isBitwiseLogicOp(), llvm::ISD::isExtVecInRegOpcode(), llvm::SelectionDAG::MaxRecursionDepth, N, PromoteMaskArithmetic(), SDValue(), Subtarget, TLI, llvm::ISD::TRUNCATE, and llvm::ISD::ZERO_EXTEND.
Referenced by combineSext(), combineSignExtendInReg(), combineZext(), performEXTENDCombine(), PromoteMaskArithmetic(), PromoteMaskArithmetic(), PromoteMaskArithmetic(), and PromoteMaskArithmetic().
|
static |
Definition at line 8882 of file LoongArchISelLowering.cpp.
References llvm::ISD::ANY_EXTEND, assert(), DL, llvm::SelectionDAG::getNode(), llvm::SDValue::getValueType(), llvm::SelectionDAG::getValueType(), llvm::SelectionDAG::getZeroExtendInReg(), llvm::EVT::is256BitVector(), llvm::EVT::isVector(), llvm_unreachable, N, PromoteMaskArithmetic(), SDValue(), llvm::ISD::SIGN_EXTEND, llvm::ISD::SIGN_EXTEND_INREG, Subtarget, and llvm::ISD::ZERO_EXTEND.
|
static |
Definition at line 5738 of file LoongArchISelLowering.cpp.
References AbstractManglingParser< Derived, Alloc >::Ops, llvm::Acquire, llvm::AcquireRelease, assert(), llvm::ISD::BUILD_PAIR, llvm::cast(), DL, llvm::SelectionDAG::getMachineNode(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getVTList(), llvm_unreachable, llvm::Monotonic, N, llvm::Release, Results, SDValue(), llvm::SequentiallyConsistent, llvm::SelectionDAG::setNodeMemRefs(), and llvm::SelectionDAG::SplitScalar().
Referenced by llvm::LoongArchTargetLowering::ReplaceNodeResults().
|
static |
Definition at line 5671 of file LoongArchISelLowering.cpp.
References llvm_unreachable, N, replaceVecCondBranchResults(), replaceVPICKVE2GRResults(), Results, and Subtarget.
Referenced by llvm::LoongArchTargetLowering::ReplaceNodeResults().
|
static |
Definition at line 5657 of file LoongArchISelLowering.cpp.
References DL, llvm::SelectionDAG::getNode(), llvm::SDValue::getValue(), N, Results, Subtarget, and llvm::ISD::TRUNCATE.
Referenced by replaceINTRINSIC_WO_CHAINResults().
|
static |
Definition at line 5636 of file LoongArchISelLowering.cpp.
References DL, emitErrorAndReplaceIntrinsicResults(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::SDValue::getValue(), llvm::SDValue::getValueType(), llvm::SelectionDAG::getValueType(), llvm::EVT::getVectorElementType(), Imm, llvm::isUInt(), Results, Subtarget, and llvm::ISD::TRUNCATE.
Referenced by replaceINTRINSIC_WO_CHAINResults().
|
static |
Definition at line 6845 of file LoongArchISelLowering.cpp.
References llvm::ISD::AND, llvm::ISD::BUILD_VECTOR, DL, llvm::ISD::FREEZE, llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getSelect(), llvm_unreachable, llvm::ISD::OR, llvm::ISD::SELECT, llvm::ISD::SETCC, llvm::ISD::SIGN_EXTEND, signExtendBitcastSrcVector(), llvm::ISD::TRUNCATE, llvm::ISD::VSELECT, and llvm::ISD::XOR.
Referenced by combineBitcastvxi1(), performBITCASTCombine(), signExtendBitcastSrcVector(), and signExtendBitcastSrcVector().
| STATISTIC | ( | NumTailCalls | , |
| "Number of tail calls" | ) |
Definition at line 7479 of file LoongArchISelLowering.cpp.
References llvm::cast(), llvm::ISD::SIGN_EXTEND_INREG, and V.
Referenced by matchBinOpWithSharedOperand().
|
static |
Definition at line 1392 of file LoongArchISelLowering.cpp.
References llvm::ISD::AND, llvm::bit_width(), C(), CC, DL, llvm::dyn_cast(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), llvm::ISD::getSetCCSwappedOperands(), llvm::isa(), llvm::isInt(), llvm::isMask_64(), llvm::isNullConstant(), llvm::isPowerOf2_64(), LHS, llvm::Log2_64(), RHS, llvm::ISD::SETEQ, llvm::ISD::SETGE, llvm::ISD::SETGT, llvm::ISD::SETLE, llvm::ISD::SETLT, llvm::ISD::SETUGT, llvm::ISD::SETULE, llvm::ISD::SHL, std::swap(), and uint64_t.
Referenced by combine_CC(), and combine_CC().
|
static |
Definition at line 7821 of file LoongArchISelLowering.cpp.
References llvm::ISD::AND, DL, llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getNode(), and llvm::SDValue::getScalarValueSizeInBits().
Referenced by lowerMSABitClear(), lowerVectorBitClear(), and performINTRINSIC_WO_CHAINCombine().
|
static |
Definition at line 10123 of file LoongArchISelLowering.cpp.
References assert(), llvm::MachineFrameInfo::CreateFixedObject(), DL, llvm::SelectionDAG::getCopyFromReg(), llvm::MachinePointerInfo::getFixedStack(), llvm::SelectionDAG::getFrameIndex(), llvm::MachineFunction::getFrameInfo(), llvm::SelectionDAG::getLoad(), llvm::CCValAssign::getLocMemOffset(), llvm::CCValAssign::getLocReg(), llvm::CCValAssign::getLocVT(), llvm::SelectionDAG::getMachineFunction(), llvm::SelectionDAG::getNode(), llvm::MachineFunction::getRegInfo(), llvm::CCValAssign::getValVT(), llvm::Hi, llvm::CCValAssign::isMemLoc(), llvm::CCValAssign::isRegLoc(), and Lo.
Referenced by llvm::LoongArchTargetLowering::LowerFormalArguments().
|
static |
Definition at line 10098 of file LoongArchISelLowering.cpp.
References llvm::CCValAssign::BCvt, llvm::MachineFrameInfo::CreateFixedObject(), DL, llvm::CCValAssign::Full, llvm::SelectionDAG::getDataLayout(), llvm::SelectionDAG::getExtLoad(), llvm::MachinePointerInfo::getFixedStack(), llvm::SelectionDAG::getFrameIndex(), llvm::MachineFunction::getFrameInfo(), llvm::MVT::getIntegerVT(), llvm::CCValAssign::getLocInfo(), llvm::CCValAssign::getLocMemOffset(), llvm::CCValAssign::getLocVT(), llvm::SelectionDAG::getMachineFunction(), llvm::DataLayout::getPointerSizeInBits(), llvm::EVT::getStoreSize(), llvm::CCValAssign::getValVT(), llvm::CCValAssign::Indirect, llvm_unreachable, and llvm::ISD::NON_EXTLOAD.
|
static |
Definition at line 10065 of file LoongArchISelLowering.cpp.
References llvm::LoongArchMachineFunctionInfo::addSExt32Register(), llvm::BitWidth, convertLocVTToValVT(), DL, llvm::Function::getArg(), llvm::SelectionDAG::getCopyFromReg(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), llvm::Type::getIntegerBitWidth(), llvm::CCValAssign::getLocReg(), llvm::CCValAssign::getLocVT(), llvm::SelectionDAG::getMachineFunction(), llvm::MachineFunction::getRegInfo(), llvm::EVT::getSimpleVT(), llvm::Value::getType(), llvm::Type::isIntegerTy(), and TLI.
|
static |
Definition at line 1651 of file LoongArchISelLowering.cpp.
References DL, llvm::SelectionDAG::getBitcast(), llvm::MVT::getFloatingPointVT(), llvm::MVT::getIntegerVT(), llvm::MVT::getScalarSizeInBits(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::MVT::getVectorNumElements(), llvm::SelectionDAG::getVectorShuffle(), llvm::MVT::getVectorVT(), llvm::MVT::isFloatingPoint(), llvm::TargetLoweringBase::isTypeLegal(), SDValue(), llvm::V1, and llvm::widenShuffleMaskElts().
Referenced by lower128BitShuffle(), and lower256BitShuffle().
Definition at line 9757 of file LoongArchISelLowering.cpp.
Referenced by CC_LoongArch(), CC_RISCV_Impl(), and llvm::RISCV::getArgFPRs().
Definition at line 9761 of file LoongArchISelLowering.cpp.
Referenced by CC_LoongArch(), CC_RISCV_Impl(), and llvm::RISCV::getArgFPRs().
Definition at line 9730 of file LoongArchISelLowering.cpp.
Referenced by allocateArgGPR(), llvm::CC_CSKY_ABIV2_SOFT_64(), CC_LoongArch(), CC_RISCV_FastCC(), CC_RISCV_Impl(), CC_RISCVAssign2XLen(), llvm::LoongArchTargetLowering::LowerFormalArguments(), and llvm::Ret_CSKY_ABIV2_SOFT_64().
Definition at line 9765 of file LoongArchISelLowering.cpp.
Referenced by allocateRVVReg(), CC_LoongArch(), and llvm::RISCV::getArgVRs().
Definition at line 9769 of file LoongArchISelLowering.cpp.
Referenced by CC_LoongArch().
|
static |
Referenced by llvm::LoongArchTargetLowering::isFPImmCheapInGPR().
Definition at line 9746 of file LoongArchISelLowering.cpp.
Referenced by allocateArgGPR().