LLVM: lib/Target/LoongArch/LoongArchISelLowering.cpp File Reference (original) (raw)
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 |
| 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 | ArgFPR32s [] |
| const MCPhysReg | ArgFPR64s [] |
| const MCPhysReg | ArgVRs [] |
| const MCPhysReg | ArgXRs [] |
◆ ASRT_LE_GT_CASE
| #define ASRT_LE_GT_CASE | ( | NAME | ) |
|---|
Value:
case Intrinsic::loongarch_##NAME: { \
return !Subtarget.is64Bit() \
? emitIntrinsicErrorMessage(Op, ErrorMsgReqLA64, DAG) \
}
static SDValue emitIntrinsicErrorMessage(SDValue Op, StringRef ErrorMsg, SelectionDAG &DAG)
DWARFExpression::Operation Op
◆ CRC_CASE_EXT_BINARYOP
| #define CRC_CASE_EXT_BINARYOP | ( | NAME, |
|---|---|---|
| NODE ) |
Value:
case Intrinsic::loongarch_##NAME: { \
LoongArchISD::NODE, DL, {MVT::i64, MVT::Other}, \
break; \
}
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Function Alias Analysis Results
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation.
@ ANY_EXTEND
ANY_EXTEND - Used for integer types. The high bits are undefined.
@ TRUNCATE
TRUNCATE - Completely drop the high bits.
Referenced by llvm::LoongArchTargetLowering::ReplaceNodeResults().
◆ CRC_CASE_EXT_UNARYOP
| #define CRC_CASE_EXT_UNARYOP | ( | NAME, |
|---|---|---|
| NODE ) |
◆ CSR_CASE
Value:
case Intrinsic::loongarch_##ID: { \
if (!Subtarget.is64Bit()) \
emitErrorAndReplaceIntrinsicResults(N, Results, DAG, ErrorMsgReqLA64); \
break; \
}
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Referenced by llvm::LoongArchTargetLowering::ReplaceNodeResults().
◆ DEBUG_TYPE
#define DEBUG_TYPE "loongarch-isel-lowering"
◆ GET_REGISTER_MATCHER
#define GET_REGISTER_MATCHER
◆ IOCSRRD_CASE [1/2]
| #define IOCSRRD_CASE | ( | NAME, |
|---|---|---|
| NODE ) |
◆ IOCSRRD_CASE [2/2]
| #define IOCSRRD_CASE | ( | NAME, |
|---|---|---|
| NODE ) |
Value:
case Intrinsic::loongarch_##NAME: { \
DAG.getNode(LoongArchISD::NODE, DL, {MVT::i64, MVT::Other}, \
break; \
}
SDNode * getNode() const
get the SDNode which holds the desired result
SDValue getValue(unsigned R) const
◆ IOCSRWR_CASE
| #define IOCSRWR_CASE | ( | NAME, |
|---|---|---|
| NODE ) |
Value:
case Intrinsic::loongarch_##NAME: { \
return Subtarget.is64Bit() \
? DAG.getNode(LoongArchISD::NODE, DL, MVT::Other, Chain, \
: DAG.getNode(LoongArchISD::NODE, DL, MVT::Other, Chain, Op2, \
Op3); \
}
◆ MaterializeFPImm
| Enumerator |
|---|
| NoMaterializeFPImm |
| MaterializeFPImm2Ins |
| MaterializeFPImm3Ins |
| MaterializeFPImm4Ins |
| MaterializeFPImm5Ins |
| MaterializeFPImm6Ins |
Definition at line 46 of file LoongArchISelLowering.cpp.
◆ canonicalizeShuffleVectorByLane()
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.
- Shuffle high, low lanes of two inputs vector <0, 1, 2, 3> + <4, 5, 6, 7> — <0, 5, 3, 6>
- Shuffle low, high lanes of two inputs vector <0, 1, 2, 3> + <4, 5, 6, 7> — <3, 6, 0, 5>
- Shuffle low, low lanes of two inputs vector <0, 1, 2, 3> + <4, 5, 6, 7> — <3, 6, 3, 6>
- Shuffle high, high lanes of two inputs vector <0, 1, 2, 3> + <4, 5, 6, 7> — <0, 5, 0, 5>
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 2611 of file LoongArchISelLowering.cpp.
References DL, llvm::SelectionDAG::getBitcast(), llvm::SelectionDAG::getConstant(), llvm::LoongArchSubtarget::getGRLenVT(), llvm::SelectionDAG::getNode(), llvm::SDValue::isUndef(), and llvm::None.
Referenced by lower256BitShuffle().
◆ CC_LoongArch()
Definition at line 7763 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, 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().
◆ CC_LoongArch_GHC()
◆ CC_LoongArchAssign2GRLen()
◆ checkBitcastSrcVectorSize()
Definition at line 5339 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, Size, llvm::ISD::TRUNCATE, llvm::ISD::VSELECT, and llvm::ISD::XOR.
Referenced by checkBitcastSrcVectorSize(), checkBitcastSrcVectorSize(), combineBitcastvxi1(), and performBITCASTCombine().
◆ checkIntrinsicImmArg()
◆ checkValueWidth()
◆ combine_CC()
Definition at line 5965 of file LoongArchISelLowering.cpp.
References llvm::ISD::AND, llvm::cast(), llvm::ISD::Constant, DL, llvm::APInt::getBitsSetFrom(), llvm::SelectionDAG::getCondCode(), llvm::SelectionDAG::getConstant(), llvm::SDValue::getConstantOperandVal(), llvm::LoongArchSubtarget::getGRLenVT(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::ISD::getSetCCInverse(), 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::SHL, llvm::ISD::SRA, llvm::ISD::SRL, and translateSetCCForBranch().
Referenced by performBR_CCCombine(), llvm::RISCVTargetLowering::PerformDAGCombine(), and performSELECT_CCCombine().
◆ combineAndNotIntoVANDN()
Try to fold: (and (xor X, -1), Y) -> (vandn X, Y).
Definition at line 5173 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().
◆ combineSelectToBinOp()
Definition at line 915 of file LoongArchISelLowering.cpp.
References llvm::ISD::ADD, llvm::ISD::AND, llvm::cast(), DL, llvm::SelectionDAG::getAllOnesConstant(), llvm::SDNode::getAsAPIntVal(), llvm::SelectionDAG::getFreeze(), llvm::SelectionDAG::getNegative(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::isa(), llvm::isAllOnesConstant(), llvm::isNullConstant(), LHS, matchSetCC(), N, llvm::ISD::OR, RHS, SDValue(), llvm::ISD::SETCC, and llvm::ISD::XOR.
◆ computeZeroableShuffleElements()
◆ convertLocVTToValVT()
◆ convertValVTToLocVT()
◆ customLegalizeToWOp()
Definition at line 4610 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().
◆ customLegalizeToWOpWithSExt()
◆ emitBuildPairF64Pseudo()
Definition at line 7419 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(), llvm::RegState::Kill, MI, MRI, and TII.
Referenced by llvm::RISCVTargetLowering::EmitInstrWithCustomInserter().
◆ emitErrorAndReplaceIntrinsicResults()
◆ emitIntrinsicErrorMessage()
◆ emitIntrinsicWithChainErrorMessage()
◆ emitPseudoCTPOP()
Definition at line 7246 of file LoongArchISelLowering.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), DL, llvm::LoongArchSubtarget::getInstrInfo(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getRegInfo(), llvm::LoongArchSubtarget::is64Bit(), MI, MRI, and TII.
◆ emitPseudoVMSKCOND()
Definition at line 7285 of file LoongArchISelLowering.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), DL, llvm::LoongArchSubtarget::getInstrInfo(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getRegInfo(), llvm::LoongArchSubtarget::getRegisterInfo(), llvm::Hi, llvm::LoongArchSubtarget::is64Bit(), llvm::RegState::Kill, llvm_unreachable, llvm::Lo, MI, MRI, TII, and TRI.
◆ emitPseudoXVINSGR2VR()
Definition at line 7176 of file LoongArchISelLowering.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), DL, llvm::LoongArchSubtarget::getInstrInfo(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getRegInfo(), llvm::Register::isVirtual(), llvm_unreachable, MI, MRI, and TII.
◆ emitSelectPseudo()
Definition at line 7452 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(), llvm::MachineInstr::collectDebugValues(), llvm::SmallSet< T, N, C >::count(), DL, E(), llvm::MachineBasicBlock::end(), llvm::MachineInstr::eraseFromParent(), F, llvm::MachineBasicBlock::getBasicBlock(), llvm::getImm(), llvm::LoongArchSubtarget::getInstrInfo(), 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(), TII, and llvm::MachineBasicBlock::transferSuccessorsAndUpdatePHIs().
◆ emitSplitPairF64Pseudo()
◆ emitVecCondBranchPseudo()
Definition at line 7051 of file LoongArchISelLowering.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMBB(), llvm::MachineInstrBuilder::addReg(), llvm::MachineBasicBlock::addSuccessor(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), DL, llvm::MachineBasicBlock::end(), F, llvm::MachineBasicBlock::getBasicBlock(), llvm::LoongArchSubtarget::getInstrInfo(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getRegInfo(), llvm_unreachable, MI, MRI, llvm::MachineBasicBlock::splice(), TII, and llvm::MachineBasicBlock::transferSuccessorsAndUpdatePHIs().
◆ fillSubVectorFromBuildVector()
◆ fillVector()
Definition at line 3017 of file LoongArchISelLowering.cpp.
References AbstractManglingParser< Derived, Alloc >::Ops, assert(), DL, llvm::SelectionDAG::getConstant(), llvm::LoongArchSubtarget::getGRLenVT(), llvm::SelectionDAG::getNode(), llvm::EVT::getVectorNumElements(), llvm::ISD::INSERT_VECTOR_ELT, llvm::SDValue::isUndef(), llvm::ISD::SCALAR_TO_VECTOR, and Vector.
Referenced by fillSubVectorFromBuildVector().
◆ fitsRegularPattern()
template
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 1450 of file LoongArchISelLowering.cpp.
References I.
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().
◆ foldBinOpIntoSelectIfProfitable()
Definition at line 989 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, and std::swap().
◆ getEstimateRefinementSteps()
◆ getIntrinsicForMaskedAtomicRMWBinOp()
◆ getLoongArchWOpcode()
Definition at line 4577 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().
◆ getPrefTypeAlign()
◆ getTargetNode() [1/4]
◆ getTargetNode() [2/4]
◆ getTargetNode() [3/4]
◆ getTargetNode() [4/4]
◆ insertDivByZeroTrap()
Definition at line 7000 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().
◆ isNOT()
Definition at line 626 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(), and llvm::ISD::XOR.
Referenced by combineAndNotIntoVANDN(), llvm::X86InstrInfo::isDataInvariant(), isNOT(), and performVANDNCombine().
◆ isRepeatedShuffleMask()
◆ isSelectPseudo()
◆ legalizeIntrinsicImmArg()
◆ lower128BitShuffle()
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 2149 of file LoongArchISelLowering.cpp.
References assert(), computeZeroableShuffleElements(), DL, llvm::SDValue::getSimpleValueType(), llvm::MVT::getVectorNumElements(), llvm::SDValue::isUndef(), lowerVECTOR_SHUFFLE_IsReverse(), lowerVECTOR_SHUFFLE_VILVH(), lowerVECTOR_SHUFFLE_VILVL(), lowerVECTOR_SHUFFLE_VPACKEV(), lowerVECTOR_SHUFFLE_VPACKOD(), 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, and widenShuffleMask().
Referenced by lowerVECTOR_SHUFFLE().
◆ lower256BitShuffle()
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 2761 of file LoongArchISelLowering.cpp.
References assert(), canonicalizeShuffleVectorByLane(), computeZeroableShuffleElements(), DL, llvm::SDValue::getSimpleValueType(), llvm::MVT::getVectorNumElements(), llvm::SDValue::isUndef(), lower256BitShuffle(), lowerVECTOR_SHUFFLE_IsReverse(), lowerVECTOR_SHUFFLE_XVILVH(), lowerVECTOR_SHUFFLE_XVILVL(), lowerVECTOR_SHUFFLE_XVINSVE0(), lowerVECTOR_SHUFFLE_XVPACKEV(), lowerVECTOR_SHUFFLE_XVPACKOD(), lowerVECTOR_SHUFFLE_XVPERM(), lowerVECTOR_SHUFFLE_XVPERMI(), lowerVECTOR_SHUFFLE_XVPICKEV(), lowerVECTOR_SHUFFLE_XVPICKOD(), lowerVECTOR_SHUFFLE_XVREPLVEI(), lowerVECTOR_SHUFFLE_XVSHUF(), lowerVECTOR_SHUFFLE_XVSHUF4I(), lowerVECTOR_SHUFFLEAsByteRotate(), lowerVECTOR_SHUFFLEAsLanePermuteAndShuffle(), lowerVECTOR_SHUFFLEAsShift(), SDValue(), llvm::MVT::SimpleTy, and widenShuffleMask().
Referenced by lower256BitShuffle(), and lowerVECTOR_SHUFFLE().
◆ lowerBUILD_VECTORAsBroadCastLoad()
Definition at line 2971 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::NON_EXTLOAD, llvm::SelectionDAG::ReplaceAllUsesOfValueWith(), and SDValue().
◆ lowerVECTOR_SHUFFLE_IsReverse()
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 1844 of file LoongArchISelLowering.cpp.
References DL, llvm::SelectionDAG::getBitcast(), llvm::SelectionDAG::getConstant(), llvm::LoongArchSubtarget::getGRLenVT(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getUNDEF(), llvm::MVT::getVectorElementType(), llvm::MVT::getVectorNumElements(), llvm::SelectionDAG::getVectorShuffle(), llvm::MVT::getVectorVT(), llvm::ShuffleVectorInst::isReverseMask(), and SDValue().
Referenced by lower128BitShuffle(), and lower256BitShuffle().
◆ lowerVECTOR_SHUFFLE_VILVH()
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 1968 of file LoongArchISelLowering.cpp.
References DL, fitsRegularPattern(), llvm::SelectionDAG::getNode(), and SDValue().
Referenced by lower128BitShuffle().
◆ lowerVECTOR_SHUFFLE_VILVL()
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 2011 of file LoongArchISelLowering.cpp.
References DL, fitsRegularPattern(), llvm::SelectionDAG::getNode(), and SDValue().
Referenced by lower128BitShuffle().
◆ lowerVECTOR_SHUFFLE_VPACKEV()
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 1887 of file LoongArchISelLowering.cpp.
References DL, fitsRegularPattern(), llvm::SelectionDAG::getNode(), and SDValue().
Referenced by lower128BitShuffle(), and lowerVECTOR_SHUFFLE_XVPACKEV().
◆ lowerVECTOR_SHUFFLE_VPACKOD()
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 1927 of file LoongArchISelLowering.cpp.
References DL, fitsRegularPattern(), llvm::SelectionDAG::getNode(), and SDValue().
Referenced by lower128BitShuffle(), and lowerVECTOR_SHUFFLE_XVPACKOD().
◆ lowerVECTOR_SHUFFLE_VPICKEV()
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 2051 of file LoongArchISelLowering.cpp.
References DL, fitsRegularPattern(), llvm::SelectionDAG::getNode(), and SDValue().
Referenced by lower128BitShuffle().
◆ lowerVECTOR_SHUFFLE_VPICKOD()
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 2093 of file LoongArchISelLowering.cpp.
References DL, fitsRegularPattern(), llvm::SelectionDAG::getNode(), and SDValue().
Referenced by lower128BitShuffle().
◆ lowerVECTOR_SHUFFLE_VREPLVEI()
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 1738 of file LoongArchISelLowering.cpp.
References assert(), DL, fitsRegularPattern(), llvm::SelectionDAG::getConstant(), llvm::LoongArchSubtarget::getGRLenVT(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getUNDEF(), and SDValue().
Referenced by lower128BitShuffle().
◆ lowerVECTOR_SHUFFLE_VSHUF()
◆ lowerVECTOR_SHUFFLE_VSHUF4I()
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,v0, v0,v1, 27) where the 27 comes from: 3 + (2 << 2) + (1 << 4) + (0 << 6)
Definition at line 1780 of file LoongArchISelLowering.cpp.
References DL, llvm::SelectionDAG::getConstant(), llvm::LoongArchSubtarget::getGRLenVT(), llvm::SelectionDAG::getNode(), and SDValue().
Referenced by lower128BitShuffle(), and lowerVECTOR_SHUFFLE_XVSHUF4I().
◆ lowerVECTOR_SHUFFLE_XVILVH()
◆ lowerVECTOR_SHUFFLE_XVILVL()
◆ lowerVECTOR_SHUFFLE_XVINSVE0()
◆ lowerVECTOR_SHUFFLE_XVPACKEV()
◆ lowerVECTOR_SHUFFLE_XVPACKOD()
◆ lowerVECTOR_SHUFFLE_XVPERM()
Lower VECTOR_SHUFFLE into XVPERM (if possible).
Definition at line 2293 of file LoongArchISelLowering.cpp.
References DL, llvm::SelectionDAG::getBuildVector(), llvm::SelectionDAG::getConstant(), llvm::LoongArchSubtarget::getGRLenVT(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getUNDEF(), llvm::MVT::getVectorNumElements(), inRange(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and SDValue().
Referenced by lower256BitShuffle().
◆ lowerVECTOR_SHUFFLE_XVPERMI()
◆ lowerVECTOR_SHUFFLE_XVPICKEV()
◆ lowerVECTOR_SHUFFLE_XVPICKOD()
◆ lowerVECTOR_SHUFFLE_XVREPLVEI()
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 2228 of file LoongArchISelLowering.cpp.
References assert(), DL, fitsRegularPattern(), llvm::SelectionDAG::getConstant(), llvm::LoongArchSubtarget::getGRLenVT(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getUNDEF(), and SDValue().
Referenced by lower256BitShuffle().
◆ lowerVECTOR_SHUFFLE_XVSHUF()
Lower VECTOR_SHUFFLE into XVSHUF (if possible).
Definition at line 2541 of file LoongArchISelLowering.cpp.
References assert(), llvm::MVT::changeVectorElementTypeToInteger(), DL, llvm::SelectionDAG::getBuildVector(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getTargetConstant(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), SDValue(), and llvm::SmallVectorTemplateCommon< T, typename >::size().
Referenced by lower256BitShuffle().
◆ lowerVECTOR_SHUFFLE_XVSHUF4I()
◆ lowerVECTOR_SHUFFLEAsByteRotate()
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, v1,v1, 8) (VBSLL_V v0,v0, v0,v0, 8) (VOR_V v0,v0, v0,V0, $v1)
Definition at line 1612 of file LoongArchISelLowering.cpp.
References DL, llvm::SelectionDAG::getBitcast(), llvm::SelectionDAG::getConstant(), llvm::LoongArchSubtarget::getGRLenVT(), llvm::SelectionDAG::getNode(), llvm::MVT::getSizeInBits(), llvm::MVT::getVectorVT(), llvm::Hi, llvm::Lo, matchShuffleAsByteRotate(), llvm::ISD::OR, and SDValue().
Referenced by lower128BitShuffle(), and lower256BitShuffle().
◆ lowerVECTOR_SHUFFLEAsLanePermuteAndShuffle()
Lower VECTOR_SHUFFLE as lane permute and then shuffle (if possible).
Only for 256-bit vector.
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,xr2, xr2,xr0, 78) (XVSHUF xr1,xr1, xr1,xr2, xr0)(XVORIxr0) (XVORI xr0)(XVORIxr0, $xr1, 0)
Definition at line 2722 of file LoongArchISelLowering.cpp.
References assert(), llvm::SmallVectorImpl< T >::assign(), DL, llvm::SelectionDAG::getBitcast(), llvm::SelectionDAG::getUNDEF(), llvm::SelectionDAG::getVectorShuffle(), llvm::MVT::is256BitVector(), SDValue(), and Size.
Referenced by lower256BitShuffle().
◆ lowerVECTOR_SHUFFLEAsShift()
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, 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, v0,v0, 32)
Definition at line 1412 of file LoongArchISelLowering.cpp.
References assert(), DL, llvm::SelectionDAG::getBitcast(), llvm::SelectionDAG::getConstant(), llvm::LoongArchSubtarget::getGRLenVT(), llvm::SelectionDAG::getNode(), llvm::MVT::getScalarSizeInBits(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::MVT::getVectorNumElements(), llvm::TargetLoweringBase::isTypeLegal(), matchShuffleAsShift(), SDValue(), and Size.
Referenced by lower128BitShuffle(), and lower256BitShuffle().
◆ lowerVECTOR_SHUFFLEAsZeroOrAnyExtend()
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)(VILVLv1, 0) (VILVL v1,0)(VILVLv0, v1,v1, v1,v0)
Definition at line 1645 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, llvm::Offset, and SDValue().
Referenced by lower128BitShuffle().
◆ lowerVectorBitClear()
◆ lowerVectorBitClearImm()
◆ lowerVectorBitRevImm()
◆ lowerVectorBitSetImm()
◆ lowerVectorPickVE2GR()
Definition at line 6212 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(), llvm::isUInt(), and N.
Referenced by performINTRINSIC_WO_CHAINCombine().
◆ lowerVectorSplatImm()
Definition at line 6121 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().
◆ matchSetCC()
Definition at line 892 of file LoongArchISelLowering.cpp.
References assert(), llvm::cast(), llvm::SDNode::getOpcode(), llvm::SDValue::getOperand(), llvm::ISD::getSetCCInverse(), llvm::ISD::getSetCCSwappedOperands(), llvm::SDValue::getValueType(), LHS, RHS, and llvm::ISD::SETCC.
Referenced by combineSelectToBinOp(), and lowerSelectToBinOp().
◆ matchShuffleAsByteRotate()
◆ matchShuffleAsShift()
◆ performANDCombine()
Definition at line 5199 of file LoongArchISelLowering.cpp.
References combineAndNotIntoVANDN(), DL, llvm::dyn_cast(), llvm::SelectionDAG::getConstant(), llvm::LoongArchSubtarget::getGRLenVT(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::ConstantSDNode::getSExtValue(), llvm::ConstantSDNode::getZExtValue(), llvm::TargetLowering::DAGCombinerInfo::isBeforeLegalizeOps(), llvm::isShiftedMask_64(), N, SDValue(), llvm::ISD::SHL, llvm::ISD::SRA, llvm::ISD::SRL, and llvm::SDNode::use_size().
◆ performBITCASTCombine()
Definition at line 5467 of file LoongArchISelLowering.cpp.
References checkBitcastSrcVectorSize(), DL, llvm::SelectionDAG::getBitcast(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getContext(), llvm::LoongArchSubtarget::getGRLenVT(), llvm::EVT::getIntegerVT(), llvm::SelectionDAG::getNode(), llvm::EVT::getScalarType(), llvm::EVT::getSimpleVT(), llvm::EVT::getSizeInBits(), llvm::EVT::getVectorNumElements(), llvm::SelectionDAG::getZExtOrTrunc(), llvm::Hi, llvm::TargetLowering::DAGCombinerInfo::isBeforeLegalizeOps(), llvm::EVT::isSimple(), llvm::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(), and T.
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine().
◆ performBITREV_WCombine()
◆ performBR_CCCombine()
◆ performEXTRACT_VECTOR_ELTCombine()
Definition at line 6861 of file LoongArchISelLowering.cpp.
References llvm::ISD::ANY_EXTEND, DL, llvm::ISD::EXTRACT_VECTOR_ELT, llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDNode::getValueType(), llvm::EVT::is256BitVector(), llvm::isa(), llvm::TargetLowering::DAGCombinerInfo::isBeforeLegalize(), N, SDValue(), llvm::ISD::SIGN_EXTEND, llvm::ISD::TRUNCATE, and llvm::ISD::ZERO_EXTEND.
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine().
◆ performINTRINSIC_WO_CHAINCombine()
Definition at line 6228 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::LoongArchSubtarget::getGRLenVT(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getNOT(), llvm::SDNode::getValueType(), llvm::ISD::INSERT_VECTOR_ELT, llvm::LoongArchSubtarget::is64Bit(), 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, truncateVecElts(), llvm::ISD::UDIV, llvm::ISD::UMAX, llvm::ISD::UMIN, llvm::ISD::UREM, and llvm::ISD::XOR.
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine().
◆ performMOVFR2GR_SCombine()
◆ performMOVGR2FR_WCombine()
◆ performORCombine()
Definition at line 5562 of file LoongArchISelLowering.cpp.
References llvm::ISD::AND, llvm::SelectionDAG::computeKnownBits(), llvm::dbgs(), DL, llvm::dyn_cast(), llvm::SelectionDAG::getConstant(), llvm::LoongArchSubtarget::getGRLenVT(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::ConstantSDNode::getSExtValue(), llvm::SelectionDAG::getSignedConstant(), llvm::ConstantSDNode::getZExtValue(), llvm::TargetLowering::DAGCombinerInfo::isBeforeLegalizeOps(), llvm::isShiftedMask_64(), llvm::APInt::isSubsetOf(), LLVM_DEBUG, N, SDValue(), llvm::ISD::SHL, llvm::ISD::SRL, std::swap(), and llvm::KnownBits::Zero.
◆ performSELECT_CCCombine()
Definition at line 6052 of file LoongArchISelLowering.cpp.
References llvm::ISD::ADD, llvm::ISD::AND, llvm::cast(), combine_CC(), DL, llvm::SelectionDAG::getConstant(), llvm::LoongArchSubtarget::getGRLen(), 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, and std::swap().
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine().
◆ performSETCC_BITCASTCombine()
Definition at line 5394 of file LoongArchISelLowering.cpp.
References llvm::cast(), llvm::ISD::DELETED_NODE, DL, llvm::SelectionDAG::getBitcast(), llvm::SelectionDAG::getContext(), llvm::LoongArchSubtarget::getGRLenVT(), 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, and T.
Referenced by performBITCASTCombine().
◆ performSETCCCombine()
Definition at line 5881 of file LoongArchISelLowering.cpp.
References llvm::ISD::AND, llvm::cast(), checkValueWidth(), llvm::dyn_cast(), llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::SDNode::getOpcode(), llvm::SDValue::getOpcode(), llvm::SDNode::getOperand(), llvm::SDValue::getOperand(), llvm::SelectionDAG::getSetCC(), llvm::ConstantSDNode::getSExtValue(), llvm::SDNode::getValueType(), N, llvm::SelectionDAG::ReplaceAllUsesWith(), SDValue(), llvm::ISD::SETEQ, llvm::ISD::SETNE, llvm::ISD::SEXTLOAD, llvm::ISD::TRUNCATE, llvm::ISD::XOR, llvm::ISD::ZERO_EXTEND, and llvm::ISD::ZEXTLOAD.
◆ performSPLIT_PAIR_F64Combine()
Definition at line 6830 of file LoongArchISelLowering.cpp.
References llvm::CallingConv::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(), llvm::Lo, N, and SDValue().
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine().
◆ performSRLCombine()
Definition at line 5292 of file LoongArchISelLowering.cpp.
References llvm::ISD::AND, DL, llvm::dyn_cast(), llvm::SelectionDAG::getConstant(), llvm::LoongArchSubtarget::getGRLenVT(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDNode::getOperand(), llvm::SDValue::getOperand(), llvm::ConstantSDNode::getZExtValue(), llvm::TargetLowering::DAGCombinerInfo::isBeforeLegalizeOps(), llvm::isShiftedMask_64(), N, and SDValue().
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine(), and llvm::MipsSETargetLowering::PerformDAGCombine().
◆ performVANDNCombine()
Do target-specific dag combines on LoongArchISD::VANDN nodes.
Definition at line 6897 of file LoongArchISelLowering.cpp.
References llvm::ISD::AND, llvm::ISD::BUILD_VECTOR, llvm::CallingConv::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, and SDValue().
Referenced by llvm::LoongArchTargetLowering::PerformDAGCombine().
◆ performVMSKLTZCombine()
◆ replaceCMP_XCHG_128Results()
Definition at line 4770 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().
◆ replaceINTRINSIC_WO_CHAINResults()
◆ replaceVecCondBranchResults()
◆ replaceVPICKVE2GRResults()
Definition at line 4668 of file LoongArchISelLowering.cpp.
References DL, emitErrorAndReplaceIntrinsicResults(), llvm::SelectionDAG::getConstant(), llvm::LoongArchSubtarget::getGRLenVT(), llvm::SelectionDAG::getNode(), llvm::SDValue::getValue(), llvm::SDValue::getValueType(), llvm::SelectionDAG::getValueType(), llvm::EVT::getVectorElementType(), llvm::isUInt(), Results, and llvm::ISD::TRUNCATE.
Referenced by replaceINTRINSIC_WO_CHAINResults().
◆ signExtendBitcastSrcVector()
Definition at line 5368 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()
| STATISTIC | ( | NumTailCalls | , |
|---|---|---|---|
| "Number of tail calls" | ) |
◆ translateSetCCForBranch()
Definition at line 1048 of file LoongArchISelLowering.cpp.
References llvm::ISD::AND, llvm::bit_width(), llvm::CallingConv::C, 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, and std::swap().
Referenced by combine_CC(), and combine_CC().
◆ truncateVecElts()
◆ unpackF64OnLA32DSoftABI()
Definition at line 8064 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 llvm::Lo.
Referenced by llvm::LoongArchTargetLowering::LowerFormalArguments().
◆ unpackFromMemLoc()
Definition at line 8039 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.
◆ unpackFromRegLoc()
Definition at line 8006 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::TargetLoweringBase::getRegClassFor(), llvm::MachineFunction::getRegInfo(), llvm::EVT::getSimpleVT(), llvm::Value::getType(), and llvm::Type::isIntegerTy().
◆ widenShuffleMask()
Definition at line 1307 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(), and llvm::widenShuffleMaskElts().
Referenced by lower128BitShuffle(), and lower256BitShuffle().
◆ ArgFPR32s
◆ ArgFPR64s
◆ ArgGPRs
Initial value:
= {LoongArch::R4, LoongArch::R5, LoongArch::R6,
LoongArch::R7, LoongArch::R8, LoongArch::R9,
LoongArch::R10, LoongArch::R11}
Definition at line 7704 of file LoongArchISelLowering.cpp.
Referenced by llvm::CC_CSKY_ABIV2_SOFT_64(), CC_LoongArch(), CC_LoongArchAssign2GRLen(), llvm::CC_RISCV(), llvm::CC_RISCV_FastCC(), CC_RISCVAssign2XLen(), llvm::LoongArchTargetLowering::LowerFormalArguments(), and llvm::Ret_CSKY_ABIV2_SOFT_64().
◆ ArgVRs
◆ ArgXRs
Initial value:
= {LoongArch::XR0, LoongArch::XR1, LoongArch::XR2,
LoongArch::XR3, LoongArch::XR4, LoongArch::XR5,
LoongArch::XR6, LoongArch::XR7}
Definition at line 7721 of file LoongArchISelLowering.cpp.
Referenced by CC_LoongArch().
◆ MaterializeFPImmInsNum
| 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)"))) ( "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 |
|---|
◆ ZeroDivCheck
| cl::opt< bool > ZeroDivCheck("loongarch-check-zero-division", cl::Hidden, cl::desc("Trap on integer division by zero."), cl::init(false)) ( "loongarch-check-zero-division" , cl::Hidden , cl::desc("Trap on integer division by zero.") , cl::init(false) ) | static |
|---|