51#define DEBUG_TYPE "legalizevectorops"
55class VectorLegalizer {
67 LegalizedNodes.
insert(std::make_pair(From, To));
70 LegalizedNodes.
insert(std::make_pair(To, To));
143 std::pair<SDValue, SDValue> ExpandLoad(
SDNode *
N);
158 bool tryExpandVecMathCall(
SDNode *
Node, RTLIB::Libcall LC,
204bool VectorLegalizer::Run() {
206 bool HasVectors =
false;
211 HasVectors =
llvm::any_of(
I->values(), [](EVT
T) { return T.isVector(); });
235 assert(LegalizedNodes.count(OldRoot) &&
"Root didn't get legalized?");
236 DAG.
setRoot(LegalizedNodes[OldRoot]);
238 LegalizedNodes.clear();
246SDValue VectorLegalizer::TranslateLegalizeResults(
SDValue Op, SDNode *Result) {
248 "Unexpected number of results");
250 for (
unsigned i = 0, e =
Op->getNumValues(); i != e; ++i)
251 AddLegalizedOperand(
Op.getValue(i),
SDValue(Result, i));
256VectorLegalizer::RecursivelyLegalizeResults(
SDValue Op,
259 "Unexpected number of results");
261 for (
unsigned i = 0, e =
Results.
size(); i != e; ++i) {
263 AddLegalizedOperand(
Op.getValue(i),
Results[i]);
272 DenseMap<SDValue, SDValue>::iterator
I = LegalizedNodes.find(
Op);
273 if (
I != LegalizedNodes.end())
return I->second;
277 for (
const SDValue &Oper :
Op->op_values())
278 Ops.push_back(LegalizeOp(Oper));
282 bool HasVectorValueOrOp =
285 [](
SDValue O) { return O.getValueType().isVector(); });
286 if (!HasVectorValueOrOp)
287 return TranslateLegalizeResults(
Op, Node);
289 TargetLowering::LegalizeAction Action = TargetLowering::Legal;
291 switch (
Op.getOpcode()) {
293 return TranslateLegalizeResults(
Op, Node);
297 EVT LoadedVT =
LD->getMemoryVT();
304 EVT StVT =
ST->getMemoryVT();
305 MVT ValVT =
ST->getValue().getSimpleValueType();
306 if (StVT.
isVector() &&
ST->isTruncatingStore())
314 if (Action == TargetLowering::Legal)
315 Action = TargetLowering::Expand;
317#define DAG_INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC, DAGN) \
318 case ISD::STRICT_##DAGN:
319#include "llvm/IR/ConstrainedOps.def"
320 ValVT =
Node->getValueType(0);
323 ValVT =
Node->getOperand(1).getValueType();
326 MVT OpVT =
Node->getOperand(1).getSimpleValueType();
329 if (Action == TargetLowering::Legal)
341 TargetLowering::Legal) {
344 == TargetLowering::Expand &&
346 == TargetLowering::Legal)
347 Action = TargetLowering::Legal;
486 unsigned Scale =
Node->getConstantOperandVal(2);
488 Node->getValueType(0), Scale);
514 Node->getOperand(0).getValueType());
519 Node->getOperand(1).getValueType());
522 MVT OpVT =
Node->getOperand(0).getSimpleValueType();
525 if (Action == TargetLowering::Legal)
535 Node->getOperand(1).getValueType());
538#define BEGIN_REGISTER_VP_SDNODE(VPID, LEGALPOS, ...) \
540 EVT LegalizeVT = LEGALPOS < 0 ? Node->getValueType(-(1 + LEGALPOS)) \
541 : Node->getOperand(LEGALPOS).getValueType(); \
542 if (ISD::VPID == ISD::VP_SETCC) { \
543 ISD::CondCode CCCode = cast<CondCodeSDNode>(Node->getOperand(2))->get(); \
544 Action = TLI.getCondCodeAction(CCCode, LegalizeVT.getSimpleVT()); \
545 if (Action != TargetLowering::Legal) \
549 if (!Node->getValueType(0).isVector() && \
550 Node->getValueType(0) != MVT::Other) { \
551 Action = TargetLowering::Legal; \
554 Action = TLI.getOperationAction(Node->getOpcode(), LegalizeVT); \
556#include "llvm/IR/VPIntrinsics.def"
564 case TargetLowering::Promote:
566 "This action is not supported yet!");
568 Promote(Node, ResultVals);
569 assert(!ResultVals.
empty() &&
"No results for promotion?");
571 case TargetLowering::Legal:
574 case TargetLowering::Custom:
576 if (LowerOperationWrapper(Node, ResultVals))
580 case TargetLowering::Expand:
582 Expand(Node, ResultVals);
586 if (ResultVals.
empty())
587 return TranslateLegalizeResults(
Op, Node);
590 return RecursivelyLegalizeResults(
Op, ResultVals);
595bool VectorLegalizer::LowerOperationWrapper(SDNode *Node,
596 SmallVectorImpl<SDValue> &
Results) {
607 if (
Node->getNumValues() == 1) {
615 "Lowering returned the wrong number of results!");
618 for (
unsigned I = 0,
E =
Node->getNumValues();
I !=
E; ++
I)
624void VectorLegalizer::PromoteSETCC(SDNode *Node,
625 SmallVectorImpl<SDValue> &
Results) {
626 MVT VecVT =
Node->getOperand(0).getSimpleValueType();
634 Operands[0] = DAG.
getNode(ExtOp,
DL, NewVecVT,
Node->getOperand(0));
635 Operands[1] = DAG.
getNode(ExtOp,
DL, NewVecVT,
Node->getOperand(1));
636 Operands[2] =
Node->getOperand(2);
638 if (
Node->getOpcode() == ISD::VP_SETCC) {
639 Operands[3] =
Node->getOperand(3);
640 Operands[4] =
Node->getOperand(4);
644 Operands,
Node->getFlags());
649void VectorLegalizer::PromoteSTRICT(SDNode *Node,
650 SmallVectorImpl<SDValue> &
Results) {
651 MVT VecVT =
Node->getOperand(1).getSimpleValueType();
660 for (
unsigned j = 1;
j !=
Node->getNumOperands(); ++
j)
661 if (
Node->getOperand(j).getValueType().isVector() &&
668 {
Node->getOperand(0),
Node->getOperand(j)});
672 Operands[
j] =
Node->getOperand(j);
674 SDVTList VTs = DAG.
getVTList(NewVecVT,
Node->getValueType(1));
690void VectorLegalizer::PromoteFloatVECREDUCE(SDNode *Node,
691 SmallVectorImpl<SDValue> &
Results,
692 bool NonArithmetic) {
693 MVT OpVT =
Node->getOperand(0).getSimpleValueType();
708void VectorLegalizer::Promote(SDNode *Node, SmallVectorImpl<SDValue> &
Results) {
711 switch (
Node->getOpcode()) {
717 PromoteINT_TO_FP(Node,
Results);
724 PromoteFP_TO_INT(Node,
Results);
740 PromoteFloatVECREDUCE(Node,
Results,
false);
746 PromoteFloatVECREDUCE(Node,
Results,
true);
754 case ISD::VP_FCOPYSIGN:
766 "Can't promote a vector with multiple results!");
767 MVT VT =
Node->getSimpleValueType(0);
772 for (
unsigned j = 0;
j !=
Node->getNumOperands(); ++
j) {
776 if (
Node->getOperand(j).getValueType().isVector() && !SkipPromote)
777 if (
Node->getOperand(j)
779 .getVectorElementType()
780 .isFloatingPoint() &&
787 DAG.
getNode(ISD::VP_FP_EXTEND, dl, NVT,
Node->getOperand(j),
788 Node->getOperand(MaskIdx),
Node->getOperand(EVLIdx));
796 Operands[
j] =
Node->getOperand(j);
808 Res = DAG.
getNode(ISD::VP_FP_ROUND, dl, VT, Res,
809 Node->getOperand(MaskIdx),
Node->getOperand(EVLIdx));
820void VectorLegalizer::PromoteINT_TO_FP(SDNode *Node,
821 SmallVectorImpl<SDValue> &
Results) {
824 bool IsStrict =
Node->isStrictFPOpcode();
825 MVT VT =
Node->getOperand(IsStrict ? 1 : 0).getSimpleValueType();
828 "Vectors have different number of elements!");
837 for (
unsigned j = 0;
j !=
Node->getNumOperands(); ++
j) {
838 if (
Node->getOperand(j).getValueType().isVector())
841 Operands[
j] =
Node->getOperand(j);
846 {Node->getValueType(0), MVT::Other}, Operands);
861void VectorLegalizer::PromoteFP_TO_INT(SDNode *Node,
862 SmallVectorImpl<SDValue> &
Results) {
863 MVT VT =
Node->getSimpleValueType(0);
865 bool IsStrict =
Node->isStrictFPOpcode();
867 "Vectors have different number of elements!");
869 unsigned NewOpc =
Node->getOpcode();
883 Promoted = DAG.
getNode(NewOpc, dl, {NVT, MVT::Other},
884 {
Node->getOperand(0),
Node->getOperand(1)});
887 Promoted = DAG.
getNode(NewOpc, dl, NVT,
Node->getOperand(0));
898 Promoted = DAG.
getNode(NewOpc, dl, NVT, Promoted,
906std::pair<SDValue, SDValue> VectorLegalizer::ExpandLoad(SDNode *
N) {
911SDValue VectorLegalizer::ExpandStore(SDNode *
N) {
917void VectorLegalizer::Expand(SDNode *Node, SmallVectorImpl<SDValue> &
Results) {
918 switch (
Node->getOpcode()) {
920 std::pair<SDValue, SDValue> Tmp = ExpandLoad(Node);
926 Results.push_back(ExpandStore(Node));
929 for (
unsigned i = 0, e =
Node->getNumValues(); i != e; ++i)
933 if (
SDValue Expanded = ExpandSEXTINREG(Node)) {
939 Results.push_back(ExpandANY_EXTEND_VECTOR_INREG(Node));
942 Results.push_back(ExpandSIGN_EXTEND_VECTOR_INREG(Node));
945 Results.push_back(ExpandZERO_EXTEND_VECTOR_INREG(Node));
948 if (
SDValue Expanded = ExpandBSWAP(Node)) {
957 if (
SDValue Expanded = ExpandVSELECT(Node)) {
963 if (
SDValue Expanded = ExpandVP_SELECT(Node)) {
970 if (
SDValue Expanded = ExpandVP_REM(Node)) {
976 if (
SDValue Expanded = ExpandVP_FNEG(Node)) {
982 if (
SDValue Expanded = ExpandVP_FABS(Node)) {
987 case ISD::VP_FCOPYSIGN:
988 if (
SDValue Expanded = ExpandVP_FCOPYSIGN(Node)) {
994 if (
SDValue Expanded = ExpandSELECT(Node)) {
1000 if (
Node->getValueType(0).isScalableVector()) {
1005 Node->getOperand(1),
Node->getOperand(4));
1007 Node->getOperand(2),
1008 Node->getOperand(3)));
1014 ExpandFP_TO_UINT(Node,
Results);
1017 ExpandUINT_TO_FLOAT(Node,
Results);
1020 if (
SDValue Expanded = ExpandFNEG(Node)) {
1026 if (
SDValue Expanded = ExpandFABS(Node)) {
1032 if (
SDValue Expanded = ExpandFCOPYSIGN(Node)) {
1067 if (
SDValue Expanded = ExpandBITREVERSE(Node)) {
1072 case ISD::VP_BITREVERSE:
1098 case ISD::VP_CTLZ_ZERO_UNDEF:
1112 case ISD::VP_CTTZ_ZERO_UNDEF:
1160 ExpandUADDSUBO(Node,
Results);
1164 ExpandSADDSUBO(Node,
Results);
1189 if (
Node->getValueType(0).isScalableVector()) {
1212 ExpandFixedPointDiv(Node,
Results);
1217#define DAG_INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC, DAGN) \
1218 case ISD::STRICT_##DAGN:
1219#include "llvm/IR/ConstrainedOps.def"
1220 ExpandStrictFPOp(Node,
Results);
1254 if (
SDValue Expanded = ExpandVP_MERGE(Node)) {
1261 if (tryExpandVecMathCall(Node, LC,
Results))
1268 EVT VT =
Node->getValueType(0);
1272 if (LC != RTLIB::UNKNOWN_LIBCALL &&
1281 EVT VT =
Node->getValueType(0);
1283 if (LC != RTLIB::UNKNOWN_LIBCALL &&
1301 Results.push_back(ExpandLOOP_DEPENDENCE_MASK(Node));
1324 if (
Node->getNumValues() == 1) {
1328 "VectorLegalizer Expand returned wrong number of results!");
1334SDValue VectorLegalizer::ExpandSELECT(SDNode *Node) {
1338 EVT VT =
Node->getValueType(0);
1361 VT) == TargetLowering::Expand)
1390SDValue VectorLegalizer::ExpandSEXTINREG(SDNode *Node) {
1391 EVT VT =
Node->getValueType(0);
1411SDValue VectorLegalizer::ExpandANY_EXTEND_VECTOR_INREG(SDNode *Node) {
1413 EVT VT =
Node->getValueType(0);
1416 EVT SrcVT = Src.getValueType();
1423 "ANY_EXTEND_VECTOR_INREG vector size mismatch");
1431 SmallVector<int, 16> ShuffleMask;
1432 ShuffleMask.
resize(NumSrcElements, -1);
1435 int ExtLaneScale = NumSrcElements / NumElements;
1437 for (
int i = 0; i < NumElements; ++i)
1438 ShuffleMask[i * ExtLaneScale + EndianOffset] = i;
1445SDValue VectorLegalizer::ExpandSIGN_EXTEND_VECTOR_INREG(SDNode *Node) {
1447 EVT VT =
Node->getValueType(0);
1449 EVT SrcVT = Src.getValueType();
1469SDValue VectorLegalizer::ExpandZERO_EXTEND_VECTOR_INREG(SDNode *Node) {
1471 EVT VT =
Node->getValueType(0);
1474 EVT SrcVT = Src.getValueType();
1481 "ZERO_EXTEND_VECTOR_INREG vector size mismatch");
1495 int ExtLaneScale = NumSrcElements / NumElements;
1497 for (
int i = 0; i < NumElements; ++i)
1498 ShuffleMask[i * ExtLaneScale + EndianOffset] = NumSrcElements + i;
1507 for (
int J = ScalarSizeInBytes - 1; J >= 0; --J)
1508 ShuffleMask.push_back((
I * ScalarSizeInBytes) + J);
1511SDValue VectorLegalizer::ExpandBSWAP(SDNode *Node) {
1512 EVT VT =
Node->getValueType(0);
1519 SmallVector<int, 16> ShuffleMask;
1543SDValue VectorLegalizer::ExpandBITREVERSE(SDNode *Node) {
1544 EVT VT =
Node->getValueType(0);
1558 if (ScalarSizeInBits > 8 && (ScalarSizeInBits % 8) == 0) {
1559 SmallVector<int, 16> BSWAPMask;
1591SDValue VectorLegalizer::ExpandVSELECT(SDNode *Node) {
1600 EVT VT =
Mask.getValueType();
1616 if (BoolContents != TargetLowering::ZeroOrNegativeOneBooleanContent &&
1617 !(BoolContents == TargetLowering::ZeroOrOneBooleanContent &&
1641SDValue VectorLegalizer::ExpandVP_SELECT(SDNode *Node) {
1651 EVT VT =
Mask.getValueType();
1667 Op1 = DAG.
getNode(ISD::VP_AND,
DL, VT, Op1, Mask, Ones, EVL);
1668 Op2 = DAG.
getNode(ISD::VP_AND,
DL, VT, Op2, NotMask, Ones, EVL);
1669 return DAG.
getNode(ISD::VP_OR,
DL, VT, Op1, Op2, Ones, EVL);
1672SDValue VectorLegalizer::ExpandVP_MERGE(SDNode *Node) {
1684 EVT MaskVT =
Mask.getValueType();
1701 EVLVecVT) != MaskVT)
1707 DAG.
getSetCC(
DL, MaskVT, StepVec, SplatEVL, ISD::CondCode::SETULT);
1713SDValue VectorLegalizer::ExpandVP_REM(SDNode *Node) {
1715 EVT VT =
Node->getValueType(0);
1717 unsigned DivOpc =
Node->getOpcode() == ISD::VP_SREM ? ISD::VP_SDIV : ISD::VP_UDIV;
1734 return DAG.
getNode(ISD::VP_SUB,
DL, VT, Dividend,
Mul, Mask, EVL);
1737SDValue VectorLegalizer::ExpandVP_FNEG(SDNode *Node) {
1738 EVT VT =
Node->getValueType(0);
1755SDValue VectorLegalizer::ExpandVP_FABS(SDNode *Node) {
1756 EVT VT =
Node->getValueType(0);
1770 DAG.
getNode(ISD::VP_AND,
DL, IntVT, Cast, ClearSignMask, Mask, EVL);
1774SDValue VectorLegalizer::ExpandVP_FCOPYSIGN(SDNode *Node) {
1775 EVT VT =
Node->getValueType(0);
1777 if (VT !=
Node->getOperand(1).getValueType())
1795 DAG.
getNode(ISD::VP_AND,
DL, IntVT, Sign, SignMask, Mask, EVL);
1800 DAG.
getNode(ISD::VP_AND,
DL, IntVT, Mag, ClearSignMask, Mask, EVL);
1802 SDValue CopiedSign = DAG.
getNode(ISD::VP_OR,
DL, IntVT, ClearedSign, SignBit,
1808SDValue VectorLegalizer::ExpandLOOP_DEPENDENCE_MASK(SDNode *
N) {
1810 EVT VT =
N->getValueType(0);
1811 SDValue SourceValue =
N->getOperand(0);
1812 SDValue SinkValue =
N->getOperand(1);
1813 SDValue EltSizeInBytes =
N->getOperand(2);
1816 ElementCount LaneOffsetEC =
1825 if (IsReadAfterWrite)
1847void VectorLegalizer::ExpandFP_TO_UINT(SDNode *Node,
1848 SmallVectorImpl<SDValue> &
Results) {
1853 if (
Node->isStrictFPOpcode())
1859 if (
Node->isStrictFPOpcode()) {
1860 UnrollStrictFPOp(Node,
Results);
1867void VectorLegalizer::ExpandUINT_TO_FLOAT(SDNode *Node,
1868 SmallVectorImpl<SDValue> &
Results) {
1869 bool IsStrict =
Node->isStrictFPOpcode();
1870 unsigned OpNo = IsStrict ? 1 : 0;
1872 EVT SrcVT = Src.getValueType();
1873 EVT DstVT =
Node->getValueType(0);
1888 TargetLowering::Expand) ||
1890 TargetLowering::Expand)) ||
1893 UnrollStrictFPOp(Node,
Results);
1902 assert((BW == 64 || BW == 32) &&
1903 "Elements in vector-UINT_TO_FP must be 32 or 64 bits wide");
1909 EVT FPVT = BW == 32 ? MVT::f32 : MVT::f64;
1916 {
Node->getOperand(0), Src});
1918 {
Node->getOperand(0), UIToFP, TargetZero});
1935 uint64_t HWMask = (BW == 64) ? 0x00000000FFFFFFFF : 0x0000FFFF;
1950 {
Node->getOperand(0),
HI});
1954 {
Node->getOperand(0),
LO});
1979SDValue VectorLegalizer::ExpandFNEG(SDNode *Node) {
1980 EVT VT =
Node->getValueType(0);
1999SDValue VectorLegalizer::ExpandFABS(SDNode *Node) {
2000 EVT VT =
Node->getValueType(0);
2019SDValue VectorLegalizer::ExpandFCOPYSIGN(SDNode *Node) {
2020 EVT VT =
Node->getValueType(0);
2023 if (VT !=
Node->getOperand(1).getValueType() ||
2051void VectorLegalizer::ExpandFSUB(SDNode *Node,
2052 SmallVectorImpl<SDValue> &
Results) {
2056 EVT VT =
Node->getValueType(0);
2070void VectorLegalizer::ExpandSETCC(SDNode *Node,
2071 SmallVectorImpl<SDValue> &
Results) {
2072 bool NeedInvert =
false;
2073 bool IsVP =
Node->getOpcode() == ISD::VP_SETCC;
2077 unsigned Offset = IsStrict ? 1 : 0;
2084 MVT OpVT =
LHS.getSimpleValueType();
2089 UnrollStrictFPOp(Node,
Results);
2092 Results.push_back(UnrollVSETCC(Node));
2105 EVL, NeedInvert, dl, Chain, IsSignaling);
2113 {Chain, LHS, RHS, CC},
Node->getFlags());
2114 Chain =
LHS.getValue(1);
2117 {LHS, RHS, CC, Mask, EVL},
Node->getFlags());
2133 assert(!IsStrict &&
"Don't know how to expand for strict nodes.");
2137 EVT VT =
Node->getValueType(0);
2141 CC,
Node->getFlags());
2149void VectorLegalizer::ExpandUADDSUBO(SDNode *Node,
2150 SmallVectorImpl<SDValue> &
Results) {
2157void VectorLegalizer::ExpandSADDSUBO(SDNode *Node,
2158 SmallVectorImpl<SDValue> &
Results) {
2165void VectorLegalizer::ExpandMULO(SDNode *Node,
2166 SmallVectorImpl<SDValue> &
Results) {
2168 if (!TLI.
expandMULO(Node, Result, Overflow, DAG))
2175void VectorLegalizer::ExpandFixedPointDiv(SDNode *Node,
2176 SmallVectorImpl<SDValue> &
Results) {
2179 N->getOperand(0),
N->getOperand(1),
N->getConstantOperandVal(2), DAG))
2183void VectorLegalizer::ExpandStrictFPOp(SDNode *Node,
2184 SmallVectorImpl<SDValue> &
Results) {
2186 ExpandUINT_TO_FLOAT(Node,
Results);
2190 ExpandFP_TO_UINT(Node,
Results);
2200 UnrollStrictFPOp(Node,
Results);
2203void VectorLegalizer::ExpandREM(SDNode *Node,
2204 SmallVectorImpl<SDValue> &
Results) {
2206 "Expected REM node");
2220bool VectorLegalizer::tryExpandVecMathCall(SDNode *Node, RTLIB::Libcall LC,
2221 SmallVectorImpl<SDValue> &
Results) {
2224 assert(!
Node->isStrictFPOpcode() &&
"Unexpected strict fp operation!");
2227 if (LCImpl == RTLIB::Unsupported)
2230 EVT VT =
Node->getValueType(0);
2238 TargetLowering::ArgListTy
Args;
2243 assert(FuncTy->getNumParams() ==
Node->getNumOperands() + HasMaskArg &&
2244 EVT::getEVT(FuncTy->getReturnType(),
true) == VT &&
2245 "mismatch in value type and call signature type");
2247 for (
unsigned I = 0,
E = FuncTy->getNumParams();
I !=
E; ++
I) {
2248 Type *ParamTy = FuncTy->getParamType(
I);
2250 if (HasMaskArg &&
I ==
E - 1) {
2252 "unexpected vector mask type");
2260 "mismatch in value type and call argument type");
2261 Args.emplace_back(
Op, ParamTy);
2270 TargetLowering::CallLoweringInfo CLI(DAG);
2273 .setLibCallee(CC, FuncTy->getReturnType(), Callee, std::move(Args));
2275 std::pair<SDValue, SDValue> CallResult = TLI.
LowerCallTo(CLI);
2276 Results.push_back(CallResult.first);
2280void VectorLegalizer::UnrollStrictFPOp(SDNode *Node,
2281 SmallVectorImpl<SDValue> &
Results) {
2282 EVT VT =
Node->getValueType(0);
2285 unsigned NumOpers =
Node->getNumOperands();
2288 EVT TmpEltVT = EltVT;
2294 EVT ValueVTs[] = {TmpEltVT, MVT::Other};
2300 for (
unsigned i = 0; i < NumElems; ++i) {
2308 for (
unsigned j = 1;
j < NumOpers; ++
j) {
2325 ScalarResult = DAG.
getSelect(dl, EltVT, ScalarResult,
2340SDValue VectorLegalizer::UnrollVSETCC(SDNode *Node) {
2341 EVT VT =
Node->getValueType(0);
2347 EVT TmpEltVT =
LHS.getValueType().getVectorElementType();
2350 for (
unsigned i = 0; i < NumElems; ++i) {
2359 LHSElem, RHSElem, CC);
2368 return VectorLegalizer(*this).Run();
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Function Alias Analysis Results
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This file defines the DenseMap class.
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
static void createBSWAPShuffleMask(EVT VT, SmallVectorImpl< int > &ShuffleMask)
This file defines the SmallVector class.
This file describes how to lower LLVM code to machine code.
static APInt getSignMask(unsigned BitWidth)
Get the SignMask for a specific bit width.
static APInt getSignedMaxValue(unsigned numBits)
Gets maximum signed value of APInt for a specific bit width.
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
static constexpr ElementCount get(ScalarTy MinVal, bool Scalable)
const Triple & getTargetTriple() const
unsigned getVectorNumElements() const
bool isVector() const
Return true if this is a vector value type.
MVT getVectorElementType() const
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
MVT getScalarType() const
If this is a vector, return the element type, otherwise return this.
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
Represents one node in the SelectionDAG.
unsigned getNumValues() const
Return the number of values defined/returned by this operator.
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation.
SDNode * getNode() const
get the SDNode which holds the desired result
SDValue getValue(unsigned R) const
EVT getValueType() const
Return the ValueType of the referenced return value.
TypeSize getValueSizeInBits() const
Returns the size of the value in bits.
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
LLVM_ABI SDValue getElementCount(const SDLoc &DL, EVT VT, ElementCount EC)
const SDValue & getRoot() const
Return the root tag of the SelectionDAG.
const TargetSubtargetInfo & getSubtarget() const
LLVM_ABI SDVTList getVTList(EVT VT)
Return an SDVTList that represents the list of values specified.
LLVM_ABI SDValue getAllOnesConstant(const SDLoc &DL, EVT VT, bool IsTarget=false, bool IsOpaque=false)
LLVM_ABI bool LegalizeVectors()
This transforms the SelectionDAG into a SelectionDAG that only uses vector math operations supported ...
SDValue getSetCC(const SDLoc &DL, EVT VT, SDValue LHS, SDValue RHS, ISD::CondCode Cond, SDValue Chain=SDValue(), bool IsSignaling=false)
Helper function to make it easier to build SetCC's if you just have an ISD::CondCode instead of an SD...
LLVM_ABI SDValue UnrollVectorOp(SDNode *N, unsigned ResNE=0)
Utility function used by legalize and lowering to "unroll" a vector operation by splitting out the sc...
LLVM_ABI SDValue getConstantFP(double Val, const SDLoc &DL, EVT VT, bool isTarget=false)
Create a ConstantFPSDNode wrapping a constant value.
SDValue getInsertSubvector(const SDLoc &DL, SDValue Vec, SDValue SubVec, unsigned Idx)
Insert SubVec at the Idx element of Vec.
LLVM_ABI SDValue getStepVector(const SDLoc &DL, EVT ResVT, const APInt &StepVal)
Returns a vector of type ResVT whose elements contain the linear sequence <0, Step,...
LLVM_ABI SDValue getNOT(const SDLoc &DL, SDValue Val, EVT VT)
Create a bitwise NOT operation as (XOR Val, -1).
const TargetLowering & getTargetLoweringInfo() const
LLVM_ABI std::pair< SDValue, SDValue > UnrollVectorOverflowOp(SDNode *N, unsigned ResNE=0)
Like UnrollVectorOp(), but for the [US](ADD|SUB|MUL)O family of opcodes.
allnodes_const_iterator allnodes_begin() const
SDValue getUNDEF(EVT VT)
Return an UNDEF node. UNDEF does not have a useful SDLoc.
SDValue getBuildVector(EVT VT, const SDLoc &DL, ArrayRef< SDValue > Ops)
Return an ISD::BUILD_VECTOR node.
allnodes_const_iterator allnodes_end() const
SDValue getSelect(const SDLoc &DL, EVT VT, SDValue Cond, SDValue LHS, SDValue RHS, SDNodeFlags Flags=SDNodeFlags())
Helper function to make it easier to build Select's if you just have operands and don't want to check...
const DataLayout & getDataLayout() const
LLVM_ABI SDValue getConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isTarget=false, bool isOpaque=false)
Create a ConstantSDNode wrapping a constant value.
LLVM_ABI void RemoveDeadNodes()
This method deletes all unreachable nodes in the SelectionDAG.
LLVM_ABI SDValue getExternalSymbol(const char *Sym, EVT VT)
LLVM_ABI SDValue getVPLogicalNOT(const SDLoc &DL, SDValue Val, SDValue Mask, SDValue EVL, EVT VT)
Create a vector-predicated logical NOT operation as (VP_XOR Val, BooleanOne, Mask,...
LLVM_ABI SDValue getIntPtrConstant(uint64_t Val, const SDLoc &DL, bool isTarget=false)
LLVM_ABI SDValue getValueType(EVT)
LLVM_ABI SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
LLVM_ABI unsigned AssignTopologicalOrder()
Topological-sort the AllNodes list and a assign a unique node id for each node in the DAG based on th...
LLVM_ABI SDValue getBoolConstant(bool V, const SDLoc &DL, EVT VT, EVT OpVT)
Create a true or false constant of type VT using the target's BooleanContent for type OpVT.
LLVM_ABI SDValue getVectorIdxConstant(uint64_t Val, const SDLoc &DL, bool isTarget=false)
LLVMContext * getContext() const
const SDValue & setRoot(SDValue N)
Set the current root tag of the SelectionDAG.
LLVM_ABI SDNode * UpdateNodeOperands(SDNode *N, SDValue Op)
Mutate the specified node in-place to have the specified operands.
SDValue getEntryNode() const
Return the token chain corresponding to the entry of the function.
SDValue getSplat(EVT VT, const SDLoc &DL, SDValue Op)
Returns a node representing a splat of one value into all lanes of the provided vector type.
LLVM_ABI SDValue getVectorShuffle(EVT VT, const SDLoc &dl, SDValue N1, SDValue N2, ArrayRef< int > Mask)
Return an ISD::VECTOR_SHUFFLE node.
LLVM_ABI SDValue getLogicalNOT(const SDLoc &DL, SDValue Val, EVT VT)
Create a logical NOT operation as (XOR Val, BooleanOne).
ilist< SDNode >::iterator allnodes_iterator
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
virtual bool isShuffleMaskLegal(ArrayRef< int >, EVT) const
Targets can use this to indicate that they only support some VECTOR_SHUFFLE operations,...
LegalizeAction getCondCodeAction(ISD::CondCode CC, MVT VT) const
Return how the condition code should be treated: either it is legal, needs to be expanded to some oth...
LegalizeAction getFixedPointOperationAction(unsigned Op, EVT VT, unsigned Scale) const
Some fixed point operations may be natively supported by the target but only for specific scales.
bool isStrictFPEnabled() const
Return true if the target support strict float operation.
virtual EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Context, EVT VT) const
Return the ValueType of the result of SETCC operations.
BooleanContent getBooleanContents(bool isVec, bool isFloat) const
For targets without i1 registers, this gives the nature of the high-bits of boolean values held in ty...
virtual MVT getPointerTy(const DataLayout &DL, uint32_t AS=0) const
Return the pointer type for the given address space, defaults to the pointer type from the data layou...
LegalizeAction getTruncStoreAction(EVT ValVT, EVT MemVT) const
Return how this store with truncation should be treated: either it is legal, needs to be promoted to ...
LegalizeAction getLoadExtAction(unsigned ExtType, EVT ValVT, EVT MemVT) const
Return how this load with extension should be treated: either it is legal, needs to be promoted to a ...
bool isOperationLegalOrCustom(unsigned Op, EVT VT, bool LegalOnly=false) const
Return true if the specified operation is legal on this target or can be made legal with custom lower...
LegalizeAction getPartialReduceMLAAction(unsigned Opc, EVT AccVT, EVT InputVT) const
Return how a PARTIAL_REDUCE_U/SMLA node with Acc type AccVT and Input type InputVT should be treated.
LegalizeAction getStrictFPOperationAction(unsigned Op, EVT VT) const
RTLIB::LibcallImpl getLibcallImpl(RTLIB::Libcall Call) const
Get the libcall impl routine name for the specified libcall.
LegalizeAction getOperationAction(unsigned Op, EVT VT) const
Return how this operation should be treated: either it is legal, needs to be promoted to a larger siz...
MVT getTypeToPromoteTo(unsigned Op, MVT VT) const
If the action for this operation is to promote, this method returns the ValueType to promote to.
bool isOperationLegalOrCustomOrPromote(unsigned Op, EVT VT, bool LegalOnly=false) const
Return true if the specified operation is legal on this target or can be made legal with custom lower...
const RTLIB::RuntimeLibcallsInfo & getRuntimeLibcallsInfo() const
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
SDValue expandAddSubSat(SDNode *Node, SelectionDAG &DAG) const
Method for building the DAG expansion of ISD::[US][ADD|SUB]SAT.
bool expandMultipleResultFPLibCall(SelectionDAG &DAG, RTLIB::Libcall LC, SDNode *Node, SmallVectorImpl< SDValue > &Results, std::optional< unsigned > CallRetResNo={}) const
Expands a node with multiple results to an FP or vector libcall.
SDValue expandVPCTLZ(SDNode *N, SelectionDAG &DAG) const
Expand VP_CTLZ/VP_CTLZ_ZERO_UNDEF nodes.
bool expandMULO(SDNode *Node, SDValue &Result, SDValue &Overflow, SelectionDAG &DAG) const
Method for building the DAG expansion of ISD::[US]MULO.
SDValue scalarizeVectorStore(StoreSDNode *ST, SelectionDAG &DAG) const
SDValue expandVPBSWAP(SDNode *N, SelectionDAG &DAG) const
Expand VP_BSWAP nodes.
SDValue expandVecReduceSeq(SDNode *Node, SelectionDAG &DAG) const
Expand a VECREDUCE_SEQ_* into an explicit ordered calculation.
SDValue expandCTLZ(SDNode *N, SelectionDAG &DAG) const
Expand CTLZ/CTLZ_ZERO_UNDEF nodes.
SDValue expandBITREVERSE(SDNode *N, SelectionDAG &DAG) const
Expand BITREVERSE nodes.
SDValue expandCTTZ(SDNode *N, SelectionDAG &DAG) const
Expand CTTZ/CTTZ_ZERO_UNDEF nodes.
SDValue expandABD(SDNode *N, SelectionDAG &DAG) const
Expand ABDS/ABDU nodes.
SDValue expandShlSat(SDNode *Node, SelectionDAG &DAG) const
Method for building the DAG expansion of ISD::[US]SHLSAT.
SDValue expandFP_TO_INT_SAT(SDNode *N, SelectionDAG &DAG) const
Expand FP_TO_[US]INT_SAT into FP_TO_[US]INT and selects or min/max.
void expandSADDSUBO(SDNode *Node, SDValue &Result, SDValue &Overflow, SelectionDAG &DAG) const
Method for building the DAG expansion of ISD::S(ADD|SUB)O.
SDValue expandVPBITREVERSE(SDNode *N, SelectionDAG &DAG) const
Expand VP_BITREVERSE nodes.
SDValue expandABS(SDNode *N, SelectionDAG &DAG, bool IsNegative=false) const
Expand ABS nodes.
SDValue expandVecReduce(SDNode *Node, SelectionDAG &DAG) const
Expand a VECREDUCE_* into an explicit calculation.
bool expandFP_TO_UINT(SDNode *N, SDValue &Result, SDValue &Chain, SelectionDAG &DAG) const
Expand float to UINT conversion.
bool expandREM(SDNode *Node, SDValue &Result, SelectionDAG &DAG) const
Expand an SREM or UREM using SDIV/UDIV or SDIVREM/UDIVREM, if legal.
SDValue expandFMINIMUMNUM_FMAXIMUMNUM(SDNode *N, SelectionDAG &DAG) const
Expand fminimumnum/fmaximumnum into multiple comparison with selects.
SDValue expandCTPOP(SDNode *N, SelectionDAG &DAG) const
Expand CTPOP nodes.
SDValue expandVectorNaryOpBySplitting(SDNode *Node, SelectionDAG &DAG) const
std::pair< SDValue, SDValue > LowerCallTo(CallLoweringInfo &CLI) const
This function lowers an abstract call to a function into an actual call.
SDValue expandBSWAP(SDNode *N, SelectionDAG &DAG) const
Expand BSWAP nodes.
SDValue expandFMINIMUM_FMAXIMUM(SDNode *N, SelectionDAG &DAG) const
Expand fminimum/fmaximum into multiple comparison with selects.
std::pair< SDValue, SDValue > scalarizeVectorLoad(LoadSDNode *LD, SelectionDAG &DAG) const
Turn load of vector type into a load of the individual elements.
SDValue expandFunnelShift(SDNode *N, SelectionDAG &DAG) const
Expand funnel shift.
bool LegalizeSetCCCondCode(SelectionDAG &DAG, EVT VT, SDValue &LHS, SDValue &RHS, SDValue &CC, SDValue Mask, SDValue EVL, bool &NeedInvert, const SDLoc &dl, SDValue &Chain, bool IsSignaling=false) const
Legalize a SETCC or VP_SETCC with given LHS and RHS and condition code CC on the current target.
virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const
This callback is invoked for operations that are unsupported by the target, which are registered to u...
SDValue expandVPCTPOP(SDNode *N, SelectionDAG &DAG) const
Expand VP_CTPOP nodes.
SDValue expandFixedPointDiv(unsigned Opcode, const SDLoc &dl, SDValue LHS, SDValue RHS, unsigned Scale, SelectionDAG &DAG) const
Method for building the DAG expansion of ISD::[US]DIVFIX[SAT].
SDValue expandVPCTTZ(SDNode *N, SelectionDAG &DAG) const
Expand VP_CTTZ/VP_CTTZ_ZERO_UNDEF nodes.
SDValue expandVECTOR_COMPRESS(SDNode *Node, SelectionDAG &DAG) const
Expand a vector VECTOR_COMPRESS into a sequence of extract element, store temporarily,...
SDValue expandROT(SDNode *N, bool AllowVectorOps, SelectionDAG &DAG) const
Expand rotations.
SDValue expandFMINNUM_FMAXNUM(SDNode *N, SelectionDAG &DAG) const
Expand fminnum/fmaxnum into fminnum_ieee/fmaxnum_ieee with quieted inputs.
SDValue expandCMP(SDNode *Node, SelectionDAG &DAG) const
Method for building the DAG expansion of ISD::[US]CMP.
SDValue expandFixedPointMul(SDNode *Node, SelectionDAG &DAG) const
Method for building the DAG expansion of ISD::[U|S]MULFIX[SAT].
SDValue expandIntMINMAX(SDNode *Node, SelectionDAG &DAG) const
Method for building the DAG expansion of ISD::[US][MIN|MAX].
SDValue expandVectorFindLastActive(SDNode *N, SelectionDAG &DAG) const
Expand VECTOR_FIND_LAST_ACTIVE nodes.
SDValue expandPartialReduceMLA(SDNode *Node, SelectionDAG &DAG) const
Expands PARTIAL_REDUCE_S/UMLA nodes to a series of simpler operations, consisting of zext/sext,...
void expandUADDSUBO(SDNode *Node, SDValue &Result, SDValue &Overflow, SelectionDAG &DAG) const
Method for building the DAG expansion of ISD::U(ADD|SUB)O.
bool expandUINT_TO_FP(SDNode *N, SDValue &Result, SDValue &Chain, SelectionDAG &DAG) const
Expand UINT(i64) to double(f64) conversion.
SDValue expandAVG(SDNode *N, SelectionDAG &DAG) const
Expand vector/scalar AVGCEILS/AVGCEILU/AVGFLOORS/AVGFLOORU nodes.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
constexpr std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
@ SETCC
SetCC operator - This evaluates to a true value iff the condition is true.
@ MERGE_VALUES
MERGE_VALUES - This node takes multiple discrete operands and returns them all as its individual resu...
@ STRICT_FSETCC
STRICT_FSETCC/STRICT_FSETCCS - Constrained versions of SETCC, used for floating-point operands only.
@ LOOP_DEPENDENCE_RAW_MASK
@ VECREDUCE_SEQ_FADD
Generic reduction nodes.
@ SMUL_LOHI
SMUL_LOHI/UMUL_LOHI - Multiply two integers of type iN, producing a signed/unsigned value of type i[2...
@ BSWAP
Byte Swap and Counting operators.
@ SMULFIX
RESULT = [US]MULFIX(LHS, RHS, SCALE) - Perform fixed point multiplication on 2 integers with the same...
@ ADD
Simple integer binary arithmetic operators.
@ LOAD
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
@ SMULFIXSAT
Same as the corresponding unsaturated fixed point instructions, but the result is clamped between the...
@ ANY_EXTEND
ANY_EXTEND - Used for integer types. The high bits are undefined.
@ FMA
FMA - Perform a * b + c with no intermediate rounding step.
@ VECTOR_FIND_LAST_ACTIVE
@ FMODF
FMODF - Decomposes the operand into integral and fractional parts, each having the same type and sign...
@ FATAN2
FATAN2 - atan2, inspired by libm.
@ FSINCOSPI
FSINCOSPI - Compute both the sine and cosine times pi more accurately than FSINCOS(pi*x),...
@ SINT_TO_FP
[SU]INT_TO_FP - These operators convert integers (whose interpreted sign depends on the first letter)...
@ VECREDUCE_FMAX
FMIN/FMAX nodes can have flags, for NaN/NoNaN variants.
@ FADD
Simple binary floating point operators.
@ VECREDUCE_FMAXIMUM
FMINIMUM/FMAXIMUM nodes propatate NaNs and signed zeroes using the llvm.minimum and llvm....
@ ABS
ABS - Determine the unsigned absolute value of a signed integer value of the same bitwidth.
@ SIGN_EXTEND_VECTOR_INREG
SIGN_EXTEND_VECTOR_INREG(Vector) - This operator represents an in-register sign-extension of the low ...
@ SDIVREM
SDIVREM/UDIVREM - Divide two integers and produce both a quotient and remainder result.
@ FPTRUNC_ROUND
FPTRUNC_ROUND - This corresponds to the fptrunc_round intrinsic.
@ BITCAST
BITCAST - This operator converts between integer, vector and FP values, as if the value was stored to...
@ FLDEXP
FLDEXP - ldexp, inspired by libm (op0 * 2**op1).
@ SDIVFIX
RESULT = [US]DIVFIX(LHS, RHS, SCALE) - Perform fixed point division on 2 integers with the same width...
@ STRICT_FSQRT
Constrained versions of libm-equivalent floating point intrinsics.
@ SIGN_EXTEND
Conversion operators.
@ AVGCEILS
AVGCEILS/AVGCEILU - Rounding averaging add - Add two integers using an integer of type i[N+2],...
@ VECREDUCE_FADD
These reductions have relaxed evaluation order semantics, and have a single vector operand.
@ CTTZ_ZERO_UNDEF
Bit counting operators with an undefined result for zero inputs.
@ FSINCOS
FSINCOS - Compute both fsin and fcos as a single operation.
@ FNEG
Perform various unary floating-point operations inspired by libm.
@ SSUBO
Same for subtraction.
@ STEP_VECTOR
STEP_VECTOR(IMM) - Returns a scalable vector whose lanes are comprised of a linear sequence of unsign...
@ FCANONICALIZE
Returns platform specific canonical encoding of a floating point number.
@ SSUBSAT
RESULT = [US]SUBSAT(LHS, RHS) - Perform saturation subtraction on 2 integers with the same bit width ...
@ SELECT
Select(COND, TRUEVAL, FALSEVAL).
@ SPLAT_VECTOR
SPLAT_VECTOR(VAL) - Returns a vector with the scalar value VAL duplicated in all lanes.
@ SADDO
RESULT, BOOL = [SU]ADDO(LHS, RHS) - Overflow-aware nodes for addition.
@ VECREDUCE_ADD
Integer reductions may have a result type larger than the vector element type.
@ MULHU
MULHU/MULHS - Multiply high - Multiply two integers of type iN, producing an unsigned/signed value of...
@ SHL
Shift and rotation operations.
@ FMINNUM_IEEE
FMINNUM_IEEE/FMAXNUM_IEEE - Perform floating-point minimumNumber or maximumNumber on two values,...
@ EXTRACT_VECTOR_ELT
EXTRACT_VECTOR_ELT(VECTOR, IDX) - Returns a single element from VECTOR identified by the (potentially...
@ ZERO_EXTEND
ZERO_EXTEND - Used for integer types, zeroing the new bits.
@ SELECT_CC
Select with condition operator - This selects between a true value and a false value (ops #2 and #3) ...
@ FMINNUM
FMINNUM/FMAXNUM - Perform floating-point minimum maximum on two values, following IEEE-754 definition...
@ SSHLSAT
RESULT = [US]SHLSAT(LHS, RHS) - Perform saturation left shift.
@ SMULO
Same for multiplication.
@ ANY_EXTEND_VECTOR_INREG
ANY_EXTEND_VECTOR_INREG(Vector) - This operator represents an in-register any-extension of the low la...
@ SIGN_EXTEND_INREG
SIGN_EXTEND_INREG - This operator atomically performs a SHL/SRA pair to sign extend a small value in ...
@ SMIN
[US]{MIN/MAX} - Binary minimum or maximum of signed or unsigned integers.
@ SDIVFIXSAT
Same as the corresponding unsaturated fixed point instructions, but the result is clamped between the...
@ FP_EXTEND
X = FP_EXTEND(Y) - Extend a smaller FP type into a larger FP type.
@ VSELECT
Select with a vector condition (op #0) and two vector operands (ops #1 and #2), returning a vector re...
@ STRICT_SINT_TO_FP
STRICT_[US]INT_TO_FP - Convert a signed or unsigned integer to a floating point value.
@ MGATHER
Masked gather and scatter - load and store operations for a vector of random addresses with additiona...
@ STRICT_FP_ROUND
X = STRICT_FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating point type down to the precision ...
@ STRICT_FP_TO_SINT
STRICT_FP_TO_[US]INT - Convert a floating point value to a signed or unsigned integer.
@ FMINIMUM
FMINIMUM/FMAXIMUM - NaN-propagating minimum/maximum that also treat -0.0 as less than 0....
@ FP_TO_SINT
FP_TO_[US]INT - Convert a floating point value to a signed or unsigned integer.
@ STRICT_FP_EXTEND
X = STRICT_FP_EXTEND(Y) - Extend a smaller FP type into a larger FP type.
@ AND
Bitwise operators - logical and, logical or, logical xor.
@ SCMP
[US]CMP - 3-way comparison of signed or unsigned integers.
@ AVGFLOORS
AVGFLOORS/AVGFLOORU - Averaging add - Add two integers using an integer of type i[N+1],...
@ STRICT_FADD
Constrained versions of the binary floating point operators.
@ TokenFactor
TokenFactor - This node takes multiple tokens as input and produces a single token result.
@ FFREXP
FFREXP - frexp, extract fractional and exponent component of a floating-point value.
@ FP_ROUND
X = FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating point type down to the precision of the ...
@ VECTOR_COMPRESS
VECTOR_COMPRESS(Vec, Mask, Passthru) consecutively place vector elements based on mask e....
@ ZERO_EXTEND_VECTOR_INREG
ZERO_EXTEND_VECTOR_INREG(Vector) - This operator represents an in-register zero-extension of the low ...
@ FP_TO_SINT_SAT
FP_TO_[US]INT_SAT - Convert floating point value in operand 0 to a signed or unsigned scalar integer ...
@ TRUNCATE
TRUNCATE - Completely drop the high bits.
@ AssertSext
AssertSext, AssertZext - These nodes record if a register contains a value that has already been zero...
@ FCOPYSIGN
FCOPYSIGN(X, Y) - Return the value of X with the sign of Y.
@ SADDSAT
RESULT = [US]ADDSAT(LHS, RHS) - Perform saturation addition on 2 integers with the same bit width (W)...
@ FMINIMUMNUM
FMINIMUMNUM/FMAXIMUMNUM - minimumnum/maximumnum that is same with FMINNUM_IEEE and FMAXNUM_IEEE besid...
@ ABDS
ABDS/ABDU - Absolute difference - Return the absolute difference between two numbers interpreted as s...
@ BUILD_VECTOR
BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a fixed-width vector with the specified,...
@ LOOP_DEPENDENCE_WAR_MASK
LLVM_ABI std::optional< unsigned > getVPMaskIdx(unsigned Opcode)
The operand position of the vector mask.
LLVM_ABI std::optional< unsigned > getVPExplicitVectorLengthIdx(unsigned Opcode)
The operand position of the explicit vector length parameter.
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out,...
LoadExtType
LoadExtType enum - This enum defines the three variants of LOADEXT (load with extension).
LLVM_ABI bool isVPOpcode(unsigned Opcode)
Whether this is a vector-predicated Opcode.
LLVM_ABI Libcall getREM(EVT VT)
LLVM_ABI Libcall getSINCOSPI(EVT RetVT)
getSINCOSPI - Return the SINCOSPI_* value for the given types, or UNKNOWN_LIBCALL if there is none.
LLVM_ABI Libcall getMODF(EVT VT)
getMODF - Return the MODF_* value for the given types, or UNKNOWN_LIBCALL if there is none.
LLVM_ABI Libcall getSINCOS(EVT RetVT)
getSINCOS - Return the SINCOS_* value for the given types, or UNKNOWN_LIBCALL if there is none.
NodeAddr< NodeBase * > Node
This is an optimization pass for GlobalISel generic memory operations.
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
SmallVector< ValueTypeFromRangeType< R >, Size > to_vector(R &&Range)
Given a range of type R, iterate the entire range and return a SmallVector with elements of the vecto...
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
MutableArrayRef(T &OneElt) -> MutableArrayRef< T >
@ Xor
Bitwise or logical XOR of integers.
DWARFExpression::Operation Op
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
auto seq(T Begin, T End)
Iterate over an integral type from Begin up to - but not including - End.
EVT changeVectorElementTypeToInteger() const
Return a vector with the same number of elements as this vector, but with the element type converted ...
static EVT getVectorVT(LLVMContext &Context, EVT VT, unsigned NumElements, bool IsScalable=false)
Returns the EVT that represents a vector NumElements in length, where each element is of type VT.
ElementCount getVectorElementCount() const
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
uint64_t getScalarSizeInBits() const
static LLVM_ABI EVT getEVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
bool isScalableVT() const
Return true if the type is a scalable type.
bool isFixedLengthVector() const
bool isVector() const
Return true if this is a vector value type.
EVT getScalarType() const
If this is a vector type, return the element type, otherwise return this.
LLVM_ABI Type * getTypeForEVT(LLVMContext &Context) const
This method returns an LLVM type corresponding to the specified EVT.
bool isScalableVector() const
Return true if this is a vector type where the runtime length is machine dependent.
EVT getVectorElementType() const
Given a vector type, return the type of each element.
EVT changeVectorElementType(EVT EltVT) const
Return a VT for a vector type whose attributes match ourselves with the exception of the element type...
unsigned getVectorNumElements() const
Given a vector type, return the number of elements it contains.
bool bitsLE(EVT VT) const
Return true if this has no more bits than VT.
CallingConv::ID getLibcallImplCallingConv(RTLIB::LibcallImpl Call) const
Get the CallingConv that should be used for the specified libcall.
std::pair< FunctionType *, AttributeList > getFunctionTy(LLVMContext &Ctx, const Triple &TT, const DataLayout &DL, RTLIB::LibcallImpl LibcallImpl) const
static bool hasVectorMaskArgument(RTLIB::LibcallImpl Impl)
Returns true if the function has a vector mask argument, which is assumed to be the last argument.