24 HexagonTargetLowering::initializeHVXLowering() {
65 auto setPromoteTo = [
this] (
unsigned Opc,
MVT FromTy,
MVT ToTy) {
73 for (
MVT T : LegalV) {
125 for (
MVT T : LegalW) {
171 for (
MVT T : LegalW) {
185 for (
MVT T : LegalV) {
210 HexagonTargetLowering::typeJoin(
const TypePair &Tys)
const {
211 assert(Tys.first.getVectorElementType() == Tys.second.getVectorElementType());
215 Tys.second.getVectorNumElements());
218 HexagonTargetLowering::TypePair
219 HexagonTargetLowering::typeSplit(
MVT VecTy)
const {
222 assert((NumElem % 2) == 0 &&
"Expecting even-sized vector type");
224 return { HalfTy, HalfTy };
228 HexagonTargetLowering::typeExtElem(
MVT VecTy,
unsigned Factor)
const {
235 HexagonTargetLowering::typeTruncElem(
MVT VecTy,
unsigned Factor)
const {
242 HexagonTargetLowering::opCastElem(
SDValue Vec,
MVT ElemTy,
244 if (ty(Vec).getVectorElementType() == ElemTy)
251 HexagonTargetLowering::opJoin(
const VectorPair &Ops,
const SDLoc &dl,
254 Ops.second, Ops.first);
257 HexagonTargetLowering::VectorPair
258 HexagonTargetLowering::opSplit(
SDValue Vec,
const SDLoc &dl,
260 TypePair Tys = typeSplit(ty(Vec));
263 return DAG.
SplitVector(Vec, dl, Tys.first, Tys.second);
267 HexagonTargetLowering::isHvxSingleTy(
MVT Ty)
const {
273 HexagonTargetLowering::isHvxPairTy(
MVT Ty)
const {
279 HexagonTargetLowering::convertToByteIndex(
SDValue ElemIdx,
MVT ElemTy,
288 unsigned L =
Log2_32(ElemWidth/8);
289 const SDLoc &dl(ElemIdx);
295 HexagonTargetLowering::getIndexInWord32(
SDValue Idx,
MVT ElemTy,
298 assert(ElemWidth >= 8 && ElemWidth <= 32);
304 const SDLoc &dl(Idx);
311 HexagonTargetLowering::getByteShuffle(
const SDLoc &dl,
SDValue Op0,
328 for (
unsigned I = 0;
I != ElemSize; ++
I)
331 int NewM = M*ElemSize;
332 for (
unsigned I = 0;
I != ElemSize; ++
I)
336 assert(ResTy.getVectorNumElements() == ByteMask.
size());
338 opCastElem(Op1,
MVT::i8, DAG), ByteMask);
345 unsigned VecLen = Values.
size();
351 unsigned ElemSize = ElemWidth / 8;
352 assert(ElemSize*VecLen == HwLen);
356 assert((ElemSize == 1 || ElemSize == 2) &&
"Invalid element size");
357 unsigned OpsPerWord = (ElemSize == 1) ? 4 : 2;
359 for (
unsigned i = 0; i != VecLen; i += OpsPerWord) {
360 SDValue W = buildVector32(Values.
slice(i, OpsPerWord), dl, PartVT, DAG);
367 unsigned NumWords = Words.
size();
368 bool IsSplat =
true, IsUndef =
true;
370 for (
unsigned i = 0; i != NumWords && IsSplat; ++i) {
371 if (isUndef(Words[i]))
376 else if (SplatV != Words[i])
384 if (IdxN && IdxN->isNullValue())
385 return getZero(dl, VecTy, DAG);
392 bool AllConst = getBuildVectorConstInts(Values, VecTy, DAG, Consts);
397 unsigned Align = HwLen;
410 auto IsBuildFromExtracts = [
this,&Values] (
SDValue &SrcVec,
415 SrcIdx.push_back(-1);
429 assert(I >= 0 &&
"Negative element index");
438 if (IsBuildFromExtracts(ExtVec, ExtIdx)) {
439 MVT ExtTy = ty(ExtVec);
441 if (ExtLen == VecLen || ExtLen == 2*VecLen) {
448 for (
int M : ExtIdx) {
458 for (
unsigned I = 0;
I != ExtLen; ++
I) {
459 if (Mask.
size() == ExtLen)
467 if (ExtLen == VecLen)
475 SDValue HalfV0 = getInstr(Hexagon::V6_vd0, dl, VecTy, {}, DAG);
476 SDValue HalfV1 = getInstr(Hexagon::V6_vd0, dl, VecTy, {}, DAG);
478 for (
unsigned i = 0; i != NumWords/2; ++i) {
482 {HalfV1, Words[i+NumWords/2]});
494 HexagonTargetLowering::createHvxPrefixPred(
SDValue PredV,
const SDLoc &dl,
495 unsigned BitBytes,
bool ZeroFill,
SelectionDAG &DAG)
const {
496 MVT PredTy = ty(PredV);
515 for (
unsigned i = 0; i != HwLen; ++i) {
516 unsigned Num = i % Scale;
517 unsigned Off = i / Scale;
518 Mask[BlockLen*Num + Off] = i;
525 SDValue Q = getInstr(Hexagon::V6_pred_scalar2, dl, BoolTy,
538 auto Lo32 = [&DAG, &dl] (
SDValue P) {
541 auto Hi32 = [&DAG, &dl] (
SDValue P) {
551 while (Bytes < BitBytes) {
556 for (
const SDValue &
W : Words[IdxW ^ 1]) {
562 for (
const SDValue &
W : Words[IdxW ^ 1]) {
570 assert(Bytes == BitBytes);
572 SDValue Vec = ZeroFill ? getZero(dl, ByteTy, DAG) : DAG.
getUNDEF(ByteTy);
574 for (
const SDValue &
W : Words[IdxW]) {
588 unsigned VecLen = Values.
size();
590 assert(VecLen <= HwLen || VecLen == 8*HwLen);
592 bool AllT =
true, AllF =
true;
595 if (
const auto *
N = dyn_cast<ConstantSDNode>(V.getNode()))
596 return !
N->isNullValue();
599 auto IsFalse = [] (
SDValue V) {
600 if (
const auto *
N = dyn_cast<ConstantSDNode>(V.getNode()))
601 return N->isNullValue();
605 if (VecLen <= HwLen) {
609 assert(HwLen % VecLen == 0);
610 unsigned BitBytes = HwLen / VecLen;
617 for (
unsigned B = 0;
B != BitBytes; ++
B)
624 for (
unsigned I = 0;
I != VecLen;
I += 8) {
627 for (; B != 8; ++
B) {
628 if (!Values[
I+B].isUndef())
641 assert(Values[
I+B].isUndef() || Values[
I+B] == F);
651 SDValue ByteVec = buildHvxVectorReg(Bytes, dl, ByteTy, DAG);
656 HexagonTargetLowering::extractHvxElementReg(
SDValue VecV,
SDValue IdxV,
661 assert(ElemWidth >= 8 && ElemWidth <= 32);
664 SDValue ByteIdx = convertToByteIndex(IdxV, ElemTy, DAG);
673 SDValue SubIdx = getIndexInWord32(IdxV, ElemTy, DAG);
676 return extractVector(ExVec, SubIdx, dl, ElemTy,
MVT::i32, DAG);
680 HexagonTargetLowering::extractHvxElementPred(
SDValue VecV,
SDValue IdxV,
695 return getInstr(Hexagon::C2_cmpgtui, dl,
MVT::i1, {ExtB, Zero}, DAG);
699 HexagonTargetLowering::insertHvxElementReg(
SDValue VecV,
SDValue IdxV,
704 assert(ElemWidth >= 8 && ElemWidth <= 32);
709 MVT VecTy = ty(VecV);
721 SDValue ByteIdx = convertToByteIndex(IdxV, ElemTy, DAG);
723 return InsertWord(VecV, ValV, ByteIdx);
734 SDValue SubIdx = getIndexInWord32(IdxV, ElemTy, DAG);
735 MVT SubVecTy = tyVector(ty(Ext), ElemTy);
737 ValV, SubIdx, dl, ElemTy, DAG);
740 return InsertWord(VecV, Ins, ByteIdx);
744 HexagonTargetLowering::insertHvxElementPred(
SDValue VecV,
SDValue IdxV,
755 SDValue InsV = insertHvxElementReg(ByteVec, IdxV, ValV, dl, DAG);
760 HexagonTargetLowering::extractHvxSubvectorReg(
SDValue VecV,
SDValue IdxV,
762 MVT VecTy = ty(VecV);
764 unsigned Idx = cast<ConstantSDNode>(IdxV.
getNode())->getZExtValue();
771 if (isHvxPairTy(VecTy)) {
773 if (Idx * ElemWidth >= 8*HwLen) {
774 SubIdx = Hexagon::vsub_hi;
777 SubIdx = Hexagon::vsub_lo;
779 VecTy = typeSplit(VecTy).first;
791 unsigned WordIdx = (Idx*ElemWidth) / 32;
805 HexagonTargetLowering::extractHvxSubvectorPred(
SDValue VecV,
SDValue IdxV,
807 MVT VecTy = ty(VecV);
812 unsigned Idx = cast<ConstantSDNode>(IdxV.
getNode())->getZExtValue();
816 unsigned Offset = Idx * BitBytes;
827 for (
unsigned i = 0; i != HwLen/Rep; ++i) {
828 for (
unsigned j = 0; j != Rep; ++j)
845 unsigned Rep = 8 / ResLen;
848 for (
unsigned r = 0; r != HwLen/ResLen; ++r) {
850 for (
unsigned i = 0; i != ResLen; ++i) {
851 for (
unsigned j = 0; j != Rep; ++j)
864 return getInstr(Hexagon::A4_vcmpbgtui, dl, ResTy,
869 HexagonTargetLowering::insertHvxSubvectorReg(
SDValue VecV,
SDValue SubV,
871 MVT VecTy = ty(VecV);
872 MVT SubTy = ty(SubV);
877 bool IsPair = isHvxPairTy(VecTy);
891 if (isHvxSingleTy(SubTy)) {
892 if (
const auto *CN = dyn_cast<const ConstantSDNode>(IdxV.
getNode())) {
893 unsigned Idx = CN->getZExtValue();
895 unsigned SubIdx = (Idx == 0) ? Hexagon::vsub_lo : Hexagon::vsub_hi;
918 if (!IdxN || !IdxN->isNullValue()) {
926 unsigned RolBase = HwLen;
941 if (RolBase != 4 || !IdxN || !IdxN->isNullValue()) {
956 HexagonTargetLowering::insertHvxSubvectorPred(
SDValue VecV,
SDValue SubV,
958 MVT VecTy = ty(VecV);
959 MVT SubTy = ty(SubV);
966 assert(HwLen % VecLen == 0 &&
"Unexpected vector type");
969 unsigned BitBytes = HwLen / VecLen;
970 unsigned BlockLen = HwLen / Scale;
974 SDValue ByteSub = createHvxPrefixPred(SubV, dl, BitBytes,
false, DAG);
978 if (!IdxN || !IdxN->isNullValue()) {
988 SDValue Q = getInstr(Hexagon::V6_pred_scalar2, dl, BoolTy,
990 ByteVec = getInstr(Hexagon::V6_vmux, dl, ByteTy, {Q, ByteSub, ByteVec}, DAG);
992 if (!IdxN || !IdxN->isNullValue()) {
1001 HexagonTargetLowering::extendHvxVectorPred(
SDValue VecV,
const SDLoc &dl,
1013 SDValue False = getZero(dl, ResTy, DAG);
1014 return DAG.
getSelect(dl, ResTy, VecV, True, False);
1020 const SDLoc &dl(Op);
1025 for (
unsigned i = 0; i !=
Size; ++i)
1029 return buildHvxVectorPred(Ops, dl, VecTy, DAG);
1033 MVT SingleTy = typeSplit(VecTy).first;
1039 return buildHvxVectorReg(Ops, dl, VecTy, DAG);
1049 const SDLoc &dl(Op);
1063 for (
unsigned i = 0, e = Elems.
size(); i != e; ++i) {
1103 MVT HalfTy = typeSplit(VecTy).first;
1117 SDValue P = createHvxPrefixPred(V, dl, BitBytes,
true, DAG);
1121 unsigned InpLen = ty(Op.
getOperand(0)).getVectorNumElements();
1124 SDValue Res = getZero(dl, ByteTy, DAG);
1125 for (
unsigned i = 0, e = Prefixes.
size(); i != e; ++i) {
1138 const SDLoc &dl(Op);
1141 return extractHvxElementPred(VecV, IdxV, dl, ty(Op), DAG);
1143 return extractHvxElementReg(VecV, IdxV, dl, ty(Op), DAG);
1149 const SDLoc &dl(Op);
1155 return insertHvxElementPred(VecV, IdxV, ValV, dl, DAG);
1157 return insertHvxElementReg(VecV, IdxV, ValV, dl, DAG);
1164 MVT SrcTy = ty(SrcV);
1167 unsigned Idx = cast<ConstantSDNode>(IdxV.
getNode())->getZExtValue();
1170 const SDLoc &dl(Op);
1174 return extractHvxSubvectorPred(SrcV, IdxV, dl, DstTy, DAG);
1176 return extractHvxSubvectorReg(SrcV, IdxV, dl, DstTy, DAG);
1187 const SDLoc &dl(Op);
1188 MVT VecTy = ty(VecV);
1191 return insertHvxSubvectorPred(VecV, ValV, IdxV, dl, DAG);
1193 return insertHvxSubvectorReg(VecV, ValV, IdxV, dl, DAG);
1206 return LowerHvxSignExt(Op, DAG);
1216 return extendHvxVectorPred(InpV,
SDLoc(Op), ty(Op),
false, DAG);
1226 return extendHvxVectorPred(InpV,
SDLoc(Op), ty(Op),
true, DAG);
1234 const SDLoc &dl(Op);
1237 assert(ResTy == ty(InpV));
1243 uint64_t Splat1 = 0, SplatW = 0;
1245 for (
unsigned i = 0; i != 32/ElemWidth; ++i) {
1246 Splat1 = (Splat1 << ElemWidth) | 1;
1247 SplatW = (SplatW << ElemWidth) | ElemWidth;
1269 const SDLoc &dl(Op);
1282 MVT ExtTy = typeExtElem(ResTy, 2);
1283 unsigned MpyOpc = ElemTy ==
MVT::i8 ? Hexagon::V6_vmpybv
1284 : Hexagon::V6_vmpyhv;
1285 SDValue M = getInstr(MpyOpc, dl, ExtTy, {Vs, Vt}, DAG);
1288 for (
unsigned I = 0;
I < VecLen;
I += 2) {
1292 VectorPair
P = opSplit(opCastElem(M, ElemTy, DAG), dl, DAG);
1293 SDValue BS = getByteShuffle(dl, P.first, P.second, ShuffMask, DAG);
1300 return getInstr(Hexagon::V6_vmpyih, dl, ResTy, {Vs, Vt}, DAG);
1307 SDValue T0 = getInstr(Hexagon::V6_vmpyiowh, dl, ResTy, {Vs, Vt}, DAG);
1308 SDValue T1 = getInstr(Hexagon::V6_vaslw, dl, ResTy, {T0, S16}, DAG);
1309 SDValue T2 = getInstr(Hexagon::V6_vmpyiewuh_acc, dl, ResTy,
1323 const SDLoc &dl(Op);
1339 MVT ExtTy = typeExtElem(ResTy, 2);
1340 unsigned MpyOpc = ElemTy ==
MVT::i8 1341 ? (IsSigned ? Hexagon::V6_vmpybv : Hexagon::V6_vmpyubv)
1342 : (IsSigned ? Hexagon::V6_vmpyhv : Hexagon::V6_vmpyuhv);
1343 SDValue M = getInstr(MpyOpc, dl, ExtTy, {Vs, Vt}, DAG);
1346 for (
unsigned I = 0;
I < VecLen;
I += 2) {
1350 VectorPair
P = opSplit(opCastElem(M, ElemTy, DAG), dl, DAG);
1351 SDValue BS = getByteShuffle(dl, P.first, P.second, ShuffMask, DAG);
1373 SDValue T0 = getInstr(Hexagon::V6_vmpyewuh, dl, ResTy, {Vt, Vs}, DAG);
1375 SDValue S0 = getInstr(Hexagon::V6_vasrw, dl, ResTy, {Vs, S16}, DAG);
1376 SDValue T1 = getInstr(Hexagon::V6_vmpyiewuh_acc, dl, ResTy,
1379 SDValue S2 = getInstr(Hexagon::V6_vasrw, dl, ResTy, {
T1, S16}, DAG);
1381 SDValue T2 = getInstr(Hexagon::V6_vmpyiowh, dl, ResTy, {S0, Vt}, DAG);
1389 auto LoVec = [&DAG,ResTy,dl] (
SDValue Pair) {
1392 auto HiVec = [&DAG,ResTy,dl] (
SDValue Pair) {
1397 SDValue P = getInstr(Hexagon::V6_lvsplatw, dl, ResTy,
1402 SDValue T0 = getInstr(Hexagon::V6_vmpyuhv, dl, PairTy, {Vs, Vt}, DAG);
1406 SDValue T1 = getInstr(Hexagon::V6_vlsrw, dl, ResTy, {LoVec(T0), S16}, DAG);
1409 SDValue D0 = getInstr(Hexagon::V6_vdelta, dl, ResTy, {Vt, P}, DAG);
1410 SDValue T2 = getInstr(Hexagon::V6_vmpyuhv, dl, PairTy, {Vs, D0}, DAG);
1415 SDValue T3 = getInstr(Hexagon::V6_vadduhw, dl, PairTy,
1416 {LoVec(T2), HiVec(T2)}, DAG);
1419 SDValue T5 = getInstr(Hexagon::V6_vlsrw, dl, ResTy, {T4, S16}, DAG);
1435 if (
SDValue S = getVectorShiftByInt(Op, DAG))
1444 const SDLoc &dl(Op);
1446 auto SplitVTNode = [&DAG,
this] (
const VTSDNode *
N) {
1447 MVT Ty = typeSplit(
N->getVT().getSimpleVT()).
first;
1449 return std::make_pair(TV, TV);
1454 ? opSplit(A, dl, DAG)
1455 : std::make_pair(A, A);
1458 if (
const auto *
N = dyn_cast<const VTSDNode>(A.getNode()))
1461 OpsL.push_back(P.first);
1462 OpsH.push_back(P.second);
1466 MVT HalfTy = typeSplit(ResTy).first;
1478 if (!isHvxPairTy(MemTy))
1481 const SDLoc &dl(Op);
1483 MVT SingleTy = typeSplit(MemTy).first;
1507 VectorPair Vals = opSplit(cast<StoreSDNode>(Op)->getValue(), dl, DAG);
1519 bool IsPairOp = isHvxPairTy(ty(Op)) ||
1521 return isHvxPairTy(ty(V));
1530 return SplitHvxMemOp(Op, DAG);
1546 return SplitHvxPairOp(Op, DAG);
1563 case ISD::CTTZ:
return LowerHvxCttz(Op, DAG);
1566 case ISD::SRL:
return LowerHvxShift(Op, DAG);
1567 case ISD::MUL:
return LowerHvxMul(Op, DAG);
1569 case ISD::MULHU:
return LowerHvxMulh(Op, DAG);
1583 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.
SDValue getSetCC(const SDLoc &DL, EVT VT, SDValue LHS, SDValue RHS, ISD::CondCode Cond)
Helper function to make it easier to build SetCC's if you just have an ISD::CondCode instead of an SD...
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)
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[]
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 ...
SDValue getConstantPool(const Constant *C, EVT VT, unsigned Align=0, int Offs=0, bool isT=false, unsigned char TargetFlags=0)
std::pair< MCSymbol *, MachineModuleInfoImpl::StubValueTy > PairTy
SDValue getMemBasePlusOffset(SDValue Base, unsigned Offset, const SDLoc &DL)
Returns sum of the base pointer and offset.
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.
unsigned getSizeInBits() const
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.
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...
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
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
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.
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
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.
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...
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
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...