23 HexagonTargetLowering::initializeHVXLowering() {
64 auto setPromoteTo = [
this] (
unsigned Opc,
MVT FromTy,
MVT ToTy) {
72 for (
MVT T : LegalV) {
124 for (
MVT T : LegalW) {
170 for (
MVT T : LegalW) {
184 for (
MVT T : LegalV) {
218 HexagonTargetLowering::typeJoin(
const TypePair &Tys)
const {
219 assert(Tys.first.getVectorElementType() == Tys.second.getVectorElementType());
223 Tys.second.getVectorNumElements());
226 HexagonTargetLowering::TypePair
227 HexagonTargetLowering::typeSplit(
MVT VecTy)
const {
230 assert((NumElem % 2) == 0 &&
"Expecting even-sized vector type");
232 return { HalfTy, HalfTy };
236 HexagonTargetLowering::typeExtElem(
MVT VecTy,
unsigned Factor)
const {
243 HexagonTargetLowering::typeTruncElem(
MVT VecTy,
unsigned Factor)
const {
250 HexagonTargetLowering::opCastElem(
SDValue Vec,
MVT ElemTy,
252 if (ty(Vec).getVectorElementType() == ElemTy)
259 HexagonTargetLowering::opJoin(
const VectorPair &Ops,
const SDLoc &dl,
262 Ops.second, Ops.first);
265 HexagonTargetLowering::VectorPair
266 HexagonTargetLowering::opSplit(
SDValue Vec,
const SDLoc &dl,
268 TypePair Tys = typeSplit(ty(Vec));
271 return DAG.
SplitVector(Vec, dl, Tys.first, Tys.second);
275 HexagonTargetLowering::isHvxSingleTy(
MVT Ty)
const {
281 HexagonTargetLowering::isHvxPairTy(
MVT Ty)
const {
287 HexagonTargetLowering::convertToByteIndex(
SDValue ElemIdx,
MVT ElemTy,
296 unsigned L =
Log2_32(ElemWidth/8);
297 const SDLoc &dl(ElemIdx);
303 HexagonTargetLowering::getIndexInWord32(
SDValue Idx,
MVT ElemTy,
306 assert(ElemWidth >= 8 && ElemWidth <= 32);
312 const SDLoc &dl(Idx);
319 HexagonTargetLowering::getByteShuffle(
const SDLoc &dl,
SDValue Op0,
336 for (
unsigned I = 0;
I != ElemSize; ++
I)
339 int NewM = M*ElemSize;
340 for (
unsigned I = 0;
I != ElemSize; ++
I)
344 assert(ResTy.getVectorNumElements() == ByteMask.
size());
346 opCastElem(Op1,
MVT::i8, DAG), ByteMask);
353 unsigned VecLen = Values.
size();
359 unsigned ElemSize = ElemWidth / 8;
360 assert(ElemSize*VecLen == HwLen);
364 assert((ElemSize == 1 || ElemSize == 2) &&
"Invalid element size");
365 unsigned OpsPerWord = (ElemSize == 1) ? 4 : 2;
367 for (
unsigned i = 0; i != VecLen; i += OpsPerWord) {
368 SDValue W = buildVector32(Values.
slice(i, OpsPerWord), dl, PartVT, DAG);
375 unsigned NumWords = Words.
size();
376 bool IsSplat =
true, IsUndef =
true;
378 for (
unsigned i = 0; i != NumWords && IsSplat; ++i) {
379 if (isUndef(Words[i]))
384 else if (SplatV != Words[i])
392 if (IdxN && IdxN->isNullValue())
393 return getZero(dl, VecTy, DAG);
400 bool AllConst = getBuildVectorConstInts(Values, VecTy, DAG, Consts);
405 unsigned Align = HwLen;
418 auto IsBuildFromExtracts = [
this,&Values] (
SDValue &SrcVec,
423 SrcIdx.push_back(-1);
437 assert(I >= 0 &&
"Negative element index");
446 if (IsBuildFromExtracts(ExtVec, ExtIdx)) {
447 MVT ExtTy = ty(ExtVec);
449 if (ExtLen == VecLen || ExtLen == 2*VecLen) {
456 for (
int M : ExtIdx) {
466 for (
unsigned I = 0;
I != ExtLen; ++
I) {
467 if (Mask.
size() == ExtLen)
475 if (ExtLen == VecLen)
483 SDValue HalfV0 = getInstr(Hexagon::V6_vd0, dl, VecTy, {}, DAG);
484 SDValue HalfV1 = getInstr(Hexagon::V6_vd0, dl, VecTy, {}, DAG);
486 for (
unsigned i = 0; i != NumWords/2; ++i) {
490 {HalfV1, Words[i+NumWords/2]});
502 HexagonTargetLowering::createHvxPrefixPred(
SDValue PredV,
const SDLoc &dl,
503 unsigned BitBytes,
bool ZeroFill,
SelectionDAG &DAG)
const {
504 MVT PredTy = ty(PredV);
523 for (
unsigned i = 0; i != HwLen; ++i) {
524 unsigned Num = i % Scale;
525 unsigned Off = i / Scale;
526 Mask[BlockLen*Num + Off] = i;
533 SDValue Q = getInstr(Hexagon::V6_pred_scalar2, dl, BoolTy,
546 auto Lo32 = [&DAG, &dl] (
SDValue P) {
549 auto Hi32 = [&DAG, &dl] (
SDValue P) {
559 while (Bytes < BitBytes) {
564 for (
const SDValue &
W : Words[IdxW ^ 1]) {
570 for (
const SDValue &
W : Words[IdxW ^ 1]) {
578 assert(Bytes == BitBytes);
580 SDValue Vec = ZeroFill ? getZero(dl, ByteTy, DAG) : DAG.
getUNDEF(ByteTy);
582 for (
const SDValue &
W : Words[IdxW]) {
596 unsigned VecLen = Values.
size();
598 assert(VecLen <= HwLen || VecLen == 8*HwLen);
600 bool AllT =
true, AllF =
true;
603 if (
const auto *
N = dyn_cast<ConstantSDNode>(V.getNode()))
604 return !
N->isNullValue();
607 auto IsFalse = [] (
SDValue V) {
608 if (
const auto *
N = dyn_cast<ConstantSDNode>(V.getNode()))
609 return N->isNullValue();
613 if (VecLen <= HwLen) {
617 assert(HwLen % VecLen == 0);
618 unsigned BitBytes = HwLen / VecLen;
625 for (
unsigned B = 0;
B != BitBytes; ++
B)
632 for (
unsigned I = 0;
I != VecLen;
I += 8) {
635 for (; B != 8; ++
B) {
636 if (!Values[
I+B].isUndef())
649 assert(Values[
I+B].isUndef() || Values[
I+B] == F);
659 SDValue ByteVec = buildHvxVectorReg(Bytes, dl, ByteTy, DAG);
664 HexagonTargetLowering::extractHvxElementReg(
SDValue VecV,
SDValue IdxV,
669 assert(ElemWidth >= 8 && ElemWidth <= 32);
672 SDValue ByteIdx = convertToByteIndex(IdxV, ElemTy, DAG);
681 SDValue SubIdx = getIndexInWord32(IdxV, ElemTy, DAG);
684 return extractVector(ExVec, SubIdx, dl, ElemTy,
MVT::i32, DAG);
688 HexagonTargetLowering::extractHvxElementPred(
SDValue VecV,
SDValue IdxV,
703 return getInstr(Hexagon::C2_cmpgtui, dl,
MVT::i1, {ExtB, Zero}, DAG);
707 HexagonTargetLowering::insertHvxElementReg(
SDValue VecV,
SDValue IdxV,
712 assert(ElemWidth >= 8 && ElemWidth <= 32);
717 MVT VecTy = ty(VecV);
729 SDValue ByteIdx = convertToByteIndex(IdxV, ElemTy, DAG);
731 return InsertWord(VecV, ValV, ByteIdx);
742 SDValue SubIdx = getIndexInWord32(IdxV, ElemTy, DAG);
743 MVT SubVecTy = tyVector(ty(Ext), ElemTy);
745 ValV, SubIdx, dl, ElemTy, DAG);
748 return InsertWord(VecV, Ins, ByteIdx);
752 HexagonTargetLowering::insertHvxElementPred(
SDValue VecV,
SDValue IdxV,
763 SDValue InsV = insertHvxElementReg(ByteVec, IdxV, ValV, dl, DAG);
768 HexagonTargetLowering::extractHvxSubvectorReg(
SDValue VecV,
SDValue IdxV,
770 MVT VecTy = ty(VecV);
772 unsigned Idx = cast<ConstantSDNode>(IdxV.
getNode())->getZExtValue();
779 if (isHvxPairTy(VecTy)) {
781 if (Idx * ElemWidth >= 8*HwLen) {
782 SubIdx = Hexagon::vsub_hi;
785 SubIdx = Hexagon::vsub_lo;
787 VecTy = typeSplit(VecTy).first;
799 unsigned WordIdx = (Idx*ElemWidth) / 32;
813 HexagonTargetLowering::extractHvxSubvectorPred(
SDValue VecV,
SDValue IdxV,
815 MVT VecTy = ty(VecV);
820 unsigned Idx = cast<ConstantSDNode>(IdxV.
getNode())->getZExtValue();
824 unsigned Offset = Idx * BitBytes;
835 for (
unsigned i = 0; i != HwLen/Rep; ++i) {
836 for (
unsigned j = 0; j != Rep; ++j)
853 unsigned Rep = 8 / ResLen;
856 for (
unsigned r = 0; r != HwLen/ResLen; ++r) {
858 for (
unsigned i = 0; i != ResLen; ++i) {
859 for (
unsigned j = 0; j != Rep; ++j)
872 return getInstr(Hexagon::A4_vcmpbgtui, dl, ResTy,
877 HexagonTargetLowering::insertHvxSubvectorReg(
SDValue VecV,
SDValue SubV,
879 MVT VecTy = ty(VecV);
880 MVT SubTy = ty(SubV);
885 bool IsPair = isHvxPairTy(VecTy);
899 if (isHvxSingleTy(SubTy)) {
900 if (
const auto *CN = dyn_cast<const ConstantSDNode>(IdxV.
getNode())) {
901 unsigned Idx = CN->getZExtValue();
903 unsigned SubIdx = (Idx == 0) ? Hexagon::vsub_lo : Hexagon::vsub_hi;
926 if (!IdxN || !IdxN->isNullValue()) {
934 unsigned RolBase = HwLen;
949 if (RolBase != 4 || !IdxN || !IdxN->isNullValue()) {
964 HexagonTargetLowering::insertHvxSubvectorPred(
SDValue VecV,
SDValue SubV,
966 MVT VecTy = ty(VecV);
967 MVT SubTy = ty(SubV);
974 assert(HwLen % VecLen == 0 &&
"Unexpected vector type");
977 unsigned BitBytes = HwLen / VecLen;
978 unsigned BlockLen = HwLen / Scale;
982 SDValue ByteSub = createHvxPrefixPred(SubV, dl, BitBytes,
false, DAG);
986 if (!IdxN || !IdxN->isNullValue()) {
996 SDValue Q = getInstr(Hexagon::V6_pred_scalar2, dl, BoolTy,
998 ByteVec = getInstr(Hexagon::V6_vmux, dl, ByteTy, {Q, ByteSub, ByteVec}, DAG);
1000 if (!IdxN || !IdxN->isNullValue()) {
1009 HexagonTargetLowering::extendHvxVectorPred(
SDValue VecV,
const SDLoc &dl,
1021 SDValue False = getZero(dl, ResTy, DAG);
1022 return DAG.
getSelect(dl, ResTy, VecV, True, False);
1028 const SDLoc &dl(Op);
1033 for (
unsigned i = 0; i !=
Size; ++i)
1037 return buildHvxVectorPred(Ops, dl, VecTy, DAG);
1041 MVT SingleTy = typeSplit(VecTy).first;
1047 return buildHvxVectorReg(Ops, dl, VecTy, DAG);
1057 const SDLoc &dl(Op);
1071 for (
unsigned i = 0,
e = Elems.
size(); i !=
e; ++i) {
1111 MVT HalfTy = typeSplit(VecTy).first;
1125 SDValue P = createHvxPrefixPred(V, dl, BitBytes,
true, DAG);
1129 unsigned InpLen = ty(Op.
getOperand(0)).getVectorNumElements();
1132 SDValue Res = getZero(dl, ByteTy, DAG);
1133 for (
unsigned i = 0,
e = Prefixes.
size(); i !=
e; ++i) {
1146 const SDLoc &dl(Op);
1149 return extractHvxElementPred(VecV, IdxV, dl, ty(Op), DAG);
1151 return extractHvxElementReg(VecV, IdxV, dl, ty(Op), DAG);
1157 const SDLoc &dl(Op);
1163 return insertHvxElementPred(VecV, IdxV, ValV, dl, DAG);
1165 return insertHvxElementReg(VecV, IdxV, ValV, dl, DAG);
1172 MVT SrcTy = ty(SrcV);
1175 unsigned Idx = cast<ConstantSDNode>(IdxV.
getNode())->getZExtValue();
1178 const SDLoc &dl(Op);
1182 return extractHvxSubvectorPred(SrcV, IdxV, dl, DstTy, DAG);
1184 return extractHvxSubvectorReg(SrcV, IdxV, dl, DstTy, DAG);
1195 const SDLoc &dl(Op);
1196 MVT VecTy = ty(VecV);
1199 return insertHvxSubvectorPred(VecV, ValV, IdxV, dl, DAG);
1201 return insertHvxSubvectorReg(VecV, ValV, IdxV, dl, DAG);
1214 return LowerHvxSignExt(Op, DAG);
1224 return extendHvxVectorPred(InpV,
SDLoc(Op), ty(Op),
false, DAG);
1234 return extendHvxVectorPred(InpV,
SDLoc(Op), ty(Op),
true, DAG);
1242 const SDLoc &dl(Op);
1245 assert(ResTy == ty(InpV));
1251 uint64_t Splat1 = 0, SplatW = 0;
1253 for (
unsigned i = 0; i != 32/ElemWidth; ++i) {
1254 Splat1 = (Splat1 << ElemWidth) | 1;
1255 SplatW = (SplatW << ElemWidth) | ElemWidth;
1277 const SDLoc &dl(Op);
1290 MVT ExtTy = typeExtElem(ResTy, 2);
1291 unsigned MpyOpc = ElemTy ==
MVT::i8 ? Hexagon::V6_vmpybv
1292 : Hexagon::V6_vmpyhv;
1293 SDValue M = getInstr(MpyOpc, dl, ExtTy, {Vs, Vt}, DAG);
1296 for (
unsigned I = 0;
I < VecLen;
I += 2) {
1300 VectorPair
P = opSplit(opCastElem(M, ElemTy, DAG), dl, DAG);
1301 SDValue BS = getByteShuffle(dl, P.first, P.second, ShuffMask, DAG);
1308 return getInstr(Hexagon::V6_vmpyih, dl, ResTy, {Vs, Vt}, DAG);
1315 SDValue T0 = getInstr(Hexagon::V6_vmpyiowh, dl, ResTy, {Vs, Vt}, DAG);
1316 SDValue T1 = getInstr(Hexagon::V6_vaslw, dl, ResTy, {T0, S16}, DAG);
1317 SDValue T2 = getInstr(Hexagon::V6_vmpyiewuh_acc, dl, ResTy,
1331 const SDLoc &dl(Op);
1347 MVT ExtTy = typeExtElem(ResTy, 2);
1348 unsigned MpyOpc = ElemTy ==
MVT::i8 1349 ? (IsSigned ? Hexagon::V6_vmpybv : Hexagon::V6_vmpyubv)
1350 : (IsSigned ? Hexagon::V6_vmpyhv : Hexagon::V6_vmpyuhv);
1351 SDValue M = getInstr(MpyOpc, dl, ExtTy, {Vs, Vt}, DAG);
1354 for (
unsigned I = 0;
I < VecLen;
I += 2) {
1358 VectorPair
P = opSplit(opCastElem(M, ElemTy, DAG), dl, DAG);
1359 SDValue BS = getByteShuffle(dl, P.first, P.second, ShuffMask, DAG);
1381 SDValue T0 = getInstr(Hexagon::V6_vmpyewuh, dl, ResTy, {Vt, Vs}, DAG);
1383 SDValue S0 = getInstr(Hexagon::V6_vasrw, dl, ResTy, {Vs, S16}, DAG);
1384 SDValue T1 = getInstr(Hexagon::V6_vmpyiewuh_acc, dl, ResTy,
1387 SDValue S2 = getInstr(Hexagon::V6_vasrw, dl, ResTy, {
T1, S16}, DAG);
1389 SDValue T2 = getInstr(Hexagon::V6_vmpyiowh, dl, ResTy, {S0, Vt}, DAG);
1397 auto LoVec = [&DAG,ResTy,dl] (
SDValue Pair) {
1400 auto HiVec = [&DAG,ResTy,dl] (
SDValue Pair) {
1405 SDValue P = getInstr(Hexagon::V6_lvsplatw, dl, ResTy,
1410 SDValue T0 = getInstr(Hexagon::V6_vmpyuhv, dl, PairTy, {Vs, Vt}, DAG);
1414 SDValue T1 = getInstr(Hexagon::V6_vlsrw, dl, ResTy, {LoVec(T0), S16}, DAG);
1417 SDValue D0 = getInstr(Hexagon::V6_vdelta, dl, ResTy, {Vt, P}, DAG);
1418 SDValue T2 = getInstr(Hexagon::V6_vmpyuhv, dl, PairTy, {Vs, D0}, DAG);
1423 SDValue T3 = getInstr(Hexagon::V6_vadduhw, dl, PairTy,
1424 {LoVec(T2), HiVec(T2)}, DAG);
1427 SDValue T5 = getInstr(Hexagon::V6_vlsrw, dl, ResTy, {T4, S16}, DAG);
1443 if (
SDValue S = getVectorShiftByInt(Op, DAG))
1452 const SDLoc &dl(Op);
1454 auto SplitVTNode = [&DAG,
this] (
const VTSDNode *
N) {
1455 MVT Ty = typeSplit(
N->getVT().getSimpleVT()).
first;
1457 return std::make_pair(TV, TV);
1462 ? opSplit(A, dl, DAG)
1463 : std::make_pair(A, A);
1466 if (
const auto *
N = dyn_cast<const VTSDNode>(A.getNode()))
1469 OpsL.push_back(P.first);
1470 OpsH.push_back(P.second);
1474 MVT HalfTy = typeSplit(ResTy).first;
1486 if (!isHvxPairTy(MemTy))
1489 const SDLoc &dl(Op);
1491 MVT SingleTy = typeSplit(MemTy).first;
1515 VectorPair Vals = opSplit(cast<StoreSDNode>(Op)->getValue(), dl, DAG);
1527 bool IsPairOp = isHvxPairTy(ty(Op)) ||
1529 return isHvxPairTy(ty(V));
1538 return SplitHvxMemOp(Op, DAG);
1556 return SplitHvxPairOp(Op, DAG);
1573 case ISD::CTTZ:
return LowerHvxCttz(Op, DAG);
1576 case ISD::SRL:
return LowerHvxShift(Op, DAG);
1577 case ISD::MUL:
return LowerHvxMul(Op, DAG);
1579 case ISD::MULHU:
return LowerHvxMulh(Op, DAG);
1593 HexagonTargetLowering::PerformHvxDAGCombine(
SDNode *
N, DAGCombinerInfo &DCI)
1615 HexagonTargetLowering::isHvxOperation(
SDValue Op)
const {
SDValue getStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
Helper function to build ISD::STORE nodes.
static MVT getIntegerVT(unsigned BitWidth)
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
bool useHVX128BOps() const
EVT getValueType() const
Return the ValueType of the referenced return value.
ArrayRef< T > take_front(size_t N=1) const
Return a copy of *this with only the first N elements.
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
EXTRACT_SUBVECTOR(VECTOR, IDX) - Returns a subvector from VECTOR (an vector value) starting with the ...
This class represents lattice values for constants.
static MVT getVectorVT(MVT VT, unsigned NumElements)
VECTOR_SHUFFLE(VEC1, VEC2) - Returns a vector, of the same type as VEC1/VEC2.
ZERO_EXTEND_VECTOR_INREG(Vector) - This operator represents an in-register zero-extension of the low ...
bool isVector() const
Return true if this is a vector value type.
void push_back(const T &Elt)
TypeSize getSizeInBits() const
Returns the size of the specified MVT in bits.
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
static const MVT LegalW128[]
bool test(unsigned Idx) const
unsigned getVectorNumElements() const
const SDValue & getChain() const
SDValue getSelect(const SDLoc &DL, EVT VT, SDValue Cond, SDValue LHS, SDValue RHS)
Helper function to make it easier to build Select's if you just have operands and don't want to check...
SIGN_EXTEND_VECTOR_INREG(Vector) - This operator represents an in-register sign-extension of the low ...
SDNode * getNode() const
get the SDNode which holds the desired result
SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
static const MVT LegalV64[]
SDValue getConstantPool(const Constant *C, EVT VT, unsigned Align=0, int Offs=0, bool isT=false, unsigned TargetFlags=0)
MachineMemOperand * getMemOperand() const
Return a MachineMemOperand object describing the memory reference performed by operation.
INSERT_SUBVECTOR(VECTOR1, VECTOR2, IDX) - Returns a vector with VECTOR2 inserted into VECTOR1 at the ...
std::pair< MCSymbol *, MachineModuleInfoImpl::StubValueTy > PairTy
A description of a memory reference used in the backend.
Shift and rotation operations.
Base class for LoadSDNode and StoreSDNode.
SDValue getTargetExtractSubreg(int SRIdx, const SDLoc &DL, EVT VT, SDValue Operand)
A convenience function for creating TargetInstrInfo::EXTRACT_SUBREG nodes.
SDValue LowerConstantPool(SDValue Op, SelectionDAG &DAG) const
void setCondCodeAction(ISD::CondCode CC, MVT VT, LegalizeAction Action)
Indicate that the specified condition code is or isn't supported on the target and indicate what to d...
SDValue getEntryNode() const
Return the token chain corresponding to the entry of the function.
void setOperationAction(unsigned Op, MVT VT, LegalizeAction Action)
Indicate that the specified operation does not work with the specified type and indicate what to do a...
This class is used to represent EVT's, which are used to parameterize some operations.
MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, MachineMemOperand::Flags f, uint64_t s, unsigned base_alignment, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr, SyncScope::ID SSID=SyncScope::System, AtomicOrdering Ordering=AtomicOrdering::NotAtomic, AtomicOrdering FailureOrdering=AtomicOrdering::NotAtomic)
getMachineMemOperand - Allocate a new MachineMemOperand.
SDValue getMergeValues(ArrayRef< SDValue > Ops, const SDLoc &dl)
Create a MERGE_VALUES node from the given operands.
void assign(size_type NumElts, const T &Elt)
int64_t getSExtValue() const
SDValue getSExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT)
Convert Op, which must be of integer type, to the integer type VT, by either sign-extending or trunca...
MachineFunction & getMachineFunction() const
Select with a vector condition (op #0) and two vector operands (ops #1 and #2), returning a vector re...
Simple integer binary arithmetic operators.
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...
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
SDValue getUNDEF(EVT VT)
Return an UNDEF node. UNDEF does not have a useful SDLoc.
SDValue getTargetConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isOpaque=false)
ANY_EXTEND_VECTOR_INREG(Vector) - This operator represents an in-register any-extension of the low la...
ArrayRef< SDUse > ops() const
RESULT = INTRINSIC_WO_CHAIN(INTRINSICID, arg1, arg2, ...) This node represents a target intrinsic fun...
MVT getVectorElementType() const
BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a vector with the specified, possibly variable...
SDValue getVectorShuffle(EVT VT, const SDLoc &dl, SDValue N1, SDValue N2, ArrayRef< int > Mask)
Return an ISD::VECTOR_SHUFFLE node.
OUTCHAIN = INTRINSIC_VOID(INCHAIN, INTRINSICID, arg1, arg2, ...) This node represents a target intrin...
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
constexpr bool isPowerOf2_32(uint32_t Value)
Return true if the argument is a power of two > 0.
void addRegisterClass(MVT VT, const TargetRegisterClass *RC)
Add the specified register class as an available regclass for the specified value type...
void setTargetDAGCombine(ISD::NodeType NT)
Targets should invoke this method for each target independent node that they want to provide a custom...
bool isMachineOpcode() const
size_t size() const
size - Get the array size.
This is an important base class in LLVM.
iterator_range< value_op_iterator > op_values() const
static const MVT LegalW64[]
INSERT_VECTOR_ELT(VECTOR, VAL, IDX) - Returns VECTOR with the element at IDX replaced with VAL...
static const MVT LegalV128[]
bool useHVX64BOps() const
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly...
void AddPromotedToType(unsigned Opc, MVT OrigVT, MVT DestVT)
If Opc/OrigVT is specified as being promoted, the promotion code defaults to trying a larger integer/...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This struct is a compact representation of a valid (non-zero power of two) alignment.
SDValue getLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr)
Loads are not normal binary operators: their result type is not determined by their operands...
bool isUnindexed() const
Return true if this is NOT a pre/post inc/dec load/store.
SDValue getBitcast(EVT VT, SDValue V)
Return a bitcast using the SDLoc of the value operand, and casting to the provided type...
TokenFactor - This node takes multiple tokens as input and produces a single token result...
bool isHVXVectorType(MVT VecTy, bool IncludeBool=false) const
SDValue getMemBasePlusOffset(SDValue Base, int64_t Offset, const SDLoc &DL, const SDNodeFlags Flags=SDNodeFlags())
Returns sum of the base pointer and offset.
EXTRACT_VECTOR_ELT(VECTOR, IDX) - Returns a single element from VECTOR identified by the (potentially...
std::pair< SDValue, SDValue > SplitVector(const SDValue &N, const SDLoc &DL, const EVT &LoVT, const EVT &HiVT)
Split the vector with EXTRACT_SUBVECTOR using the provides VTs and return the low/high part...
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
SDValue getZExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT)
Convert Op, which must be of integer type, to the integer type VT, by either zero-extending or trunca...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
SDValue getBuildVector(EVT VT, const SDLoc &DL, ArrayRef< SDValue > Ops)
Return an ISD::BUILD_VECTOR node.
Byte Swap and Counting operators.
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
void ExtractVectorElements(SDValue Op, SmallVectorImpl< SDValue > &Args, unsigned Start=0, unsigned Count=0)
Append the extracted elements from Start to Count out of the vector Op in Args.
Represents one node in the SelectionDAG.
unsigned Log2_32(uint32_t Value)
Return the floor log base 2 of the specified value, -1 if the value is zero.
void setIndexedLoadAction(unsigned IdxMode, MVT VT, LegalizeAction Action)
Indicate that the specified indexed load does or does not work with the specified type and indicate w...
EVT getMemoryVT() const
Return the type of the in-memory value.
bool isTypeLegal(EVT VT) const
Return true if the target has native support for the specified value type.
Select(COND, TRUEVAL, FALSEVAL).
ZERO_EXTEND - Used for integer types, zeroing the new bits.
ANY_EXTEND - Used for integer types. The high bits are undefined.
ArrayRef< T > slice(size_t N, size_t M) const
slice(n, m) - Chop off the first N elements of the array, and keep M elements in the array...
ArrayRef< T > take_back(size_t N=1) const
Return a copy of *this with only the last N elements.
unsigned getVectorLength() const
Bitwise operators - logical and, logical or, logical xor.
SIGN_EXTEND_INREG - This operator atomically performs a SHL/SRA pair to sign extend a small value in ...
ArrayRef< T > drop_front(size_t N=1) const
Drop the first N elements of the array.
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
unsigned getOpcode() const
SDValue getValue(unsigned R) const
static MachinePointerInfo getConstantPool(MachineFunction &MF)
Return a MachinePointerInfo record that refers to the constant pool.
SDValue getConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isTarget=false, bool isOpaque=false)
Create a ConstantSDNode wrapping a constant value.
CONCAT_VECTORS(VECTOR0, VECTOR1, ...) - Given a number of values of vector type with the same length ...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
SDValue getValueType(EVT)
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
SetCC operator - This evaluates to a true value iff the condition is true.
unsigned getNumOperands() const
const SDValue & getOperand(unsigned i) const
SDValue getTargetInsertSubreg(int SRIdx, const SDLoc &DL, EVT VT, SDValue Operand, SDValue Subreg)
A convenience function for creating TargetInstrInfo::INSERT_SUBREG nodes.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
EVT getTypeToTransformTo(LLVMContext &Context, EVT VT) const
For types supported by the target, this is an identity function.
const SDValue & getBasePtr() const
LLVMContext * getContext() const
static Constant * get(ArrayRef< Constant *> V)
void setIndexedStoreAction(unsigned IdxMode, MVT VT, LegalizeAction Action)
Indicate that the specified indexed store does or does not work with the specified type and indicate ...
MULHU/MULHS - Multiply high - Multiply two integers of type iN, producing an unsigned/signed value of...