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;
405 SDValue HalfV0 = getInstr(Hexagon::V6_vd0, dl, VecTy, {}, DAG);
406 SDValue HalfV1 = getInstr(Hexagon::V6_vd0, dl, VecTy, {}, DAG);
408 for (
unsigned i = 0; i != NumWords/2; ++i) {
412 {HalfV1, Words[i+NumWords/2]});
424 HexagonTargetLowering::createHvxPrefixPred(
SDValue PredV,
const SDLoc &dl,
425 unsigned BitBytes,
bool ZeroFill,
SelectionDAG &DAG)
const {
426 MVT PredTy = ty(PredV);
445 for (
unsigned i = 0; i != HwLen; ++i) {
446 unsigned Num = i % Scale;
447 unsigned Off = i / Scale;
448 Mask[BlockLen*Num + Off] = i;
455 SDValue Q = getInstr(Hexagon::V6_pred_scalar2, dl, BoolTy,
468 auto Lo32 = [&DAG, &dl] (
SDValue P) {
471 auto Hi32 = [&DAG, &dl] (
SDValue P) {
481 while (Bytes < BitBytes) {
486 for (
const SDValue &
W : Words[IdxW ^ 1]) {
492 for (
const SDValue &
W : Words[IdxW ^ 1]) {
500 assert(Bytes == BitBytes);
502 SDValue Vec = ZeroFill ? getZero(dl, ByteTy, DAG) : DAG.
getUNDEF(ByteTy);
504 for (
const SDValue &
W : Words[IdxW]) {
518 unsigned VecLen = Values.
size();
520 assert(VecLen <= HwLen || VecLen == 8*HwLen);
522 bool AllT =
true, AllF =
true;
525 if (
const auto *
N = dyn_cast<ConstantSDNode>(V.getNode()))
526 return !
N->isNullValue();
529 auto IsFalse = [] (
SDValue V) {
530 if (
const auto *
N = dyn_cast<ConstantSDNode>(V.getNode()))
531 return N->isNullValue();
535 if (VecLen <= HwLen) {
539 assert(HwLen % VecLen == 0);
540 unsigned BitBytes = HwLen / VecLen;
547 for (
unsigned B = 0;
B != BitBytes; ++
B)
554 for (
unsigned I = 0;
I != VecLen;
I += 8) {
557 for (; B != 8; ++
B) {
558 if (!Values[
I+B].isUndef())
571 assert(Values[
I+B].isUndef() || Values[
I+B] == F);
581 SDValue ByteVec = buildHvxVectorReg(Bytes, dl, ByteTy, DAG);
586 HexagonTargetLowering::extractHvxElementReg(
SDValue VecV,
SDValue IdxV,
591 assert(ElemWidth >= 8 && ElemWidth <= 32);
594 SDValue ByteIdx = convertToByteIndex(IdxV, ElemTy, DAG);
603 SDValue SubIdx = getIndexInWord32(IdxV, ElemTy, DAG);
606 return extractVector(ExVec, SubIdx, dl, ElemTy,
MVT::i32, DAG);
610 HexagonTargetLowering::extractHvxElementPred(
SDValue VecV,
SDValue IdxV,
625 return getInstr(Hexagon::C2_cmpgtui, dl,
MVT::i1, {ExtB, Zero}, DAG);
629 HexagonTargetLowering::insertHvxElementReg(
SDValue VecV,
SDValue IdxV,
634 assert(ElemWidth >= 8 && ElemWidth <= 32);
639 MVT VecTy = ty(VecV);
651 SDValue ByteIdx = convertToByteIndex(IdxV, ElemTy, DAG);
653 return InsertWord(VecV, ValV, ByteIdx);
664 SDValue SubIdx = getIndexInWord32(IdxV, ElemTy, DAG);
665 MVT SubVecTy = tyVector(ty(Ext), ElemTy);
667 ValV, SubIdx, dl, ElemTy, DAG);
670 return InsertWord(VecV, Ins, ByteIdx);
674 HexagonTargetLowering::insertHvxElementPred(
SDValue VecV,
SDValue IdxV,
685 SDValue InsV = insertHvxElementReg(ByteVec, IdxV, ValV, dl, DAG);
690 HexagonTargetLowering::extractHvxSubvectorReg(
SDValue VecV,
SDValue IdxV,
692 MVT VecTy = ty(VecV);
694 unsigned Idx = cast<ConstantSDNode>(IdxV.
getNode())->getZExtValue();
701 if (isHvxPairTy(VecTy)) {
703 if (Idx * ElemWidth >= 8*HwLen) {
704 SubIdx = Hexagon::vsub_hi;
707 SubIdx = Hexagon::vsub_lo;
709 VecTy = typeSplit(VecTy).first;
721 unsigned WordIdx = (Idx*ElemWidth) / 32;
735 HexagonTargetLowering::extractHvxSubvectorPred(
SDValue VecV,
SDValue IdxV,
737 MVT VecTy = ty(VecV);
742 unsigned Idx = cast<ConstantSDNode>(IdxV.
getNode())->getZExtValue();
746 unsigned Offset = Idx * BitBytes;
757 for (
unsigned i = 0; i != HwLen/Rep; ++i) {
758 for (
unsigned j = 0; j != Rep; ++j)
775 unsigned Rep = 8 / ResLen;
778 for (
unsigned r = 0; r != HwLen/ResLen; ++r) {
780 for (
unsigned i = 0; i != ResLen; ++i) {
781 for (
unsigned j = 0; j != Rep; ++j)
794 return getInstr(Hexagon::A4_vcmpbgtui, dl, ResTy,
799 HexagonTargetLowering::insertHvxSubvectorReg(
SDValue VecV,
SDValue SubV,
801 MVT VecTy = ty(VecV);
802 MVT SubTy = ty(SubV);
807 bool IsPair = isHvxPairTy(VecTy);
821 if (isHvxSingleTy(SubTy)) {
822 if (
const auto *CN = dyn_cast<const ConstantSDNode>(IdxV.
getNode())) {
823 unsigned Idx = CN->getZExtValue();
825 unsigned SubIdx = (Idx == 0) ? Hexagon::vsub_lo : Hexagon::vsub_hi;
848 if (!IdxN || !IdxN->isNullValue()) {
856 unsigned RolBase = HwLen;
871 if (RolBase != 4 || !IdxN || !IdxN->isNullValue()) {
886 HexagonTargetLowering::insertHvxSubvectorPred(
SDValue VecV,
SDValue SubV,
888 MVT VecTy = ty(VecV);
889 MVT SubTy = ty(SubV);
896 assert(HwLen % VecLen == 0 &&
"Unexpected vector type");
899 unsigned BitBytes = HwLen / VecLen;
900 unsigned BlockLen = HwLen / Scale;
904 SDValue ByteSub = createHvxPrefixPred(SubV, dl, BitBytes,
false, DAG);
908 if (!IdxN || !IdxN->isNullValue()) {
918 SDValue Q = getInstr(Hexagon::V6_pred_scalar2, dl, BoolTy,
920 ByteVec = getInstr(Hexagon::V6_vmux, dl, ByteTy, {Q, ByteSub, ByteVec}, DAG);
922 if (!IdxN || !IdxN->isNullValue()) {
931 HexagonTargetLowering::extendHvxVectorPred(
SDValue VecV,
const SDLoc &dl,
943 SDValue False = getZero(dl, ResTy, DAG);
944 return DAG.
getSelect(dl, ResTy, VecV, True, False);
955 for (
unsigned i = 0; i !=
Size; ++i)
959 return buildHvxVectorPred(Ops, dl, VecTy, DAG);
963 MVT SingleTy = typeSplit(VecTy).first;
969 return buildHvxVectorReg(Ops, dl, VecTy, DAG);
993 for (
unsigned i = 0, e = Elems.
size(); i != e; ++i) {
1033 MVT HalfTy = typeSplit(VecTy).first;
1047 SDValue P = createHvxPrefixPred(V, dl, BitBytes,
true, DAG);
1051 unsigned InpLen = ty(Op.
getOperand(0)).getVectorNumElements();
1054 SDValue Res = getZero(dl, ByteTy, DAG);
1055 for (
unsigned i = 0, e = Prefixes.
size(); i != e; ++i) {
1068 const SDLoc &dl(Op);
1071 return extractHvxElementPred(VecV, IdxV, dl, ty(Op), DAG);
1073 return extractHvxElementReg(VecV, IdxV, dl, ty(Op), DAG);
1079 const SDLoc &dl(Op);
1085 return insertHvxElementPred(VecV, IdxV, ValV, dl, DAG);
1087 return insertHvxElementReg(VecV, IdxV, ValV, dl, DAG);
1094 MVT SrcTy = ty(SrcV);
1097 unsigned Idx = cast<ConstantSDNode>(IdxV.
getNode())->getZExtValue();
1100 const SDLoc &dl(Op);
1104 return extractHvxSubvectorPred(SrcV, IdxV, dl, DstTy, DAG);
1106 return extractHvxSubvectorReg(SrcV, IdxV, dl, DstTy, DAG);
1117 const SDLoc &dl(Op);
1118 MVT VecTy = ty(VecV);
1121 return insertHvxSubvectorPred(VecV, ValV, IdxV, dl, DAG);
1123 return insertHvxSubvectorReg(VecV, ValV, IdxV, dl, DAG);
1136 return LowerHvxSignExt(Op, DAG);
1146 return extendHvxVectorPred(InpV,
SDLoc(Op), ty(Op),
false, DAG);
1156 return extendHvxVectorPred(InpV,
SDLoc(Op), ty(Op),
true, DAG);
1164 const SDLoc &dl(Op);
1167 assert(ResTy == ty(InpV));
1173 uint64_t Splat1 = 0, SplatW = 0;
1175 for (
unsigned i = 0; i != 32/ElemWidth; ++i) {
1176 Splat1 = (Splat1 << ElemWidth) | 1;
1177 SplatW = (SplatW << ElemWidth) | ElemWidth;
1199 const SDLoc &dl(Op);
1212 MVT ExtTy = typeExtElem(ResTy, 2);
1213 unsigned MpyOpc = ElemTy ==
MVT::i8 ? Hexagon::V6_vmpybv
1214 : Hexagon::V6_vmpyhv;
1215 SDValue M = getInstr(MpyOpc, dl, ExtTy, {Vs, Vt}, DAG);
1218 for (
unsigned I = 0;
I < VecLen;
I += 2) {
1222 VectorPair
P = opSplit(opCastElem(M, ElemTy, DAG), dl, DAG);
1223 SDValue BS = getByteShuffle(dl, P.first, P.second, ShuffMask, DAG);
1230 return getInstr(Hexagon::V6_vmpyih, dl, ResTy, {Vs, Vt}, DAG);
1237 SDValue T0 = getInstr(Hexagon::V6_vmpyiowh, dl, ResTy, {Vs, Vt}, DAG);
1238 SDValue T1 = getInstr(Hexagon::V6_vaslw, dl, ResTy, {T0, S16}, DAG);
1239 SDValue T2 = getInstr(Hexagon::V6_vmpyiewuh_acc, dl, ResTy,
1253 const SDLoc &dl(Op);
1269 MVT ExtTy = typeExtElem(ResTy, 2);
1270 unsigned MpyOpc = ElemTy ==
MVT::i8 1271 ? (IsSigned ? Hexagon::V6_vmpybv : Hexagon::V6_vmpyubv)
1272 : (IsSigned ? Hexagon::V6_vmpyhv : Hexagon::V6_vmpyuhv);
1273 SDValue M = getInstr(MpyOpc, dl, ExtTy, {Vs, Vt}, DAG);
1276 for (
unsigned I = 0;
I < VecLen;
I += 2) {
1280 VectorPair
P = opSplit(opCastElem(M, ElemTy, DAG), dl, DAG);
1281 SDValue BS = getByteShuffle(dl, P.first, P.second, ShuffMask, DAG);
1303 SDValue T0 = getInstr(Hexagon::V6_vmpyewuh, dl, ResTy, {Vt, Vs}, DAG);
1305 SDValue S0 = getInstr(Hexagon::V6_vasrw, dl, ResTy, {Vs, S16}, DAG);
1306 SDValue T1 = getInstr(Hexagon::V6_vmpyiewuh_acc, dl, ResTy,
1309 SDValue S2 = getInstr(Hexagon::V6_vasrw, dl, ResTy, {
T1, S16}, DAG);
1311 SDValue T2 = getInstr(Hexagon::V6_vmpyiowh, dl, ResTy, {S0, Vt}, DAG);
1319 auto LoVec = [&DAG,ResTy,dl] (
SDValue Pair) {
1322 auto HiVec = [&DAG,ResTy,dl] (
SDValue Pair) {
1327 SDValue P = getInstr(Hexagon::V6_lvsplatw, dl, ResTy,
1332 SDValue T0 = getInstr(Hexagon::V6_vmpyuhv, dl, PairTy, {Vs, Vt}, DAG);
1336 SDValue T1 = getInstr(Hexagon::V6_vlsrw, dl, ResTy, {LoVec(T0), S16}, DAG);
1339 SDValue D0 = getInstr(Hexagon::V6_vdelta, dl, ResTy, {Vt, P}, DAG);
1340 SDValue T2 = getInstr(Hexagon::V6_vmpyuhv, dl, PairTy, {Vs, D0}, DAG);
1345 SDValue T3 = getInstr(Hexagon::V6_vadduhw, dl, PairTy,
1346 {LoVec(T2), HiVec(T2)}, DAG);
1349 SDValue T5 = getInstr(Hexagon::V6_vlsrw, dl, ResTy, {T4, S16}, DAG);
1364 if (
SDValue S = getVectorShiftByInt(Op, DAG))
1373 const SDLoc &dl(Op);
1375 auto SplitVTNode = [&DAG,
this] (
const VTSDNode *
N) {
1376 MVT Ty = typeSplit(
N->getVT().getSimpleVT()).
first;
1378 return std::make_pair(TV, TV);
1383 ? opSplit(A, dl, DAG)
1384 : std::make_pair(A, A);
1387 if (
const auto *
N = dyn_cast<const VTSDNode>(A.getNode()))
1390 OpsL.push_back(P.first);
1391 OpsH.push_back(P.second);
1395 MVT HalfTy = typeSplit(ResTy).first;
1407 if (!isHvxPairTy(MemTy))
1410 const SDLoc &dl(Op);
1412 MVT SingleTy = typeSplit(MemTy).first;
1436 VectorPair Vals = opSplit(cast<StoreSDNode>(Op)->getValue(), dl, DAG);
1448 bool IsPairOp = isHvxPairTy(ty(Op)) ||
1450 return isHvxPairTy(ty(V));
1459 return SplitHvxMemOp(Op, DAG);
1475 return SplitHvxPairOp(Op, DAG);
1492 case ISD::CTTZ:
return LowerHvxCttz(Op, DAG);
1495 case ISD::SRL:
return LowerHvxShift(Op, DAG);
1496 case ISD::MUL:
return LowerHvxMul(Op, DAG);
1498 case ISD::MULHU:
return LowerHvxMulh(Op, DAG);
1512 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)
void push_back(const T &Elt)
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 ...
Compute iterated dominance frontiers using a linear time algorithm.
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.
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
static const MVT LegalW128[]
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)
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 getZeroExtendVectorInReg(SDValue Op, const SDLoc &DL, EVT VT)
Return an operation which will zero extend the low lanes of the operand into the specified vector typ...
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())
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
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...