91 #define DEBUG_TYPE "aarch64-lower"
93 STATISTIC(NumTailCalls,
"Number of tail calls");
94 STATISTIC(NumShiftInserts,
"Number of vector shift inserts");
95 STATISTIC(NumOptimizedImms,
"Number of times immediates were optimized");
99 cl::desc(
"Allow AArch64 SLI/SRI formation"),
107 cl::desc(
"Allow AArch64 Local Dynamic TLS code generation"),
112 cl::desc(
"Enable AArch64 logical imm instruction "
708 void AArch64TargetLowering::addTypeForNEON(
MVT VT,
MVT PromotedBitwiseVT) {
793 void AArch64TargetLowering::addDRTypeForNEON(
MVT VT) {
798 void AArch64TargetLowering::addQRTypeForNEON(
MVT VT) {
811 const APInt &Demanded,
814 uint64_t OldImm = Imm, NewImm, Enc;
815 uint64_t
Mask = ((uint64_t)(-1LL) >> (64 -
Size)), OrigMask =
Mask;
819 if (Imm == 0 || Imm == Mask ||
823 unsigned EltSize =
Size;
837 uint64_t NonDemandedBits = ~DemandedBits;
838 uint64_t InvertedImm = ~Imm & DemandedBits;
839 uint64_t RotatedImm =
840 ((InvertedImm << 1) | (InvertedImm >> (EltSize - 1) & 1)) &
842 uint64_t Sum = RotatedImm + NonDemandedBits;
843 bool Carry = NonDemandedBits & ~Sum & (1ULL << (EltSize - 1));
844 uint64_t Ones = (Sum + Carry) & NonDemandedBits;
845 NewImm = (Imm | Ones) & Mask;
859 uint64_t
Hi = Imm >> EltSize, DemandedBitsHi = DemandedBits >> EltSize;
862 if (((Imm ^ Hi) & (DemandedBits & DemandedBitsHi) & Mask) != 0)
867 DemandedBits |= DemandedBitsHi;
873 while (EltSize < Size) {
874 NewImm |= NewImm << EltSize;
880 "demanded bits should never be altered");
881 assert(OldImm != NewImm &&
"the new imm shouldn't be equal to the old imm");
890 if (NewImm == 0 || NewImm == OrigMask) {
919 assert((Size == 32 || Size == 64) &&
920 "i32 or i64 is expected after legalization.");
931 NewOpc = Size == 32 ? AArch64::ANDWri : AArch64::ANDXri;
934 NewOpc = Size == 32 ? AArch64::ORRWri : AArch64::ORRXri;
937 NewOpc = Size == 32 ? AArch64::EORWri : AArch64::EORXri;
968 case Intrinsic::aarch64_ldaxr:
969 case Intrinsic::aarch64_ldxr: {
971 EVT VT = cast<MemIntrinsicSDNode>(
Op)->getMemoryVT();
981 unsigned IntNo = cast<ConstantSDNode>(Op.
getOperand(0))->getZExtValue();
985 case Intrinsic::aarch64_neon_umaxv:
986 case Intrinsic::aarch64_neon_uminv: {
994 assert(BitWidth >= 8 &&
"Unexpected width!");
998 assert(BitWidth >= 16 &&
"Unexpected width!");
1245 case AArch64::F128CSEL:
1248 case TargetOpcode::STACKMAP:
1249 case TargetOpcode::PATCHPOINT:
1417 return (C >> 12 == 0) || ((C & 0xFFFULL) == 0 && C >> 24 == 0);
1515 unsigned Opcode = 0;
1538 return DAG.
getNode(Opcode, DL,
MVT_CC, LHS, RHS, NZCVOp, Condition, CCOp);
1548 unsigned Depth = 0) {
1574 if (!CanNegateL && !CanNegateR)
1578 CanNegate = CanNegateL && CanNegateR;
1585 if (NeedsNegOutL && NeedsNegOutR)
1635 Predicate = ExtraCC;
1647 "Valid conjunction/disjunction tree");
1655 bool NegateOpsAndResult = Opcode ==
ISD::OR;
1659 if (NegateOpsAndResult) {
1663 assert(isValidL &&
"Valid conjunction/disjunction tree");
1669 assert(isValidR &&
"Valid conjunction/disjunction tree");
1670 assert((CanNegateL || CanNegateR) &&
"Valid conjunction/disjunction tree");
1677 bool NeedsNegOutL = LHS->getOpcode() ==
ISD::OR;
1679 "Valid conjunction/disjunction tree");
1692 if (NegateOpsAndResult && !Negate)
1696 NegateOpsAndResult, CmpR,
1700 if (NegateOpsAndResult && !Negate)
1725 uint64_t
C = RHSC->getZExtValue();
1733 if ((VT ==
MVT::i32 && C != 0x80000000 &&
1735 (VT ==
MVT::i64 && C != 0x80000000ULL &&
1754 if ((VT ==
MVT::i32 && C != INT32_MAX &&
1756 (VT ==
MVT::i64 && C != INT64_MAX &&
1765 if ((VT ==
MVT::i32 && C != UINT32_MAX &&
1767 (VT ==
MVT::i64 && C != UINT64_MAX &&
1798 if ((RHSC->
getZExtValue() >> 16 == 0) && isa<LoadSDNode>(LHS) &&
1799 cast<LoadSDNode>(LHS)->getExtensionType() ==
ISD::ZEXTLOAD &&
1800 cast<LoadSDNode>(LHS)->getMemoryVT() ==
MVT::i16 &&
1802 int16_t ValueofRHS = cast<ConstantSDNode>(RHS)->getZExtValue();
1830 static std::pair<SDValue, SDValue>
1833 "Unsupported value type");
1907 UpperBits).getValue(1);
1929 UpperBits).getValue(1);
1939 Value = DAG.
getNode(Opc, DL, VTs, LHS, RHS);
1942 return std::make_pair(Value, Overflow);
1983 if (!CFVal || !CTVal)
1988 if (CTVal->isAllOnesValue() && CFVal->
isNullValue()) {
2020 bool ExtraOp =
false;
2079 unsigned IsWrite = cast<ConstantSDNode>(Op.
getOperand(2))->getZExtValue();
2080 unsigned Locality = cast<ConstantSDNode>(Op.
getOperand(3))->getZExtValue();
2081 unsigned IsData = cast<ConstantSDNode>(Op.
getOperand(4))->getZExtValue();
2083 bool IsStream = !Locality;
2087 assert(Locality <= 3 &&
"Prefetch locality out-of-range");
2091 Locality = 3 - Locality;
2095 unsigned PrfOp = (IsWrite << 4) |
2110 return LowerF128Call(Op, DAG, LC);
2218 In = DAG.
getNode(CastOpc, dl, CastVT, In);
2254 return LowerF128Call(Op, DAG, LC);
2271 Entry.IsSExt =
false;
2272 Entry.IsZExt =
false;
2273 Args.push_back(Entry);
2275 const char *LibcallName =
2276 (ArgVT ==
MVT::f64) ?
"__sincos_stret" :
"__sincosf_stret";
2286 std::pair<SDValue, SDValue> CallResult =
LowerCallTo(CLI);
2287 return CallResult.first;
2312 switch (OrigSimpleTy) {
2325 unsigned ExtOpcode) {
2349 unsigned HalfSize = EltSize / 2;
2351 if (!
isIntN(HalfSize,
C->getSExtValue()))
2354 if (!
isUIntN(HalfSize,
C->getZExtValue()))
2375 unsigned EltSize = VT.getScalarSizeInBits() / 2;
2376 unsigned NumElts = VT.getVectorNumElements();
2379 for (
unsigned i = 0; i != NumElts; ++i) {
2426 "unexpected type for custom-lowering ISD::MUL");
2429 unsigned NewOpc = 0;
2433 if (isN0SExt && isN1SExt)
2438 if (isN0ZExt && isN1ZExt)
2440 else if (isN1SExt || isN1ZExt) {
2474 "unexpected types for extended operands to VMULL");
2475 return DAG.
getNode(NewOpc, DL, VT, Op0, Op1);
2483 return DAG.
getNode(N0->getOpcode(),
DL, VT,
2490 SDValue AArch64TargetLowering::LowerINTRINSIC_WO_CHAIN(
SDValue Op,
2492 unsigned IntNo = cast<ConstantSDNode>(Op.
getOperand(0))->getZExtValue();
2496 case Intrinsic::thread_pointer: {
2500 case Intrinsic::aarch64_neon_abs:
2503 case Intrinsic::aarch64_neon_smax:
2506 case Intrinsic::aarch64_neon_umax:
2509 case Intrinsic::aarch64_neon_smin:
2512 case Intrinsic::aarch64_neon_umin:
2527 return LowerGlobalAddress(Op, DAG);
2529 return LowerGlobalTLSAddress(Op, DAG);
2531 return LowerSETCC(Op, DAG);
2533 return LowerBR_CC(Op, DAG);
2535 return LowerSELECT(Op, DAG);
2537 return LowerSELECT_CC(Op, DAG);
2539 return LowerJumpTable(Op, DAG);
2541 return LowerConstantPool(Op, DAG);
2543 return LowerBlockAddress(Op, DAG);
2545 return LowerVASTART(Op, DAG);
2547 return LowerVACOPY(Op, DAG);
2549 return LowerVAARG(Op, DAG);
2571 return LowerFP_ROUND(Op, DAG);
2573 return LowerFP_EXTEND(Op, DAG);
2575 return LowerFRAMEADDR(Op, DAG);
2577 return LowerRETURNADDR(Op, DAG);
2579 return LowerINSERT_VECTOR_ELT(Op, DAG);
2581 return LowerEXTRACT_VECTOR_ELT(Op, DAG);
2583 return LowerBUILD_VECTOR(Op, DAG);
2585 return LowerVECTOR_SHUFFLE(Op, DAG);
2587 return LowerEXTRACT_SUBVECTOR(Op, DAG);
2591 return LowerVectorSRA_SRL_SHL(Op, DAG);
2593 return LowerShiftLeftParts(Op, DAG);
2596 return LowerShiftRightParts(Op, DAG);
2598 return LowerCTPOP(Op, DAG);
2600 return LowerFCOPYSIGN(Op, DAG);
2602 return LowerVectorAND(Op, DAG);
2604 return LowerVectorOR(Op, DAG);
2611 return LowerINT_TO_FP(Op, DAG);
2614 return LowerFP_TO_INT(Op, DAG);
2616 return LowerFSINCOS(Op, DAG);
2620 return LowerINTRINSIC_WO_CHAIN(Op, DAG);
2628 return LowerVECREDUCE(Op, DAG);
2636 #include "AArch64GenCallingConv.inc"
2640 bool IsVarArg)
const {
2645 return CC_AArch64_WebKit_JS;
2647 return CC_AArch64_GHC;
2654 return CC_AArch64_Win64_VarArg;
2656 return CC_AArch64_AAPCS;
2657 return IsVarArg ? CC_AArch64_DarwinPCS_VarArg : CC_AArch64_DarwinPCS;
2659 return IsVarArg ? CC_AArch64_Win64_VarArg : CC_AArch64_AAPCS;
2666 : RetCC_AArch64_AAPCS;
2669 SDValue AArch64TargetLowering::LowerFormalArguments(
2688 unsigned NumArgs = Ins.
size();
2690 unsigned CurArgIdx = 0;
2691 for (
unsigned i = 0; i != NumArgs; ++i) {
2692 MVT ValVT = Ins[i].VT;
2693 if (Ins[i].isOrigArg()) {
2694 std::advance(CurOrigArg, Ins[i].getOrigArgIndex() - CurArgIdx);
2695 CurArgIdx = Ins[i].getOrigArgIndex();
2710 assert(!Res &&
"Call operand has unhandled type");
2715 for (
unsigned i = 0, e = ArgLocs.
size(); i != e; ++i) {
2718 if (Ins[i].
Flags.isByVal()) {
2722 int Size = Ins[i].Flags.getByValSize();
2723 unsigned NumRegs = (Size + 7) / 8;
2743 RC = &AArch64::GPR32RegClass;
2745 RC = &AArch64::GPR64RegClass;
2747 RC = &AArch64::FPR16RegClass;
2748 else if (RegVT == MVT::f32)
2749 RC = &AArch64::FPR32RegClass;
2751 RC = &AArch64::FPR64RegClass;
2753 RC = &AArch64::FPR128RegClass;
2777 assert(RegVT == Ins[i].VT &&
"incorrect register location selected");
2790 !Ins[i].Flags.isInConsecutiveRegs())
2791 BEAlign = 8 - ArgSize;
2821 ExtType, DL, VA.
getLocVT(), Chain, FIN,
2838 saveVarArgRegisters(CCInfo, DAG, DL, Chain);
2842 unsigned StackOffset = CCInfo.getNextStackOffset();
2844 StackOffset = ((StackOffset + 7) & ~7);
2848 unsigned StackArgSize = CCInfo.getNextStackOffset();
2850 if (DoesCalleeRestoreStack(CallConv, TailCallOpt)) {
2854 StackArgSize =
alignTo(StackArgSize, 16);
2871 void AArch64TargetLowering::saveVarArgRegisters(
CCState &CCInfo,
2884 AArch64::X3, AArch64::X4, AArch64::X5,
2885 AArch64::X6, AArch64::X7 };
2886 static const unsigned NumGPRArgRegs =
array_lengthof(GPRArgRegs);
2889 unsigned GPRSaveSize = 8 * (NumGPRArgRegs - FirstVariadicGPR);
2891 if (GPRSaveSize != 0) {
2894 if (GPRSaveSize & 15)
2902 for (
unsigned i = FirstVariadicGPR; i < NumGPRArgRegs; ++i) {
2903 unsigned VReg = MF.
addLiveIn(GPRArgRegs[i], &AArch64::GPR64RegClass);
2910 (i - FirstVariadicGPR) * 8)
2922 AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3,
2923 AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7};
2924 static const unsigned NumFPRArgRegs =
array_lengthof(FPRArgRegs);
2927 unsigned FPRSaveSize = 16 * (NumFPRArgRegs - FirstVariadicFPR);
2929 if (FPRSaveSize != 0) {
2934 for (
unsigned i = FirstVariadicFPR; i < NumFPRArgRegs; ++i) {
2935 unsigned VReg = MF.
addLiveIn(FPRArgRegs[i], &AArch64::FPR128RegClass);
2950 if (!MemOps.
empty()) {
2957 SDValue AArch64TargetLowering::LowerCallResult(
2963 ? RetCC_AArch64_WebKit_JS
2964 : RetCC_AArch64_AAPCS;
2972 for (
unsigned i = 0; i != RVLocs.
size(); ++i) {
2977 if (i == 0 && isThisReturn) {
2979 "unexpected return calling convention register assignment");
3022 bool AArch64TargetLowering::isEligibleForTailCallOptimization(
3033 bool CCMatch = CallerCC == CalleeCC;
3041 if (i->hasByValAttr())
3069 "Unexpected variadic calling convention");
3072 if (isVarArg && !Outs.
empty()) {
3080 CCState CCInfo(CalleeCC, isVarArg, MF, ArgLocs, C);
3084 if (!ArgLoc.isRegLoc())
3098 if (!TRI->regmaskSubsetEqual(CallerPreserved, CalleePreserved))
3107 CCState CCInfo(CalleeCC, isVarArg, MF, ArgLocs, C);
3125 SDValue AArch64TargetLowering::addTokenForArgument(
SDValue Chain,
3128 int ClobberedFI)
const {
3131 int64_t LastByte = FirstByte + MFI.
getObjectSize(ClobberedFI) - 1;
3144 if (FI->getIndex() < 0) {
3146 int64_t InLastByte = InFirstByte;
3149 if ((InFirstByte <= FirstByte && FirstByte <= InLastByte) ||
3150 (FirstByte <= InFirstByte && InFirstByte <= LastByte))
3158 bool AArch64TargetLowering::DoesCalleeRestoreStack(
CallingConv::ID CallCC,
3159 bool TailCallOpt)
const {
3166 AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI,
3175 bool &IsTailCall = CLI.IsTailCall;
3177 bool IsVarArg = CLI.IsVarArg;
3180 bool IsThisReturn =
false;
3184 bool IsSibCall =
false;
3188 IsTailCall = isEligibleForTailCallOptimization(
3189 Callee, CallConv, IsVarArg, Outs, OutVals, Ins, DAG);
3190 if (!IsTailCall && CLI.CS && CLI.CS->isMustTailCall())
3192 "site marked musttail");
3196 if (!TailCallOpt && IsTailCall)
3211 unsigned NumArgs = Outs.
size();
3213 for (
unsigned i = 0; i != NumArgs; ++i) {
3214 MVT ArgVT = Outs[i].VT;
3219 assert(!Res &&
"Call operand has unhandled type");
3229 unsigned NumArgs = Outs.
size();
3230 for (
unsigned i = 0; i != NumArgs; ++i) {
3231 MVT ValVT = Outs[i].VT;
3234 CLI.getArgs()[Outs[i].OrigArgIndex].Ty,
3246 assert(!Res &&
"Call operand has unhandled type");
3267 if (IsTailCall && !IsSibCall) {
3272 NumBytes =
alignTo(NumBytes, 16);
3277 FPDiff = NumReusableBytes - NumBytes;
3284 assert(FPDiff % 16 == 0 &&
"unaligned stack on tail call");
3300 for (
unsigned i = 0, realArgIdx = 0, e = ArgLocs.
size(); i != e;
3301 ++i, ++realArgIdx) {
3303 SDValue Arg = OutVals[realArgIdx];
3319 if (Outs[realArgIdx].ArgVT ==
MVT::i1) {
3338 "unexpected calling convention register assignment");
3340 "unexpected use of 'returned'");
3341 IsThisReturn =
true;
3355 OpSize = (OpSize + 7) / 8;
3359 BEAlign = 8 - OpSize;
3362 int32_t
Offset = LocMemOffset + BEAlign;
3367 Offset = Offset + FPDiff;
3377 Chain = addTokenForArgument(Chain, DAG, MF.
getFrameInfo(), FI);
3386 if (Outs[i].Flags.
isByVal()) {
3390 Chain, DL, DstAddr, Arg, SizeNode, Outs[i].Flags.
getByValAlign(),
3410 if (!MemOpChains.
empty())
3416 for (
auto &RegToPass : RegsToPass) {
3418 RegToPass.second, InFlag);
3425 if (
auto *
G = dyn_cast<GlobalAddressSDNode>(Callee)) {
3426 auto GV =
G->getGlobal();
3435 }
else if (
auto *S = dyn_cast<ExternalSymbolSDNode>(Callee)) {
3438 const char *Sym = S->getSymbol();
3442 const char *Sym = S->getSymbol();
3451 if (IsTailCall && !IsSibCall) {
3457 std::vector<SDValue> Ops;
3458 Ops.push_back(Chain);
3459 Ops.push_back(Callee);
3470 for (
auto &RegToPass : RegsToPass)
3472 RegToPass.second.getValueType()));
3481 IsThisReturn =
false;
3487 assert(Mask &&
"Missing call preserved mask for calling convention");
3491 Ops.push_back(InFlag);
3506 uint64_t CalleePopBytes =
3507 DoesCalleeRestoreStack(CallConv, TailCallOpt) ?
alignTo(NumBytes, 16) : 0;
3517 return LowerCallResult(Chain, InFlag, CallConv, IsVarArg, Ins, DL, DAG,
3518 InVals, IsThisReturn,
3519 IsThisReturn ? OutVals[0] :
SDValue());
3522 bool AArch64TargetLowering::CanLowerReturn(
3526 ? RetCC_AArch64_WebKit_JS
3527 : RetCC_AArch64_AAPCS;
3529 CCState CCInfo(CallConv, isVarArg, MF, RVLocs, Context);
3540 ? RetCC_AArch64_WebKit_JS
3541 : RetCC_AArch64_AAPCS;
3550 for (
unsigned i = 0, realRVLocIdx = 0; i != RVLocs.
size();
3551 ++i, ++realRVLocIdx) {
3554 SDValue Arg = OutVals[realRVLocIdx];
3560 if (Outs[i].ArgVT ==
MVT::i1) {
3582 if (AArch64::GPR64RegClass.
contains(*I))
3584 else if (AArch64::FPR64RegClass.
contains(*I))
3595 RetOps.push_back(Flag);
3606 unsigned Flag)
const {
3612 unsigned Flag)
const {
3618 unsigned Flag)
const {
3625 unsigned Flag)
const {
3630 template <
class NodeTy>
3632 DEBUG(
dbgs() <<
"AArch64TargetLowering::getGOT\n");
3642 template <
class NodeTy>
3645 DEBUG(
dbgs() <<
"AArch64TargetLowering::getAddrLarge\n");
3658 template <
class NodeTy>
3660 DEBUG(
dbgs() <<
"AArch64TargetLowering::getAddr\n");
3674 unsigned char OpFlags =
3678 "unexpected offset in global node");
3682 return getGOT(GN, DAG);
3686 return getAddrLarge(GN, DAG);
3688 return getAddr(GN, DAG);
3721 AArch64TargetLowering::LowerDarwinGlobalTLSAddress(
SDValue Op,
3727 const GlobalValue *GV = cast<GlobalAddressSDNode>(
Op)->getGlobal();
3782 SDValue AArch64TargetLowering::LowerELFTLSDescCallSeq(
SDValue SymAddr,
3798 AArch64TargetLowering::LowerELFGlobalTLSAddress(
SDValue Op,
3802 "ELF TLS only supported in small memory model");
3867 TPOff = LowerELFTLSDescCallSeq(SymAddr, DL, DAG);
3891 TPOff = LowerELFTLSDescCallSeq(SymAddr, DL, DAG);
3901 return LowerDarwinGlobalTLSAddress(Op, DAG);
3903 return LowerELFGlobalTLSAddress(Op, DAG);
3937 "Unexpected condition code.");
4050 else if (SrcVT.
bitsGT(VT))
4060 EltMask = 0x80000000ULL;
4116 Attribute::NoImplicitFloat))
4151 return LowerVSETCC(Op, DAG);
4171 "Unexpected setcc expansion!");
4279 }
else if (CTVal && CFVal) {
4280 const int64_t TrueVal = CTVal->getSExtValue();
4287 if (TrueVal == ~FalseVal) {
4289 }
else if (TrueVal == -FalseVal) {
4297 const uint32_t TrueVal32 = CTVal->getZExtValue();
4300 if ((TrueVal32 == FalseVal32 + 1) || (TrueVal32 + 1 == FalseVal32)) {
4303 if (TrueVal32 > FalseVal32) {
4308 }
else if ((TrueVal == FalseVal + 1) || (TrueVal + 1 == FalseVal)) {
4311 if (TrueVal > FalseVal) {
4343 else if (CFVal && CFVal == RHSVal && AArch64CC ==
AArch64CC::NE)
4346 assert (CTVal && CFVal &&
"Expected constant operands for CSNEG.");
4361 return DAG.
getNode(Opcode, dl, VT, TVal, FVal, CCVal, Cmp);
4379 if (RHSVal && RHSVal->
isZero()) {
4387 CFVal && CFVal->
isZero() &&
4416 return LowerSELECT_CC(CC, LHS, RHS, TVal, FVal, DL, DAG);
4451 CC = cast<CondCodeSDNode>(CCVal->getOperand(2))->
get();
4454 RHS = DAG.
getConstant(0, DL, CCVal.getValueType());
4457 return LowerSELECT_CC(CC, LHS, RHS, TVal, FVal, DL, DAG);
4468 return getAddrLarge(JT, DAG);
4470 return getAddr(JT, DAG);
4480 return getGOT(CP, DAG);
4482 return getAddrLarge(CP, DAG);
4484 return getAddr(CP, DAG);
4493 return getAddrLarge(BA, DAG);
4495 return getAddr(BA, DAG);
4507 const Value *SV = cast<SrcValueSDNode>(Op.
getOperand(2))->getValue();
4522 const Value *SV = cast<SrcValueSDNode>(Op.
getOperand(2))->getValue();
4538 const Value *SV = cast<SrcValueSDNode>(Op.
getOperand(2))->getValue();
4601 return LowerWin64_VASTART(Op, DAG);
4603 return LowerDarwin_VASTART(Op, DAG);
4605 return LowerAAPCS_VASTART(Op, DAG);
4613 unsigned VaListSize =
4615 const Value *DestSV = cast<SrcValueSDNode>(Op.
getOperand(3))->getValue();
4616 const Value *SrcSV = cast<SrcValueSDNode>(Op.
getOperand(4))->getValue();
4627 "automatic va_arg instruction only works on Darwin");
4629 const Value *V = cast<SrcValueSDNode>(Op.
getOperand(2))->getValue();
4641 assert(((Align & (Align - 1)) == 0) &&
"Expected Align to be a power of 2");
4657 bool NeedFPTrunc =
false;
4693 unsigned Depth = cast<ConstantSDNode>(Op.
getOperand(0))->getZExtValue();
4704 unsigned AArch64TargetLowering::getRegisterByName(
const char* RegName,
EVT VT,
4707 .Case(
"sp", AArch64::SP)
4708 .
Case(
"x18", AArch64::X18)
4709 .
Case(
"w18", AArch64::W18)
4711 if ((Reg == AArch64::X18 || Reg == AArch64::W18) &&
4728 unsigned Depth = cast<ConstantSDNode>(Op.
getOperand(0))->getZExtValue();
4730 SDValue FrameAddr = LowerFRAMEADDR(Op, DAG);
4738 unsigned Reg = MF.
addLiveIn(AArch64::LR, &AArch64::GPR64RegClass);
4768 HiBitsForLo, CCVal, Cmp);
4780 SDValue LoForBigShift = DAG.
getNode(Opc, dl, VT, ShOpHi, ExtraShAmt);
4782 LoForNormalShift, CCVal, Cmp);
4786 SDValue HiForNormalShift = DAG.
getNode(Opc, dl, VT, ShOpHi, ShAmt);
4789 ? DAG.
getNode(Opc, dl, VT, ShOpHi,
4793 HiForNormalShift, CCVal, Cmp);
4805 unsigned VTBits = VT.getSizeInBits();
4823 LoBitsForHi, CCVal, Cmp);
4837 HiForNormalShift, CCVal, Cmp);
4844 LoForNormalShift, CCVal, Cmp);
4864 else if (VT == MVT::f32)
4881 if (ExtraSteps == TargetLoweringBase::ReciprocalEstimate::Unspecified)
4887 ExtraSteps = VT ==
MVT::f64 ? 3 : 2;
4889 return DAG.
getNode(Opcode,
SDLoc(Operand), VT, Operand);
4899 bool Reciprocal)
const {
4901 (Enabled == ReciprocalEstimate::Unspecified && Subtarget->
useRSqrt()))
4912 for (
int i = ExtraSteps; i > 0; --i) {
4928 VT,
Eq, Operand, Estimate);
4940 int &ExtraSteps)
const {
4952 for (
int i = ExtraSteps; i > 0; --i) {
4992 const char *AArch64TargetLowering::LowerXConstraint(
EVT ConstraintVT)
const {
5017 AArch64TargetLowering::getConstraintType(
StringRef Constraint)
const {
5018 if (Constraint.
size() == 1) {
5019 switch (Constraint[0]) {
5040 AArch64TargetLowering::getSingleConstraintMatchWeight(
5041 AsmOperandInfo &
info,
const char *constraint)
const {
5043 Value *CallOperandVal = info.CallOperandVal;
5046 if (!CallOperandVal)
5050 switch (*constraint) {
5066 std::pair<unsigned, const TargetRegisterClass *>
5067 AArch64TargetLowering::getRegForInlineAsmConstraint(
5069 if (Constraint.
size() == 1) {
5070 switch (Constraint[0]) {
5073 return std::make_pair(0U, &AArch64::GPR64commonRegClass);
5074 return std::make_pair(0U, &AArch64::GPR32commonRegClass);
5077 return std::make_pair(0U, &AArch64::FPR16RegClass);
5079 return std::make_pair(0U, &AArch64::FPR32RegClass);
5081 return std::make_pair(0U, &AArch64::FPR64RegClass);
5083 return std::make_pair(0U, &AArch64::FPR128RegClass);
5089 return std::make_pair(0U, &AArch64::FPR128_loRegClass);
5094 return std::make_pair(
unsigned(AArch64::NZCV), &AArch64::CCRRegClass);
5098 std::pair<unsigned, const TargetRegisterClass *> Res;
5103 unsigned Size = Constraint.
size();
5104 if ((Size == 4 || Size == 5) && Constraint[0] ==
'{' &&
5105 tolower(Constraint[1]) ==
'v' && Constraint[Size - 1] ==
'}') {
5108 if (!Failed && RegNo >= 0 && RegNo <= 31) {
5113 Res.first = AArch64::FPR64RegClass.getRegister(RegNo);
5114 Res.second = &AArch64::FPR64RegClass;
5116 Res.first = AArch64::FPR128RegClass.getRegister(RegNo);
5117 Res.second = &AArch64::FPR128RegClass;
5128 void AArch64TargetLowering::LowerAsmOperandForConstraint(
5129 SDValue Op, std::string &Constraint, std::vector<SDValue> &Ops,
5134 if (Constraint.length() != 1)
5137 char ConstraintLetter = Constraint[0];
5138 switch (ConstraintLetter) {
5168 switch (ConstraintLetter) {
5176 if (isUInt<12>(CVal) || isShiftedUInt<12, 12>(CVal))
5181 if (isUInt<12>(NVal) || isShiftedUInt<12, 12>(NVal)) {
5213 if ((CVal & 0xFFFF) == CVal)
5215 if ((CVal & 0xFFFF0000ULL) == CVal)
5218 if ((NCVal & 0xFFFFULL) == NCVal)
5220 if ((NCVal & 0xFFFF0000ULL) == NCVal)
5227 if ((CVal & 0xFFFFULL) == CVal)
5229 if ((CVal & 0xFFFF0000ULL) == CVal)
5231 if ((CVal & 0xFFFF00000000ULL) == CVal)
5233 if ((CVal & 0xFFFF000000000000ULL) == CVal)
5235 uint64_t NCVal = ~CVal;
5236 if ((NCVal & 0xFFFFULL) == NCVal)
5238 if ((NCVal & 0xFFFF0000ULL) == NCVal)
5240 if ((NCVal & 0xFFFF00000000ULL) == NCVal)
5242 if ((NCVal & 0xFFFF000000000000ULL) == NCVal)
5256 Ops.push_back(Result);
5308 struct ShuffleSourceInfo {
5323 ShuffleSourceInfo(
SDValue Vec)
5325 ShuffleVec(Vec), WindowBase(0), WindowScale(1) {}
5333 for (
unsigned i = 0; i < NumElts; ++i) {
5351 unsigned EltNo = cast<ConstantSDNode>(V.
getOperand(1))->getZExtValue();
5358 if (Sources.
size() > 2)
5364 for (
auto &
Source : Sources) {
5365 EVT SrcEltTy =
Source.Vec.getValueType().getVectorElementType();
5366 if (SrcEltTy.
bitsLT(SmallestEltTy)) {
5367 SmallestEltTy = SrcEltTy;
5370 unsigned ResMultiplier =
5378 for (
auto &Src : Sources) {
5379 EVT SrcVT = Src.ShuffleVec.getValueType();
5396 DAG.
getUNDEF(Src.ShuffleVec.getValueType()));
5402 if (Src.MaxElt - Src.MinElt >= NumSrcElts) {
5407 if (Src.MinElt >= NumSrcElts) {
5412 Src.WindowBase = -NumSrcElts;
5413 }
else if (Src.MaxElt < NumSrcElts) {
5431 Src.WindowBase = -Src.MinElt;
5438 for (
auto &Src : Sources) {
5440 if (SrcEltTy == SmallestEltTy)
5445 Src.WindowBase *= Src.WindowScale;
5450 for (
auto Src : Sources)
5451 assert(Src.ShuffleVec.getValueType() == ShuffleVT);
5463 int EltNo = cast<ConstantSDNode>(Entry.
getOperand(1))->getSExtValue();
5471 int LanesDefined = BitsDefined / BitsPerShuffleLane;
5475 int *LaneMask = &Mask[i * ResMultiplier];
5477 int ExtractBase = EltNo * Src->WindowScale + Src->WindowBase;
5478 ExtractBase += NumElts * (Src - Sources.begin());
5479 for (
int j = 0; j < LanesDefined; ++j)
5480 LaneMask[j] = ExtractBase + j;
5488 for (
unsigned i = 0; i < Sources.size(); ++i)
5489 ShuffleOps[i] = Sources[i].ShuffleVec;
5492 ShuffleOps[1], Mask);
5510 unsigned ExpectedElt = Imm;
5511 for (
unsigned i = 1; i < NumElts; ++i) {
5515 if (ExpectedElt == NumElts)
5520 if (ExpectedElt != static_cast<unsigned>(M[i]))
5532 const int *FirstRealElt =
find_if(M, [](
int Elt) {
return Elt >= 0; });
5537 APInt ExpectedElt =
APInt(MaskBits, *FirstRealElt + 1);
5541 [&](
int Elt) {
return Elt != ExpectedElt++ && Elt != -1;});
5542 if (FirstWrongElt != M.
end())
5571 assert((BlockSize == 16 || BlockSize == 32 || BlockSize == 64) &&
5572 "Only possible block sizes for REV are: 16, 32, 64");
5579 unsigned BlockElts = M[0] + 1;
5582 BlockElts = BlockSize / EltSz;
5584 if (BlockSize <= EltSz || BlockSize != BlockElts * EltSz)
5587 for (
unsigned i = 0; i < NumElts; ++i) {
5590 if ((
unsigned)M[i] != (i - i % BlockElts) + (BlockElts - 1 - i % BlockElts))
5599 WhichResult = (M[0] == 0 ? 0 : 1);
5600 unsigned Idx = WhichResult * NumElts / 2;
5601 for (
unsigned i = 0; i != NumElts; i += 2) {
5602 if ((M[i] >= 0 && (
unsigned)M[i] != Idx) ||
5603 (M[i + 1] >= 0 && (
unsigned)M[i + 1] != Idx + NumElts))
5613 WhichResult = (M[0] == 0 ? 0 : 1);
5614 for (
unsigned i = 0; i != NumElts; ++i) {
5617 if ((
unsigned)M[i] != 2 * i + WhichResult)
5626 WhichResult = (M[0] == 0 ? 0 : 1);
5627 for (
unsigned i = 0; i < NumElts; i += 2) {
5628 if ((M[i] >= 0 && (
unsigned)M[i] != i + WhichResult) ||
5629 (M[i + 1] >= 0 && (
unsigned)M[i + 1] != i + NumElts + WhichResult))
5640 WhichResult = (M[0] == 0 ? 0 : 1);
5641 unsigned Idx = WhichResult * NumElts / 2;
5642 for (
unsigned i = 0; i != NumElts; i += 2) {
5643 if ((M[i] >= 0 && (
unsigned)M[i] != Idx) ||
5644 (M[i + 1] >= 0 && (
unsigned)M[i + 1] != Idx))
5657 WhichResult = (M[0] == 0 ? 0 : 1);
5658 for (
unsigned j = 0; j != 2; ++j) {
5659 unsigned Idx = WhichResult;
5660 for (
unsigned i = 0; i != Half; ++i) {
5661 int MIdx = M[i + j * Half];
5662 if (MIdx >= 0 && (
unsigned)MIdx != Idx)
5676 WhichResult = (M[0] == 0 ? 0 : 1);
5677 for (
unsigned i = 0; i < NumElts; i += 2) {
5678 if ((M[i] >= 0 && (
unsigned)M[i] != i + WhichResult) ||
5679 (M[i + 1] >= 0 && (
unsigned)M[i + 1] != i + WhichResult))
5686 bool &DstIsLeft,
int &Anomaly) {
5687 if (M.
size() !=
static_cast<size_t>(NumInputElements))
5690 int NumLHSMatch = 0, NumRHSMatch = 0;
5691 int LastLHSMismatch = -1, LastRHSMismatch = -1;
5693 for (
int i = 0; i < NumInputElements; ++i) {
5703 LastLHSMismatch = i;
5705 if (M[i] == i + NumInputElements)
5708 LastRHSMismatch = i;
5711 if (NumLHSMatch == NumInputElements - 1) {
5713 Anomaly = LastLHSMismatch;
5715 }
else if (NumRHSMatch == NumInputElements - 1) {
5717 Anomaly = LastRHSMismatch;
5730 for (
int I = 0,
E = NumElts / 2; I !=
E; I++) {
5735 int Offset = NumElts / 2;
5736 for (
int I = NumElts / 2,
E = NumElts; I !=
E; I++) {
5737 if (Mask[I] != I + SplitLHS * Offset)
5778 unsigned OpNum = (PFEntry >> 26) & 0x0F;
5779 unsigned LHSID = (PFEntry >> 13) & ((1 << 13) - 1);
5780 unsigned RHSID = (PFEntry >> 0) & ((1 << 13) - 1);
5800 if (OpNum == OP_COPY) {
5801 if (LHSID == (1 * 9 + 2) * 9 + 3)
5803 assert(LHSID == ((4 * 9 + 5) * 9 + 6) * 9 + 7 &&
"Illegal OP_COPY!");
5837 else if (EltTy ==
MVT::i32 || EltTy == MVT::f32)
5847 return DAG.
getNode(Opcode, dl, VT, OpLHS, Lane);
5852 unsigned Imm = (OpNum - OP_VEXT1 + 1) *
getExtFactor(OpLHS);
5888 for (
int Val : ShuffleMask) {
5889 for (
unsigned Byte = 0; Byte < BytesPerElt; ++Byte) {
5890 unsigned Offset = Byte + Val * BytesPerElt;
5896 unsigned IndexLen = 8;
5915 if (IndexLen == 8) {
5944 if (EltType ==
MVT::i32 || EltType == MVT::f32)
5990 Lane += cast<ConstantSDNode>(V1.
getOperand(1))->getZExtValue();
6009 bool ReverseEXT =
false;
6011 if (
isEXTMask(ShuffleMask, VT, ReverseEXT, Imm)) {
6023 unsigned WhichResult;
6024 if (
isZIPMask(ShuffleMask, VT, WhichResult)) {
6026 return DAG.
getNode(Opc, dl, V1.getValueType(), V1,
V2);
6028 if (
isUZPMask(ShuffleMask, VT, WhichResult)) {
6030 return DAG.
getNode(Opc, dl, V1.getValueType(), V1,
V2);
6032 if (
isTRNMask(ShuffleMask, VT, WhichResult)) {
6034 return DAG.
getNode(Opc, dl, V1.getValueType(), V1,
V2);
6039 return DAG.
getNode(Opc, dl, V1.getValueType(), V1, V1);
6043 return DAG.
getNode(Opc, dl, V1.getValueType(), V1, V1);
6047 return DAG.
getNode(Opc, dl, V1.getValueType(), V1, V1);
6056 if (
isINSMask(ShuffleMask, NumInputElements, DstIsLeft, Anomaly)) {
6061 int SrcLane = ShuffleMask[Anomaly];
6062 if (SrcLane >= NumInputElements) {
6083 unsigned PFIndexes[4];
6084 for (
unsigned i = 0; i != 4; ++i) {
6085 if (ShuffleMask[i] < 0)
6088 PFIndexes[i] = ShuffleMask[i];
6092 unsigned PFTableIndex = PFIndexes[0] * 9 * 9 * 9 + PFIndexes[1] * 9 * 9 +
6093 PFIndexes[2] * 9 + PFIndexes[3];
6095 unsigned Cost = (PFEntry >> 30);
6107 APInt SplatBits, SplatUndef;
6108 unsigned SplatBitSize;
6110 if (BVN->
isConstantSplat(SplatBits, SplatUndef, SplatBitSize, HasAnyUndefs)) {
6113 for (
unsigned i = 0; i < NumSplats; ++i) {
6114 CnstBits <<= SplatBitSize;
6115 UndefBits <<= SplatBitSize;
6117 UndefBits |= (SplatBits ^ SplatUndef).zextOrTrunc(VT.
getSizeInBits());
6141 CnstBits = ~CnstBits;
6145 bool SecondTry =
false;
6148 if (CnstBits.getHiBits(64) == CnstBits.getLoBits(64)) {
6210 CnstBits = ~UndefBits;
6223 uint64_t &ConstVal) {
6232 for (
unsigned i = 1; i < NumElts; ++i)
6233 if (dyn_cast<ConstantSDNode>(Bvec->
getOperand(i)) != FirstElt)
6245 unsigned IID = cast<ConstantSDNode>(N->
getOperand(0))->getZExtValue();
6293 if (C2 > ElemSizeInBits)
6295 unsigned ElemMask = (1 << ElemSizeInBits) - 1;
6296 if ((C1 & ElemMask) != (~C2 & ElemMask))
6303 IsShiftRight ? Intrinsic::aarch64_neon_vsri : Intrinsic::aarch64_neon_vsli;
6309 DEBUG(
dbgs() <<
"aarch64-lower: transformed: \n");
6345 bool SecondTry =
false;
6348 if (CnstBits.getHiBits(64) == CnstBits.getLoBits(64)) {
6349 CnstBits = CnstBits.zextOrTrunc(64);
6350 uint64_t CnstVal = CnstBits.getZExtValue();
6410 CnstBits = UndefBits;
6433 if (
auto *CstLane = dyn_cast<ConstantSDNode>(Lane)) {
6435 CstLane->getZExtValue());
6455 bool SecondTry =
false;
6458 if (CnstBits.getHiBits(64) == CnstBits.getLoBits(64)) {
6459 CnstBits = CnstBits.zextOrTrunc(64);
6460 uint64_t CnstVal = CnstBits.getZExtValue();
6466 if (VT.
isInteger() && (CnstVal == 0 || CnstVal == ~0ULL))
6659 CnstBits = UndefBits;
6676 bool isOnlyLowElement =
true;
6677 bool usesOnlyOneValue =
true;
6678 bool usesOnlyOneConstantValue =
true;
6680 unsigned NumConstantLanes = 0;
6683 for (
unsigned i = 0; i < NumElts; ++i) {
6688 isOnlyLowElement =
false;
6689 if (!isa<ConstantFPSDNode>(V) && !isa<ConstantSDNode>(V))
6692 if (isa<ConstantSDNode>(V) || isa<ConstantFPSDNode>(V)) {
6696 else if (ConstantValue != V)
6697 usesOnlyOneConstantValue =
false;
6702 else if (V != Value)
6703 usesOnlyOneValue =
false;
6709 if (isOnlyLowElement)
6714 if (usesOnlyOneValue) {
6729 return DAG.
getNode(Opcode, dl, VT, Value, Lane);
6736 "Unsupported floating-point vector type");
6738 for (
unsigned i = 0; i < NumElts; ++i)
6742 Val = LowerBUILD_VECTOR(Val, DAG);
6752 if (NumConstantLanes > 0 && usesOnlyOneConstantValue) {
6755 for (
unsigned i = 0; i < NumElts; ++i) {
6758 if (!isa<ConstantSDNode>(V) && !isa<ConstantFPSDNode>(V)) {
6785 if (!isConstant && !usesOnlyOneValue) {
6804 for (; i < NumElts; ++i) {
6818 SDValue AArch64TargetLowering::LowerINSERT_VECTOR_ELT(
SDValue Op,
6825 if (!CI || CI->
getZExtValue() >= VT.getVectorNumElements())
6852 AArch64TargetLowering::LowerEXTRACT_VECTOR_ELT(
SDValue Op,
6859 if (!CI || CI->
getZExtValue() >= VT.getVectorNumElements())
6888 SDValue AArch64TargetLowering::LowerEXTRACT_SUBVECTOR(
SDValue Op,
6919 unsigned PFIndexes[4];
6920 for (
unsigned i = 0; i != 4; ++i) {
6924 PFIndexes[i] = M[i];
6928 unsigned PFTableIndex = PFIndexes[0] * 9 * 9 * 9 + PFIndexes[1] * 9 * 9 +
6929 PFIndexes[2] * 9 + PFIndexes[3];
6931 unsigned Cost = (PFEntry >> 30);
6939 unsigned DummyUnsigned;
6943 isEXTMask(M, VT, DummyBool, DummyUnsigned) ||
6962 APInt SplatBits, SplatUndef;
6963 unsigned SplatBitSize;
6965 if (!BVN || !BVN->
isConstantSplat(SplatBits, SplatUndef, SplatBitSize,
6966 HasAnyUndefs, ElementBits) ||
6967 SplatBitSize > ElementBits)
6978 assert(VT.
isVector() &&
"vector shift count is not a vector type");
6982 return (Cnt >= 0 && (isLong ? Cnt - 1 : Cnt) < ElementBits);
6989 assert(VT.
isVector() &&
"vector shift count is not a vector type");
6993 return (Cnt >= 1 && Cnt <= (isNarrow ? ElementBits / 2 : ElementBits));
6996 SDValue AArch64TargetLowering::LowerVectorSRA_SRL_SHL(
SDValue Op,
7032 : Intrinsic::aarch64_neon_ushl;
7039 return NegShiftLeft;
7050 "function only supposed to emit natural comparisons");
7056 bool IsZero = IsCnst && (CnstBits == 0);
7237 unsigned Intrinsic)
const {
7239 switch (Intrinsic) {
7240 case Intrinsic::aarch64_neon_ld2:
7241 case Intrinsic::aarch64_neon_ld3:
7242 case Intrinsic::aarch64_neon_ld4:
7243 case Intrinsic::aarch64_neon_ld1x2:
7244 case Intrinsic::aarch64_neon_ld1x3:
7245 case Intrinsic::aarch64_neon_ld1x4:
7246 case Intrinsic::aarch64_neon_ld2lane:
7247 case Intrinsic::aarch64_neon_ld3lane:
7248 case Intrinsic::aarch64_neon_ld4lane:
7249 case Intrinsic::aarch64_neon_ld2r:
7250 case Intrinsic::aarch64_neon_ld3r:
7251 case Intrinsic::aarch64_neon_ld4r: {
7254 uint64_t NumElts = DL.getTypeSizeInBits(I.
getType()) / 64;
7264 case Intrinsic::aarch64_neon_st2:
7265 case Intrinsic::aarch64_neon_st3:
7266 case Intrinsic::aarch64_neon_st4:
7267 case Intrinsic::aarch64_neon_st1x2:
7268 case Intrinsic::aarch64_neon_st1x3:
7269 case Intrinsic::aarch64_neon_st1x4:
7270 case Intrinsic::aarch64_neon_st2lane:
7271 case Intrinsic::aarch64_neon_st3lane:
7272 case Intrinsic::aarch64_neon_st4lane: {
7275 unsigned NumElts = 0;
7280 NumElts += DL.getTypeSizeInBits(ArgTy) / 64;
7291 case Intrinsic::aarch64_ldaxr:
7292 case Intrinsic::aarch64_ldxr: {
7304 case Intrinsic::aarch64_stlxr:
7305 case Intrinsic::aarch64_stxr: {
7317 case Intrinsic::aarch64_ldaxp:
7318 case Intrinsic::aarch64_ldxp:
7328 case Intrinsic::aarch64_stlxp:
7329 case Intrinsic::aarch64_stxp:
7352 return NumBits1 > NumBits2;
7359 return NumBits1 > NumBits2;
7366 if (I->
getOpcode() != Instruction::FMul)
7375 !(User->
getOpcode() == Instruction::FSub ||
7376 User->
getOpcode() == Instruction::FAdd))
7396 return NumBits1 == 32 && NumBits2 == 64;
7403 return NumBits1 == 32 && NumBits2 == 64;
7421 bool AArch64TargetLowering::isExtFreeImpl(
const Instruction *
Ext)
const {
7422 if (isa<FPExtInst>(Ext))
7429 for (
const Use &U : Ext->
uses()) {
7434 const Instruction *Instr = cast<Instruction>(U.getUser());
7438 case Instruction::Shl:
7442 case Instruction::GetElementPtr: {
7445 std::advance(GTI, U.getOperandNo()-1);
7455 if (ShiftAmt == 0 || ShiftAmt > 4)
7459 case Instruction::Trunc:
7476 unsigned &RequiredAligment)
const {
7481 RequiredAligment = 0;
7483 return NumBits == 32 || NumBits == 64;
7513 if (ElSize != 8 && ElSize != 16 && ElSize != 32 && ElSize != 64)
7518 return VecSize == 64 || VecSize % 128 == 0;
7536 "Invalid interleave factor");
7537 assert(!Shuffles.
empty() &&
"Empty shufflevector input");
7539 "Unmatched number of shufflevectors and indices");
7580 Type *Tys[2] = {VecTy, PtrTy};
7581 static const Intrinsic::ID LoadInts[3] = {Intrinsic::aarch64_neon_ld2,
7582 Intrinsic::aarch64_neon_ld3,
7583 Intrinsic::aarch64_neon_ld4};
7592 for (
unsigned LoadCount = 0; LoadCount < NumLoads; ++LoadCount) {
7604 for (
unsigned i = 0; i < Shuffles.
size(); i++) {
7606 unsigned Index = Indices[i];
7615 SubVecs[SVI].push_back(SubVec);
7624 auto &SubVec = SubVecs[SVI];
7627 SVI->replaceAllUsesWith(WideVec);
7661 unsigned Factor)
const {
7663 "Invalid interleave factor");
7667 "Invalid interleaved store");
7691 unsigned NumOpElts =
7705 if (NumStores > 1) {
7708 LaneLen /= NumStores;
7722 Type *Tys[2] = {SubVecTy, PtrTy};
7723 static const Intrinsic::ID StoreInts[3] = {Intrinsic::aarch64_neon_st2,
7724 Intrinsic::aarch64_neon_st3,
7725 Intrinsic::aarch64_neon_st4};
7729 for (
unsigned StoreCount = 0; StoreCount < NumStores; ++StoreCount) {
7734 for (
unsigned i = 0; i < Factor; i++) {
7735 unsigned IdxI = StoreCount * LaneLen * Factor + i;
7736 if (Mask[IdxI] >= 0) {
7740 unsigned StartMask = 0;
7741 for (
unsigned j = 1; j < LaneLen; j++) {
7742 unsigned IdxJ = StoreCount * LaneLen * Factor + j;
7743 if (Mask[IdxJ * Factor + IdxI] >= 0) {
7744 StartMask = Mask[IdxJ * Factor + IdxI] - IdxJ;
7770 unsigned AlignCheck) {
7771 return ((SrcAlign == 0 || SrcAlign % AlignCheck == 0) &&
7772 (DstAlign == 0 || DstAlign % AlignCheck == 0));
7776 unsigned SrcAlign,
bool IsMemset,
7785 if (Subtarget->
hasFPARMv8() && !IsMemset && Size >= 16 &&
7811 return ((Immed >> 12) == 0 || ((Immed & 0xfff) == 0 && Immed >> 24 == 0));
7824 unsigned AS)
const {
7842 uint64_t NumBytes = 0;
7845 NumBytes = NumBits / 8;
7854 if (isInt<9>(Offset))
7858 unsigned shift =
Log2_64(NumBytes);
7859 if (NumBytes && Offset > 0 && (Offset / NumBytes) <= (1LL << 12) - 1 &&
7861 (Offset >> shift) << shift == Offset)
7868 return AM.
Scale == 1 || (AM.
Scale > 0 && (uint64_t)AM.
Scale == NumBytes);
7873 unsigned AS)
const {
7910 static const MCPhysReg ScratchRegs[] = {
7911 AArch64::X16, AArch64::X17, AArch64::LR, 0
7944 if ((int64_t)Val < 0)
7947 Val &= (1LL << 32) - 1;
7950 unsigned Shift = (63 - LZ) / 16;
7976 if (!ShiftAmt || ShiftAmt->getZExtValue() != ShiftEltTy.getSizeInBits() - 1)
8023 AArch64TargetLowering::BuildSDIVPow2(
SDNode *N,
const APInt &Divisor,
8025 std::vector<SDNode *> *Created)
const {
8033 !(Divisor.
isPowerOf2() || (-Divisor).isPowerOf2()))
8049 Created->push_back(Cmp.
getNode());
8050 Created->push_back(Add.
getNode());
8051 Created->push_back(CSel.
getNode());
8064 Created->push_back(SRA.
getNode());
8094 unsigned TrailingZeroes = ConstValue.countTrailingZeros();
8095 if (TrailingZeroes) {
8109 APInt ShiftedConstValue = ConstValue.
ashr(TrailingZeroes);
8111 unsigned ShiftAmt, AddSubOpc;
8113 bool ShiftValUseIsN0 =
true;
8115 bool NegateResult =
false;
8117 if (ConstValue.isNonNegative()) {
8121 APInt SCVMinus1 = ShiftedConstValue - 1;
8122 APInt CVPlus1 = ConstValue + 1;
8134 APInt CVNegPlus1 = -ConstValue + 1;
8135 APInt CVNegMinus1 = -ConstValue - 1;
8139 ShiftValUseIsN0 =
false;
8143 NegateResult =
true;
8153 SDValue AddSubN0 = ShiftValUseIsN0 ? ShiftedVal : N0;
8154 SDValue AddSubN1 = ShiftValUseIsN0 ? N0 : ShiftedVal;
8155 SDValue Res = DAG.
getNode(AddSubOpc, DL, VT, AddSubN0, AddSubN1);
8156 assert(!(NegateResult && TrailingZeroes) &&
8157 "NegateResult and TrailingZeroes cannot both be true for now.");
8194 if (!BV->isConstant())
8199 EVT IntVT = BV->getValueType(0);
8222 if (VT != MVT::f32 && VT !=
MVT::f64)
8267 if (!isa<BuildVectorSDNode>(ConstVec))
8272 if (FloatBits != 32 && FloatBits != 64)
8277 if (IntBits != 16 && IntBits != 32 && IntBits != 64)
8281 if (IntBits > FloatBits)
8286 int32_t
Bits = IntBits == 64 ? 64 : 32;
8288 if (C == -1 || C == 0 || C > Bits)
8308 "Illegal vector type after legalization");
8312 unsigned IntrinsicOpcode = IsSigned ? Intrinsic::aarch64_neon_vcvtfp2fxs
8313 : Intrinsic::aarch64_neon_vcvtfp2fxu;
8319 if (IntBits < FloatBits)
8341 if (!isa<BuildVectorSDNode>(ConstVec))
8346 if (IntBits != 16 && IntBits != 32 && IntBits != 64)
8351 if (FloatBits != 32 && FloatBits != 64)
8355 if (IntBits > FloatBits)
8361 if (C == -1 || C == 0 || C > FloatBits)
8383 if (IntBits < FloatBits)
8387 unsigned IntrinsicOpcode = IsSigned ? Intrinsic::aarch64_neon_vcvtfxs2fp
8388 : Intrinsic::aarch64_neon_vcvtfxu2fp;
8431 bool LHSFromHi =
false;
8437 bool RHSFromHi =
false;
8443 if (LHSFromHi == RHSFromHi)
8478 uint64_t BitMask = Bits == 64 ? -1ULL : ((1ULL <<
Bits) - 1);
8479 for (
int i = 1; i >= 0; --i)
8480 for (
int j = 1; j >= 0; --j) {
8486 bool FoundMatch =
true;
8491 CN0->
getZExtValue() != (BitMask & ~CN1->getZExtValue())) {
8540 if (VT ==
MVT::i32 && ShiftAmt == 16 &&
8543 if (VT ==
MVT::i64 && ShiftAmt == 32 &&
8580 uint64_t idx = cast<ConstantSDNode>(Op0->
getOperand(1))->getZExtValue();
8585 if (idx != AArch64::dsub)
8600 DEBUG(
dbgs() <<
"aarch64-lower: bitcast extract_subvector simplification\n");
8647 for (
size_t i = 0; i < Mask.size(); ++i)
8688 DEBUG(
dbgs() <<
"aarch64-lower: concat_vectors bitcast simplification\n");
8730 "unexpected vector size on extract_vector_elt!");
8856 cast<ConstantSDNode>(Op.
getOperand(2))->getZExtValue());
8865 if (!TValue || !FValue)
8869 if (!TValue->
isOne()) {
8875 return TValue->
isOne() && FValue->isNullValue();
9001 "unexpected shape for long operation");
9024 int64_t ShiftAmount;
9026 APInt SplatValue, SplatUndef;
9027 unsigned SplatBitSize;
9030 HasAnyUndefs, ElemBits) ||
9031 SplatBitSize != ElemBits)
9036 ShiftAmount = CVN->getSExtValue();
9045 case Intrinsic::aarch64_neon_sqshl:
9047 IsRightShift =
false;
9049 case Intrinsic::aarch64_neon_uqshl:
9051 IsRightShift =
false;
9053 case Intrinsic::aarch64_neon_srshl:
9055 IsRightShift =
true;
9057 case Intrinsic::aarch64_neon_urshl:
9059 IsRightShift =
true;
9061 case Intrinsic::aarch64_neon_sqshlu:
9063 IsRightShift =
false;
9067 if (IsRightShift && ShiftAmount <= -1 && ShiftAmount >= -(
int)ElemBits) {
9071 }
else if (!IsRightShift && ShiftAmount >= 0 && ShiftAmount < ElemBits) {
9114 case Intrinsic::aarch64_neon_vcvtfxs2fp:
9115 case Intrinsic::aarch64_neon_vcvtfxu2fp:
9117 case Intrinsic::aarch64_neon_saddv:
9119 case Intrinsic::aarch64_neon_uaddv:
9121 case Intrinsic::aarch64_neon_sminv:
9123 case Intrinsic::aarch64_neon_uminv:
9125 case Intrinsic::aarch64_neon_smaxv:
9127 case Intrinsic::aarch64_neon_umaxv:
9129 case Intrinsic::aarch64_neon_fmax:
9132 case Intrinsic::aarch64_neon_fmin:
9135 case Intrinsic::aarch64_neon_fmaxnm:
9138 case Intrinsic::aarch64_neon_fminnm:
9141 case Intrinsic::aarch64_neon_smull:
9142 case Intrinsic::aarch64_neon_umull:
9143 case Intrinsic::aarch64_neon_pmull:
9144 case Intrinsic::aarch64_neon_sqdmull:
9146 case Intrinsic::aarch64_neon_sqshl:
9147 case Intrinsic::aarch64_neon_uqshl:
9148 case Intrinsic::aarch64_neon_sqshlu:
9149 case Intrinsic::aarch64_neon_srshl:
9150 case Intrinsic::aarch64_neon_urshl:
9152 case Intrinsic::aarch64_crc32b:
9153 case Intrinsic::aarch64_crc32cb:
9155 case Intrinsic::aarch64_crc32h:
9156 case Intrinsic::aarch64_crc32ch:
9173 if (IID == Intrinsic::aarch64_neon_sabd ||
9174 IID == Intrinsic::aarch64_neon_uabd) {
9242 assert(!(NumElements & 1) &&
"Splitting vector, but not in half!");
9261 SDValue SplatVal,
unsigned NumVecElts) {
9271 uint64_t BaseOffset = 0;
9279 if (BasePtr->getOpcode() ==
ISD::ADD &&
9280 isa<ConstantSDNode>(BasePtr->getOperand(1))) {
9281 BaseOffset = cast<ConstantSDNode>(BasePtr->getOperand(1))->getSExtValue();
9282 BasePtr = BasePtr->getOperand(0);
9285 unsigned Offset = EltOffset;
9286 while (--NumVecElts) {
9287 unsigned Alignment =
MinAlign(OrigAlignment, Offset);
9292 PtrInfo.getWithOffset(Offset), Alignment,
9294 Offset += EltOffset;
9321 if (!(((NumVecElts == 2 || NumVecElts == 3) &&
9323 ((NumVecElts == 2 || NumVecElts == 3 || NumVecElts == 4) &&
9340 if (Offset < -512 || Offset > 504)
9344 for (
int I = 0; I < NumVecElts; ++
I) {
9374 if (NumVecElts != 4 && NumVecElts != 2)
9380 std::bitset<4> IndexNotInserted((1 << NumVecElts) - 1);
9382 for (
unsigned I = 0; I < NumVecElts; ++
I) {
9398 if (IndexVal >= NumVecElts)
9400 IndexNotInserted.reset(IndexVal);
9405 if (IndexNotInserted.any())
9430 return ReplacedZeroSplat;
9461 return ReplacedSplat;
9494 unsigned LoadIdx = IsLaneOp ? 1 : 0;
9510 if (UI.getUse().getResNo() == 1)
9523 || UI.getUse().getResNo() != Addr.
getResNo())
9538 uint32_t IncVal = CInc->getZExtValue();
9540 if (IncVal != NumBytes)
9592 if (TLI.SimplifyDemandedBits(Addr, DemandedMask, Known, TLO)) {
9630 UI.getUse().getResNo() != Addr.
getResNo())
9639 bool IsStore =
false;
9640 bool IsLaneOp =
false;
9641 bool IsDupOp =
false;
9642 unsigned NewOpc = 0;
9643 unsigned NumVecs = 0;
9644 unsigned IntNo = cast<ConstantSDNode>(N->
getOperand(1))->getZExtValue();
9654 NumVecs = 2; IsStore =
true;
break;
9656 NumVecs = 3; IsStore =
true;
break;
9658 NumVecs = 4; IsStore =
true;
break;
9666 NumVecs = 2; IsStore =
true;
break;
9668 NumVecs = 3; IsStore =
true;
break;
9670 NumVecs = 4; IsStore =
true;
break;
9672 NumVecs = 2; IsDupOp =
true;
break;
9674 NumVecs = 3; IsDupOp =
true;
break;
9676 NumVecs = 4; IsDupOp =
true;
break;
9678 NumVecs = 2; IsLaneOp =
true;
break;
9680 NumVecs = 3; IsLaneOp =
true;
break;
9682 NumVecs = 4; IsLaneOp =
true;
break;
9684 NumVecs = 2; IsStore =
true; IsLaneOp =
true;
break;
9686 NumVecs = 3; IsStore =
true; IsLaneOp =
true;
break;
9688 NumVecs = 4; IsStore =
true; IsLaneOp =
true;
break;
9700 uint32_t IncVal = CInc->getZExtValue();
9702 if (IsLaneOp || IsDupOp)
9704 if (IncVal != NumBytes)
9711 if (IsLaneOp || IsStore)
9712 for (
unsigned i = 2; i < AddrOpIdx; ++i)
9719 unsigned NumResultVecs = (IsStore ? 0 : NumVecs);
9721 for (n = 0; n < NumResultVecs; ++n)
9733 std::vector<SDValue> NewResults;
9734 for (
unsigned i = 0; i < NumResultVecs; ++i) {
9735 NewResults.push_back(
SDValue(UpdN.getNode(), i));
9737 NewResults.push_back(
SDValue(UpdN.getNode(), NumResultVecs + 1));
9858 int MaxUInt = (1 << width);
9866 AddConstant -= (1 << (width-1));
9871 if ((AddConstant == 0) ||
9872 (CompConstant == MaxUInt - 1 && AddConstant < 0) ||
9873 (AddConstant >= 0 && CompConstant < 0) ||
9874 (AddConstant <= 0 && CompConstant <= 0 && CompConstant < AddConstant))
9879 if ((AddConstant == 0) ||
9880 (AddConstant >= 0 && CompConstant <= 0) ||
9881 (AddConstant <= 0 && CompConstant <= 0 && CompConstant <= AddConstant))
9886 if ((AddConstant >= 0 && CompConstant < 0) ||
9887 (AddConstant <= 0 && CompConstant >= -1 &&
9888 CompConstant < AddConstant + MaxUInt))
9893 if ((AddConstant == 0) ||
9894 (AddConstant > 0 && CompConstant <= 0) ||
9895 (AddConstant < 0 && CompConstant <= AddConstant))
9900 if ((AddConstant >= 0 && CompConstant <= 0) ||
9901 (AddConstant <= 0 && CompConstant >= 0 &&
9902 CompConstant <= AddConstant + MaxUInt))
9907 if ((AddConstant > 0 && CompConstant < 0) ||
9908 (AddConstant < 0 && CompConstant >= 0 &&
9909 CompConstant < AddConstant + MaxUInt) ||
9910 (AddConstant >= 0 && CompConstant >= 0 &&
9911 CompConstant >= AddConstant) ||
9912 (AddConstant <= 0 && CompConstant < 0 && CompConstant < AddConstant))
9931 unsigned CmpIndex) {
9932 unsigned CC = cast<ConstantSDNode>(N->
getOperand(CCIndex))->getSExtValue();
9934 unsigned CondOpcode = SubsNode->
getOpcode();
9943 unsigned MaskBits = 0;
9952 else if (CNV == 65535)
9973 if (!isa<ConstantSDNode>(AddInputValue2.
getNode()) ||
9974 !isa<ConstantSDNode>(SubsInputValue.
getNode()))
9985 cast<ConstantSDNode>(AddInputValue2.
getNode())->getSExtValue(),
9986 cast<ConstantSDNode>(SubsInputValue.
getNode())->getSExtValue()))
10012 assert(isa<ConstantSDNode>(CCVal) &&
"Expected a ConstantSDNode here!");
10013 unsigned CC = cast<ConstantSDNode>(CCVal)->getZExtValue();
10030 "Expected the value type to be the same for both operands!");
10098 (Bit - C->
getZExtValue()) < Op->getValueType(0).getSizeInBits()) {
10107 if (Bit >= Op->getValueType(0).getSizeInBits())
10108 Bit = Op->getValueType(0).getSizeInBits() - 1;
10113 if ((Bit + C->
getZExtValue()) < Op->getValueType(0).getSizeInBits()) {
10131 unsigned Bit = cast<ConstantSDNode>(N->
getOperand(2))->getZExtValue();
10132 bool Invert =
false;
10136 if (TestSrc == NewTestSrc)
10179 cast<CondCodeSDNode>(N0.
getOperand(2))->
get());
10201 "Scalar-SETCC feeding SELECT has unexpected result type!");
10214 if (!ResVT.
isVector() || NumMaskElts == 0)
10316 switch (cast<ConstantSDNode>(N->
getOperand(1))->getZExtValue()) {
10317 case Intrinsic::aarch64_neon_ld2:
10318 case Intrinsic::aarch64_neon_ld3:
10319 case Intrinsic::aarch64_neon_ld4:
10320 case Intrinsic::aarch64_neon_ld1x2:
10321 case Intrinsic::aarch64_neon_ld1x3:
10322 case Intrinsic::aarch64_neon_ld1x4:
10323 case Intrinsic::aarch64_neon_ld2lane:
10324 case Intrinsic::aarch64_neon_ld3lane:
10325 case Intrinsic::aarch64_neon_ld4lane:
10326 case Intrinsic::aarch64_neon_ld2r:
10327 case Intrinsic::aarch64_neon_ld3r:
10328 case Intrinsic::aarch64_neon_ld4r:
10329 case Intrinsic::aarch64_neon_st2:
10330 case Intrinsic::aarch64_neon_st3:
10331 case Intrinsic::aarch64_neon_st4:
10332 case Intrinsic::aarch64_neon_st1x2:
10333 case Intrinsic::aarch64_neon_st1x3:
10334 case Intrinsic::aarch64_neon_st1x4:
10335 case Intrinsic::aarch64_neon_st2lane:
10336 case Intrinsic::aarch64_neon_st3lane:
10337 case Intrinsic::aarch64_neon_st4lane:
10350 bool AArch64TargetLowering::isUsedByReturnOnly(
SDNode *N,
10369 bool HasRet =
false;
10387 bool AArch64TargetLowering::mayBeEmittedAsTailCall(
const CallInst *CI)
const {
10403 int64_t RHSC = RHS->getSExtValue();
10405 RHSC = -(uint64_t)RHSC;
10406 if (!isInt<9>(RHSC))
10415 bool AArch64TargetLowering::getPreIndexedAddressParts(
SDNode *N,
SDValue &Base,
10421 if (
LoadSDNode *LD = dyn_cast<LoadSDNode>(N)) {
10422 VT = LD->getMemoryVT();
10423 Ptr = LD->getBasePtr();
10425 VT =
ST->getMemoryVT();
10426 Ptr =
ST->getBasePtr();
10431 if (!getIndexedAddressParts(Ptr.
getNode(), Base,
Offset, AM, IsInc, DAG))
10437 bool AArch64TargetLowering::getPostIndexedAddressParts(
10442 if (
LoadSDNode *LD = dyn_cast<LoadSDNode>(N)) {
10443 VT = LD->getMemoryVT();
10444 Ptr = LD->getBasePtr();
10446 VT =
ST->getMemoryVT();
10447 Ptr =
ST->getBasePtr();
10452 if (!getIndexedAddressParts(Op, Base, Offset, AM, IsInc, DAG))
10482 unsigned AcrossOp) {
10499 return std::make_pair(Lo, Hi);
10506 "AtomicCmpSwap on types less than 128 should be legal");
10512 AArch64::CMP_SWAP_128,
SDLoc(N),
10517 MemOp[0] = cast<MemSDNode>(
N)->getMemOperand();
10518 cast<MachineSDNode>(CmpSwap)->setMemRefs(MemOp, MemOp + 1);
10525 void AArch64TargetLowering::ReplaceNodeResults(
10576 unsigned AArch64TargetLowering::combineRepeatedFPDivisors()
const {
10599 return Size == 128;
10625 if (Subtarget->
hasLSE())
return false;
10637 Type *ValTy = cast<PointerType>(Addr->
getType())->getElementType();
10645 IsAcquire ? Intrinsic::aarch64_ldaxp : Intrinsic::aarch64_ldxp;
10649 Value *LoHi = Builder.
CreateCall(Ldxr, Addr,
"lohi");
10661 IsAcquire ? Intrinsic::aarch64_ldaxr : Intrinsic::aarch64_ldxr;
10666 cast<PointerType>(Addr->
getType())->getElementType());
10676 Value *Val, Value *Addr,
10686 IsRelease ? Intrinsic::aarch64_stlxp : Intrinsic::aarch64_stxp;
10690 Value *Lo = Builder.
CreateTrunc(Val, Int64Ty,
"lo");
10697 IsRelease ? Intrinsic::aarch64_stlxr : Intrinsic::aarch64_stxr;
10707 bool AArch64TargetLowering::functionArgumentNeedsConsecutiveRegisters(
10712 bool AArch64TargetLowering::shouldNormalizeToSelectSequence(
LLVMContext &,
10788 if (AArch64::GPR64RegClass.
contains(*I))
10789 RC = &AArch64::GPR64RegClass;
10790 else if (AArch64::FPR64RegClass.
contains(*I))
10791 RC = &AArch64::FPR64RegClass;
10802 Attribute::NoUnwind) &&
10803 "Function should be nounwind in insertCopiesSplitCSR!");
10809 for (
auto *Exit : Exits)
10811 TII->
get(TargetOpcode::COPY), *
I)
MVT getSimpleValueType() const
Return the simple ValueType of the referenced return value.
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 bool isAdvSIMDModImmType6(uint64_t Imm)
static bool isVShiftLImm(SDValue Op, EVT VT, bool isLong, int64_t &Cnt)
isVShiftLImm - Check if this is a valid build_vector for the immediate operand of a vector shift left...
void setFrameAddressIsTaken(bool T)
bool parametersInCSRMatch(const MachineRegisterInfo &MRI, const uint32_t *CallerPreservedMask, const SmallVectorImpl< CCValAssign > &ArgLocs, const SmallVectorImpl< SDValue > &OutVals) const
Check whether parameters to a call that are passed in callee saved registers are the same as from the...
std::enable_if< std::numeric_limits< T >::is_signed, bool >::type getAsInteger(unsigned Radix, T &Result) const
Parse the current string as an integer of the specified radix.
BITCAST - This operator converts between integer, vector and FP values, as if the value was stored to...
constexpr bool isUInt< 32 >(uint64_t x)
X = FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating point type down to the precision of the ...
Value * getValueOperand()
Helper structure to keep track of SetCC information.
static MVT getIntegerVT(unsigned BitWidth)
static bool isUZP_v_undef_Mask(ArrayRef< int > M, EVT VT, unsigned &WhichResult)
isUZP_v_undef_Mask - Special case of isUZPMask for canonical form of "vector_shuffle v...
void AnalyzeCallResult(const SmallVectorImpl< ISD::InputArg > &Ins, CCAssignFn Fn)
AnalyzeCallResult - Analyze the return values of a call, incorporating info about the passed values i...
void push_back(const T &Elt)
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
A parsed version of the target data layout string in and methods for querying it. ...
Type * getIndexedType() const
FMINNUM/FMAXNUM - Perform floating-point minimum or maximum on two values.
static SDValue performBitcastCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, SelectionDAG &DAG)
SDValue getValue(unsigned R) const
This represents an addressing mode of: BaseGV + BaseOffs + BaseReg + Scale*ScaleReg If BaseGV is null...
MO_G3 - A symbol operand with this flag (granule 3) represents the high 16-bits of a 64-bit address...
Value * CreateConstGEP1_32(Value *Ptr, unsigned Idx0, const Twine &Name="")
static SDValue LowerADDC_ADDE_SUBC_SUBE(SDValue Op, SelectionDAG &DAG)
void setLoadExtAction(unsigned ExtType, MVT ValVT, MVT MemVT, LegalizeAction Action)
Indicate that the specified load with extension does not work with the specified type and indicate wh...
iterator_range< use_iterator > uses()
static bool isConstant(const MachineInstr &MI)
bool isTargetAndroid() const
bool requiresStrictAlign() const
This SDNode is used for target intrinsics that touch memory and need an associated MachineMemOperand...
const MCPhysReg * getScratchRegisters(CallingConv::ID CC) const override
Returns a 0 terminated array of registers that can be safely used as scratch registers.
virtual ConstraintType getConstraintType(StringRef Constraint) const
Given a constraint, return the type of constraint it is for this target.
AArch64FunctionInfo - This class is derived from MachineFunctionInfo and contains private AArch64-spe...
Flags getFlags() const
Return the raw flags of the source value,.
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
LLVMContext * getContext() const
static uint8_t encodeAdvSIMDModImmType3(uint64_t Imm)
This class represents an incoming formal argument to a Function.
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
uint64_t getZExtValue() const
Get zero extended value.
DiagnosticInfoOptimizationBase::Argument NV
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...
void setVarArgsGPRSize(unsigned Size)
unsigned getVarArgsFPRSize() const
SDValue CombineTo(SDNode *N, ArrayRef< SDValue > To, bool AddTo=true)
SDValue getCALLSEQ_END(SDValue Chain, SDValue Op1, SDValue Op2, SDValue InGlue, const SDLoc &DL)
Return a new CALLSEQ_END node, which always must have a glue result (to ensure it's not CSE'd)...
static SDValue performVSelectCombine(SDNode *N, SelectionDAG &DAG)
static SDValue performNEONPostLDSTCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, SelectionDAG &DAG)
Target-specific DAG combine function for NEON load/store intrinsics to merge base address updates...
int getVarArgsStackIndex() const
STATISTIC(NumFunctions,"Total number of functions")
EXTRACT_SUBVECTOR(VECTOR, IDX) - Returns a subvector from VECTOR (an vector value) starting with the ...
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
BR_CC - Conditional branch.
LocInfo getLocInfo() const
static bool isUZPMask(ArrayRef< int > M, EVT VT, unsigned &WhichResult)
MO_PAGE - A symbol operand with this flag represents the pc-relative offset of the 4K page containing...
static bool isTRN_v_undef_Mask(ArrayRef< int > M, EVT VT, unsigned &WhichResult)
isTRN_v_undef_Mask - Special case of isTRNMask for canonical form of "vector_shuffle v...
CCAssignFn * CCAssignFnForReturn(CallingConv::ID CC) const
Selects the correct CCAssignFn for a given CallingConvention value.
static MVT getVectorVT(MVT VT, unsigned NumElements)
bool hasOneUse() const
Return true if there is exactly one use of this node.
bool hasNUsesOfValue(unsigned NUses, unsigned Value) const
Return true if there are exactly NUSES uses of the indicated value.
VECTOR_SHUFFLE(VEC1, VEC2) - Returns a vector, of the same type as VEC1/VEC2.
A Module instance is used to store all the information related to an LLVM module. ...
bool hasOneUse() const
Return true if there is exactly one node using value ResNo of Node.
static SDValue tryCombineToEXTR(SDNode *N, TargetLowering::DAGCombinerInfo &DCI)
EXTR instruction extracts a contiguous chunk of bits from two existing registers viewed as a high/low...
static bool isAdvSIMDModImmType12(uint64_t Imm)
const TargetMachine & getTargetMachine() const
an instruction that atomically checks whether a specified value is in a memory location, and, if it is, stores a new value there.
static bool isAdvSIMDModImmType4(uint64_t Imm)
unsigned createVirtualRegister(const TargetRegisterClass *RegClass)
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
static SDValue performXorCombine(SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const AArch64Subtarget *Subtarget)
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with tries to cleanse the provided crash input to make it contain fewer original bytes Use with exact_artifact_path to specify the output Experimental Use value profile to guide fuzzing Number of jobs to run If min(jobs, NumberOfCpuCores()/2)\" is used.") FUZZER_FLAG_INT(reload
static uint8_t encodeAdvSIMDModImmType1(uint64_t Imm)
bool isCalledByLegalizer() const
static bool isConjunctionDisjunctionTree(const SDValue Val, bool &CanNegate, unsigned Depth=0)
Returns true if Val is a tree of AND/OR/SETCC operations.
bool allowsMisalignedMemoryAccesses(EVT VT, unsigned AddrSpace=0, unsigned Align=1, bool *Fast=nullptr) const override
Returns true if the target allows unaligned memory accesses of the specified type.
const uint32_t * getTLSCallPreservedMask() const
int getSplatIndex() const
Carry-setting nodes for multiple precision addition and subtraction.
const TargetMachine & getTarget() const
static bool isINSMask(ArrayRef< int > M, int NumInputElements, bool &DstIsLeft, int &Anomaly)
static bool isAddSubZExt(SDNode *N, SelectionDAG &DAG)
TargetLoweringBase::LegalizeTypeAction getPreferredVectorAction(EVT VT) const override
Return the preferred vector type legalization action.
unsigned addLiveIn(unsigned PReg, const TargetRegisterClass *RC)
addLiveIn - Add the specified physical register as a live-in value and create a corresponding virtual...
static CondCode getInvertedCondCode(CondCode Code)
void setVarArgsStackIndex(int Index)
bool isIntDivCheap(EVT VT, AttributeList Attr) const override
Return true if integer divide is usually cheaper than a sequence of several shifts, adds, and multiplies for this target.
bool isNonNegative() const
Determine if this APInt Value is non-negative (>= 0)
static bool isZIP_v_undef_Mask(ArrayRef< int > M, EVT VT, unsigned &WhichResult)
isZIP_v_undef_Mask - Special case of isZIPMask for canonical form of "vector_shuffle v...
void transferSuccessorsAndUpdatePHIs(MachineBasicBlock *FromMBB)
Transfers all the successors, as in transferSuccessors, and update PHI operands in the successor bloc...
STACKRESTORE has two operands, an input chain and a pointer to restore to it returns an output chain...
This class represents a function call, abstracting a target machine's calling convention.
std::pair< EVT, EVT > GetSplitDestVTs(const EVT &VT) const
Compute the VTs needed for the low/hi parts of a type which is split (or expanded) into two not neces...
static APInt getLowBitsSet(unsigned numBits, unsigned loBitsSet)
Get a value with low bits set.
const GlobalValue * getGlobal() const
Libcall
RTLIB::Libcall enum - This enum defines all of the runtime library calls the backend can emit...
static SDValue splitStores(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, SelectionDAG &DAG, const AArch64Subtarget *Subtarget)
bool CCAssignFn(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
CCAssignFn - This function assigns a location for Val, updating State to reflect the change...
LLVM_NODISCARD bool equals_lower(StringRef RHS) const
equals_lower - Check for string equality, ignoring case.
static MVT getFloatingPointVT(unsigned BitWidth)
RESULT, BOOL = [SU]ADDO(LHS, RHS) - Overflow-aware nodes for addition.
int getScalingFactorCost(const DataLayout &DL, const AddrMode &AM, Type *Ty, unsigned AS) const override
Return the cost of the scaling factor used in the addressing mode represented by AM for this target...
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
std::pair< Value *, Value * > ShuffleOps
We are building a shuffle to create V, which is a sequence of insertelement, extractelement pairs...
Function Alias Analysis Results
Type * getTypeForEVT(LLVMContext &Context) const
This method returns an LLVM type corresponding to the specified EVT.
unsigned getSizeInBits() const
This instruction constructs a fixed permutation of two input vectors.
static SDValue performSelectCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI)
A vector select: "(select vL, vR, (setcc LHS, RHS))" is best performed with the compare-mask instruct...
void setVarArgsFPRIndex(int Index)
unsigned getByValSize() const
static SDValue performVectorCompareAndMaskUnaryOpCombine(SDNode *N, SelectionDAG &DAG)
unsigned getNumOperands() const
Return the number of values used by this operation.
void setBooleanVectorContents(BooleanContent Ty)
Specify how the target extends the result of a vector boolean value from a vector of i1 to a wider ty...
const Function * getParent() const
Return the enclosing method, or null if none.
unsigned getNumOperands() const
unsigned getValueSizeInBits() const
Returns the size of the value in bits.
static SDValue LowerPREFETCH(SDValue Op, SelectionDAG &DAG)
const SDValue & getOperand(unsigned Num) const
MO_G0 - A symbol operand with this flag (granule 0) represents the bits 0-15 of a 64-bit address...
const Function * getFunction() const
getFunction - Return the LLVM function that this machine code represents
const APInt & getUniqueInteger() const
If C is a constant integer then return its value, otherwise C must be a vector of constant integers...
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...
static SDValue performExtendCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, SelectionDAG &DAG)
static SDValue NormalizeBuildVector(SDValue Op, SelectionDAG &DAG)
uint64_t alignTo(uint64_t Value, uint64_t Align, uint64_t Skew=0)
Returns the next integer (mod 2**64) that is greater than or equal to Value and is a multiple of Alig...
An instruction for reading from memory.
static SDValue emitComparison(SDValue LHS, SDValue RHS, ISD::CondCode CC, const SDLoc &dl, SelectionDAG &DAG)
static unsigned getDUPLANEOp(EVT EltType)
bool isLegalInterleavedAccessType(VectorType *VecTy, const DataLayout &DL) const
Returns true if VecTy is a legal interleaved access type.
static IntegerType * getInt64Ty(LLVMContext &C)
static bool isAdvSIMDModImmType3(uint64_t Imm)
[US]{MIN/MAX} - Binary minimum or maximum or signed or unsigned integers.
an instruction that atomically reads a memory location, combines it with another value, and then stores the result back.
SDValue getTargetExternalSymbol(const char *Sym, EVT VT, unsigned char TargetFlags=0)
SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
static SDValue LowerVectorINT_TO_FP(SDValue Op, SelectionDAG &DAG)
static SDValue performSetccAddFolding(SDNode *Op, SelectionDAG &DAG)
bool CheckReturn(const SmallVectorImpl< ISD::OutputArg > &ArgsFlags, CCAssignFn Fn)
CheckReturn - Analyze the return values of a function, returning true if the return can be performed ...
This defines the Use class.
AtomicExpansionKind
Enum that specifies what an atomic load/AtomicRMWInst is expanded to, if at all.
Type * getElementType() const
static SDValue EmitVectorComparison(SDValue LHS, SDValue RHS, AArch64CC::CondCode CC, bool NoNans, EVT VT, const SDLoc &dl, SelectionDAG &DAG)
static SDValue tryCombineFixedPointConvert(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, SelectionDAG &DAG)
const SDValue & getBasePtr() const
bool lowerInterleavedLoad(LoadInst *LI, ArrayRef< ShuffleVectorInst * > Shuffles, ArrayRef< unsigned > Indices, unsigned Factor) const override
Lower an interleaved load into a ldN intrinsic.
INSERT_SUBVECTOR(VECTOR1, VECTOR2, IDX) - Returns a vector with VECTOR2 inserted into VECTOR1 at the ...
APInt zextOrTrunc(unsigned width) const
Zero extend or truncate to width.
std::size_t countLeadingZeros(T Val, ZeroBehavior ZB=ZB_Width)
Count number of 0's from the most significant bit to the least stopping at the first 1...
void setVarArgsFPRSize(unsigned Size)
static bool isZeroExtended(SDNode *N, SelectionDAG &DAG)
static std::pair< SDValue, SDValue > getAArch64XALUOOp(AArch64CC::CondCode &CC, SDValue Op, SelectionDAG &DAG)
static SDValue GeneratePerfectShuffle(unsigned PFEntry, SDValue LHS, SDValue RHS, SelectionDAG &DAG, const SDLoc &dl)
GeneratePerfectShuffle - Given an entry in the perfect-shuffle table, emit the specified operations t...
Select with condition operator - This selects between a true value and a false value (ops #2 and #3) ...
unsigned getResNo() const
get the index which selects a specific result in the SDNode
Libcall getFPROUND(EVT OpVT, EVT RetVT)
getFPROUND - Return the FPROUND_*_* value for the given types, or UNKNOWN_LIBCALL if there is none...
bool bitsLT(EVT VT) const
Return true if this has less bits than VT.
bool isUnsignedIntSetCC(CondCode Code)
Return true if this is a setcc instruction that performs an unsigned comparison when used with intege...
bool isUndef() const
Return true if the type of the node type undefined.
static SDValue performIntegerAbsCombine(SDNode *N, SelectionDAG &DAG)
bool optForMinSize() const
Optimize this function for minimum size (-Oz).
This SDNode is used to implement the code generator support for the llvm IR shufflevector instruction...
return AArch64::GPR64RegClass contains(Reg)
SDValue getExternalSymbol(const char *Sym, EVT VT)
bool isAllOnesValue() const
CallingConv::ID getCallingConv() const
getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this functio...
bool isOSWindows() const
Tests whether the OS is Windows.
void setTruncStoreAction(MVT ValVT, MVT MemVT, LegalizeAction Action)
Indicate that the specified truncating store does not work with the specified type and indicate what ...
RESULT,OUTCHAIN = INTRINSIC_W_CHAIN(INCHAIN, INTRINSICID, arg1, ...) This node represents a target in...
A convenience struct that encapsulates a DAG, and two SDValues for returning information from TargetL...
Libcall getUINTTOFP(EVT OpVT, EVT RetVT)
getUINTTOFP - Return the UINTTOFP_*_* value for the given types, or UNKNOWN_LIBCALL if there is none...
AttributeList getAttributes() const
Return the attribute list for this Function.
const Triple & getTargetTriple() const
MO_G2 - A symbol operand with this flag (granule 2) represents the bits 32-47 of a 64-bit address...
SDIVREM/UDIVREM - Divide two integers and produce both a quotient and remainder result.
SHL_PARTS/SRA_PARTS/SRL_PARTS - These operators are used for expanded integer shift operations...
bool isVector() const
Return true if this is a vector value type.
SDValue getIntPtrConstant(uint64_t Val, const SDLoc &DL, bool isTarget=false)
static bool isAdvSIMDModImmType7(uint64_t Imm)
static SDValue tryFormConcatFromShuffle(SDValue Op, SelectionDAG &DAG)
static bool isTRNMask(ArrayRef< int > M, EVT VT, unsigned &WhichResult)
cl::opt< bool > EnableAArch64ELFLocalDynamicTLSGeneration("aarch64-elf-ldtls-generation", cl::Hidden, cl::desc("Allow AArch64 Local Dynamic TLS code generation"), cl::init(false))
A description of a memory reference used in the backend.
static SDValue performTBZCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, SelectionDAG &DAG)
static SDValue performCONDCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, SelectionDAG &DAG, unsigned CCIndex, unsigned CmpIndex)
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
const HexagonInstrInfo * TII
static SDValue tryCombineCRC32(unsigned Mask, SDNode *N, SelectionDAG &DAG)
static Value * UseTlsOffset(IRBuilder<> &IRB, unsigned Offset)
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
unsigned getMaximumJumpTableSize() const
Shift and rotation operations.
static SDValue performAddSubLongCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, SelectionDAG &DAG)
Class to represent struct types.
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
ABS - Determine the unsigned absolute value of a signed integer value of the same bitwidth...
A Use represents the edge between a Value definition and its users.
bool isX18Reserved() const
static SDValue performFpToIntCombine(SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const AArch64Subtarget *Subtarget)
Fold a floating-point multiply by power of two into floating-point to fixed-point conversion...
SDValue getTargetExtractSubreg(int SRIdx, const SDLoc &DL, EVT VT, SDValue Operand)
A convenience function for creating TargetInstrInfo::EXTRACT_SUBREG nodes.
MachineFunction & getMachineFunction() const
MachineSDNode * getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT)
These are used for target selectors to create a new node with specified return type(s), MachineInstr opcode, and operands.
static uint8_t encodeAdvSIMDModImmType6(uint64_t Imm)
unsigned getNumArgOperands() const
Return the number of call arguments.
void eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
CopyToReg - This node has three operands: a chain, a register number to set to this value...
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
LLVM_ATTRIBUTE_ALWAYS_INLINE R Default(const T &Value) const
EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Context, EVT VT) const override
Return the ISD::SETCC ValueType.
bool Eq(const uint8_t *Data, size_t Size, const char *Str)
Helper structure to keep track of a SET_CC lowered into AArch64 code.
Reg
All possible values of the reg field in the ModR/M byte.
This file contains the simple types necessary to represent the attributes associated with functions a...
ARMProcFamilyEnum getProcFamily() const
Returns ARM processor family.
MVT getScalarType() const
If this is a vector, return the element type, otherwise return this.
The memory access is dereferenceable (i.e., doesn't trap).
static SDValue LowerMUL(SDValue Op, SelectionDAG &DAG)
EVT getScalarType() const
If this is a vector type, return the element type, otherwise return this.
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
static bool isLogicalImmediate(uint64_t imm, unsigned regSize)
isLogicalImmediate - Return true if the immediate is valid for a logical immediate instruction of the...
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...
static SDValue combineAcrossLanesIntrinsic(unsigned Opc, SDNode *N, SelectionDAG &DAG)
SDVTList getVTList(EVT VT)
Return an SDVTList that represents the list of values specified.
This class is used to represent EVT's, which are used to parameterize some operations.
static SDValue foldVectorXorShiftIntoCmp(SDNode *N, SelectionDAG &DAG, const AArch64Subtarget *Subtarget)
Turn vector tests of the signbit in the form of: xor (sra X, elt_size(X)-1), -1 into: cmge X...
FRAMEADDR, RETURNADDR - These nodes represent llvm.frameaddress and llvm.returnaddress on the DAG...
Type * getVectorElementType() const
static bool isAdvSIMDModImmType5(uint64_t Imm)
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
bool isInteger() const
Return true if this is an integer or a vector integer type.
This file implements a class to represent arbitrary precision integral constant values and operations...
This represents a list of ValueType's that has been intern'd by a SelectionDAG.
SDValue getExtLoad(ISD::LoadExtType ExtType, const SDLoc &dl, EVT VT, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, EVT MemVT, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
LLVM_NODISCARD bool empty() const
AtomicOrdering
Atomic ordering for LLVM's memory model.
STACKSAVE - STACKSAVE has one operand, an input chain.
SDValue getMergeValues(ArrayRef< SDValue > Ops, const SDLoc &dl)
Create a MERGE_VALUES node from the given operands.
EVT getVectorElementType() const
Given a vector type, return the type of each element.
Value * getSafeStackPointerLocation(IRBuilder<> &IRB) const override
If the target has a standard location for the unsafe stack pointer, returns the address of that locat...
unsigned getPointerAddressSpace() const
Returns the address space of the pointer operand.
SDValue ReconstructShuffle(SDValue Op, SelectionDAG &DAG) const
virtual Value * getIRStackGuard(IRBuilder<> &IRB) const
If the target has a standard location for the stack protector guard, returns the address of that loca...
bool isConstantSplat(APInt &SplatValue, APInt &SplatUndef, unsigned &SplatBitSize, bool &HasAnyUndefs, unsigned MinSplatBits=0, bool isBigEndian=false) const
Check if this is a constant splat, and if so, find the smallest element size that splats the vector...
static const unsigned PerfectShuffleTable[6561+1]
Value * CreateIntToPtr(Value *V, Type *DestTy, const Twine &Name="")
bool isInConsecutiveRegs() 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...
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Case(const char(&S)[N], const T &Value)
unsigned getLocReg() const
void setArgumentStackToRestore(unsigned bytes)
This is a fast-path instruction selection class that generates poor code and doesn't support illegal ...
Value * CreateBitCast(Value *V, Type *DestTy, const Twine &Name="")
Constant * createSequentialMask(IRBuilder<> &Builder, unsigned Start, unsigned NumInts, unsigned NumUndefs)
Create a sequential shuffle mask.
unsigned NoNaNsFPMath
NoNaNsFPMath - This flag is enabled when the -enable-no-nans-fp-math flag is specified on the command...
static SDValue performConcatVectorsCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, SelectionDAG &DAG)
[SU]INT_TO_FP - These operators convert integers (whose interpreted sign depends on the first letter)...
void computeRegisterProperties(const TargetRegisterInfo *TRI)
Once all of the register classes are added, this allows us to compute derived properties we expose...
static bool isEXTMask(ArrayRef< int > M, EVT VT, bool &ReverseEXT, unsigned &Imm)
void emitAtomicCmpXchgNoStoreLLBalance(IRBuilder<> &Builder) const override
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
static bool checkValueWidth(SDValue V, unsigned width, ISD::LoadExtType &ExtType)
std::pair< SDValue, SDValue > LowerCallTo(CallLoweringInfo &CLI) const
This function lowers an abstract call to a function into an actual call.
bool isTargetFuchsia() const
Value * concatenateVectors(IRBuilder<> &Builder, ArrayRef< Value * > Vecs)
Concatenate a list of vectors.
unsigned getNumValues() const
Return the number of values defined/returned by this operator.
MO_GOT - This flag indicates that a symbol operand represents the address of the GOT entry for the sy...
virtual Value * getSafeStackPointerLocation(IRBuilder<> &IRB) const
Returns the target-specific address of the unsafe stack pointer.
SDValue getRegisterMask(const uint32_t *RegMask)
constexpr bool isMask_64(uint64_t Value)
Return true if the argument is a non-empty sequence of ones starting at the least significant bit wit...
const AArch64RegisterInfo * getRegisterInfo() const override
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)...
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef slice(size_t Start, size_t End) const
Return a reference to the substring from [Start, End).
bool isFloatingPointTy() const
Return true if this is one of the six floating-point types.
Function * getDeclaration(Module *M, ID id, ArrayRef< Type * > Tys=None)
Create or insert an LLVM Function declaration for an intrinsic, and return it.
const SDValue & getBasePtr() const
static bool isAdvSIMDModImmType2(uint64_t Imm)
SDValue getUNDEF(EVT VT)
Return an UNDEF node. UNDEF does not have a useful SDLoc.
An instruction for storing to memory.
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out...
const APInt & getAPIntValue() const
static Error getOffset(const SymbolRef &Sym, SectionRef Sec, uint64_t &Result)
bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM, Type *Ty, unsigned AS) const override
Return true if the addressing mode represented by AM is legal for this target, for a load/store of th...
EVT getValueType(const DataLayout &DL, Type *Ty, bool AllowUnknown=false) const
Return the EVT corresponding to this LLVM type.
bool isArrayTy() const
True if this is an instance of ArrayType.
TargetConstant* - Like Constant*, but the DAG does not do any folding, simplification, or lowering of the constant.
EVT getMemoryVT() const
Return the type of the in-memory value.
CodeGenOpt::Level getOptLevel() const
Returns the optimization level: None, Less, Default, or Aggressive.
Value * CreateZExt(Value *V, Type *DestTy, const Twine &Name="")
SDValue getTargetConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isOpaque=false)
READCYCLECOUNTER - This corresponds to the readcyclecounter intrinsic.
unsigned getBitWidth() const
Get the bit width of this value.
bool isFPImmLegal(const APFloat &Imm, EVT VT) const override
Returns true if the target can instruction select the specified FP immediate natively.
TargetLoweringBase::AtomicExpansionKind shouldExpandAtomicLoadInIR(LoadInst *LI) const override
Returns how the given (atomic) load should be expanded by the IR-level AtomicExpand pass...
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
static SDValue getReductionSDNode(unsigned Op, SDLoc DL, SDValue ScalarOp, SelectionDAG &DAG)
static SDValue LowerVectorFP_TO_INT(SDValue Op, SelectionDAG &DAG)
static const MCPhysReg GPRArgRegs[]
FastISel * createFastISel(FunctionLoweringInfo &funcInfo, const TargetLibraryInfo *libInfo)
Value * CreateZExtOrBitCast(Value *V, Type *DestTy, const Twine &Name="")
RESULT = INTRINSIC_WO_CHAIN(INTRINSICID, arg1, arg2, ...) This node represents a target intrinsic fun...
Type * getElementType() const
size_t size() const
size - Get the array size.
MachineBasicBlock * CreateMachineBasicBlock(const BasicBlock *bb=nullptr)
CreateMachineBasicBlock - Allocate a new MachineBasicBlock.
const DataLayout & getDataLayout() const
void initializeSplitCSR(MachineBasicBlock *Entry) const override
Perform necessary initialization to handle a subset of CSRs explicitly via copies.
static SDValue WidenVector(SDValue V64Reg, SelectionDAG &DAG)
WidenVector - Given a value in the V64 register class, produce the equivalent value in the V128 regis...
static MachinePointerInfo getStack(MachineFunction &MF, int64_t Offset)
Stack pointer relative access.
static bool isREVMask(ArrayRef< int > M, EVT VT, unsigned BlockSize)
isREVMask - Check if a vector shuffle corresponds to a REV instruction with the specified blocksize...
static SDValue tryExtendDUPToExtractHigh(SDValue N, SelectionDAG &DAG)
Class to represent pointers.
const BasicBlock * getBasicBlock() const
Return the LLVM basic block that this instance corresponded to originally.
const uint32_t * getCallPreservedMask(const MachineFunction &MF, CallingConv::ID) const override
static bool isEssentiallyExtractSubvector(SDValue N)
This class is used to represent ISD::STORE nodes.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
FP_TO_[US]INT - Convert a floating point value to a signed or unsigned integer.
static SDValue performBRCONDCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, SelectionDAG &DAG)
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
Flag
These should be considered private to the implementation of the MCInstrDesc class.
BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a vector with the specified, possibly variable...
Value * CreateOr(Value *LHS, Value *RHS, const Twine &Name="")
TargetInstrInfo - Interface to description of machine instruction set.
bool isOneConstant(SDValue V)
Returns true if V is a constant integer one.
static APInt getHighBitsSet(unsigned numBits, unsigned hiBitsSet)
Get a value with high bits set.
bool isLegalICmpImmediate(int64_t) const override
Return true if the specified immediate is legal icmp immediate, that is the target has icmp instructi...
static bool isAdvSIMDModImmType9(uint64_t Imm)
void softenSetCCOperands(SelectionDAG &DAG, EVT VT, SDValue &NewLHS, SDValue &NewRHS, ISD::CondCode &CCCode, const SDLoc &DL) const
Soften the operands of a comparison.
bool isSized(SmallPtrSetImpl< Type * > *Visited=nullptr) const
Return true if it makes sense to take the size of this type.
SDNode * getNode() const
get the SDNode which holds the desired result
bool isTruncateFree(Type *Ty1, Type *Ty2) const override
Return true if it's free to truncate a value of type FromTy to type ToTy.
constexpr uint64_t MinAlign(uint64_t A, uint64_t B)
A and B are either alignments or offsets.
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
static SDValue tryCombineToBSL(SDNode *N, TargetLowering::DAGCombinerInfo &DCI)
unsigned getScalarSizeInBits() const
unsigned getStoreSize() const
Return the number of bytes overwritten by a store of the specified value type.
bool isTypeLegal(EVT VT) const
Return true if the target has native support for the specified value type.
A switch()-like statement whose cases are string literals.
Type * getParamType(unsigned i) const
Parameter type accessors.
unsigned getFirstUnallocated(ArrayRef< MCPhysReg > Regs) const
getFirstUnallocated - Return the index of the first unallocated register in the set, or Regs.size() if they are all allocated.
bool hasAttribute(unsigned Index, Attribute::AttrKind Kind) const
Return true if the attribute exists at the given index.
initializer< Ty > init(const Ty &Val)
bool isNormalLoad(const SDNode *N)
Returns true if the specified node is a non-extending and unindexed load.
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...
void addLiveIn(MCPhysReg PhysReg, LaneBitmask LaneMask=LaneBitmask::getAll())
Adds the specified register as a live in.
unsigned UnsafeFPMath
UnsafeFPMath - This flag is enabled when the -enable-unsafe-fp-math flag is specified on the command ...
bool shouldExpandAtomicCmpXchgInIR(AtomicCmpXchgInst *AI) const override
Returns true if the given atomic cmpxchg should be expanded by the IR-level AtomicExpand pass into a ...
FPOpFusion::FPOpFusionMode AllowFPOpFusion
AllowFPOpFusion - This flag is set by the -fuse-fp-ops=xxx option.
Control flow instructions. These all have token chains.
MO_G1 - A symbol operand with this flag (granule 1) represents the bits 16-31 of a 64-bit address...
unsigned const MachineRegisterInfo * MRI
bool isZero() const
Return true if the value is positive or negative zero.
std::size_t countTrailingZeros(T Val, ZeroBehavior ZB=ZB_Width)
Count number of 0's from the least significant bit to the most stopping at the first 1...
static int getFP32Imm(const APInt &Imm)
getFP32Imm - Return an 8-bit floating-point version of the 32-bit floating-point value.
unsigned char classifyGlobalFunctionReference(const GlobalValue *GV, const TargetMachine &TM) const
unsigned getVectorNumElements() const
bool isZExtFree(Type *Ty1, Type *Ty2) const override
Return true if any actual instruction that defines a value of type FromTy implicitly zero-extends the...
CodeModel::Model getCodeModel() const
Returns the code model.
LLVM Basic Block Representation.
const SDValue & getOperand(unsigned i) const
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important class for using LLVM in a threaded context.
FunctionType * getFunctionType() const
Returns the FunctionType for me.
void addRegisterClass(MVT VT, const TargetRegisterClass *RC)
Add the specified register class as an available regclass for the specified value type...
Simple binary floating point operators.
void setTargetDAGCombine(ISD::NodeType NT)
Targets should invoke this method for each target independent node that they want to provide a custom...
bool isVectorTy() const
True if this is an instance of VectorType.
SDValue getMemIntrinsicNode(unsigned Opcode, const SDLoc &dl, SDVTList VTList, ArrayRef< SDValue > Ops, EVT MemVT, MachinePointerInfo PtrInfo, unsigned Align=0, bool Vol=false, bool ReadMem=true, bool WriteMem=true, unsigned Size=0)
Creates a MemIntrinsicNode that may produce a result and takes a list of operands.
bool isOperationLegalOrCustom(unsigned Op, EVT VT) const
Return true if the specified operation is legal on this target or can be made legal with custom lower...
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
void incNumLocalDynamicTLSAccesses()
VAEND, VASTART - VAEND and VASTART have three operands: an input chain, pointer, and a SRCVALUE...
bool isVector() const
Return true if this is a vector value type.
const SDNodeFlags getFlags() const
LoadExtType
LoadExtType enum - This enum defines the three variants of LOADEXT (load with extension).
int64_t getSExtValue() const
Get sign extended value.
INSERT_VECTOR_ELT(VECTOR, VAL, IDX) - Returns VECTOR with the element at IDX replaced with VAL...
const Constant * getConstVal() const
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
const MachineOperand & getOperand(unsigned i) const
static const MVT MVT_CC
Value type used for condition codes.
bool isBeforeLegalizeOps() const
Carry-using nodes for multiple precision addition and subtraction.
static SDValue tryCombineLongOpWithDup(unsigned IID, SDNode *N, TargetLowering::DAGCombinerInfo &DCI, SelectionDAG &DAG)
SDValue getCALLSEQ_START(SDValue Chain, uint64_t InSize, uint64_t OutSize, const SDLoc &DL)
Return a new CALLSEQ_START node, that starts new call frame, in which InSize bytes are set up inside ...
bool isTargetMachO() const
bool isLittleEndian() const
void setBooleanContents(BooleanContent Ty)
Specify how the target extends the result of integer and floating point boolean values from i1 to a w...
SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override
This method will be invoked for all target nodes and for any target-independent nodes that the target...
std::pair< SDValue, SDValue > SplitVectorOperand(const SDNode *N, unsigned OpNo)
Split the node's operand with EXTRACT_SUBVECTOR and return the low/high part.
Libcall getFPTOSINT(EVT OpVT, EVT RetVT)
getFPTOSINT - Return the FPTOSINT_*_* value for the given types, or UNKNOWN_LIBCALL if there is none...
static bool isSetCCOrZExtSetCC(const SDValue &Op, SetCCInfoAndKind &Info)
static EVT getExtensionTo64Bits(const EVT &OrigVT)
static std::pair< SDValue, SDValue > splitInt128(SDValue N, SelectionDAG &DAG)
static bool isAdvSIMDModImmType1(uint64_t Imm)
static mvt_range fp_valuetypes()
static void ReplaceReductionResults(SDNode *N, SmallVectorImpl< SDValue > &Results, SelectionDAG &DAG, unsigned InterOp, unsigned AcrossOp)
MachineBasicBlock * EmitF128CSEL(MachineInstr &MI, MachineBasicBlock *BB) const
virtual std::pair< unsigned, const TargetRegisterClass * > getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI, StringRef Constraint, MVT VT) const
Given a physical register constraint (e.g.
bool isDesirableToCommuteWithShift(const SDNode *N) const override
Returns false if N is a bit extraction pattern of (X >> C) & Mask.
constexpr bool isPowerOf2_64(uint64_t Value)
Return true if the argument is a power of two > 0 (64 bit edition.)
This file declares a class to represent arbitrary precision floating point values and provide a varie...
This class provides iterator support for SDUse operands that use a specific SDNode.
bool shouldConvertConstantLoadToIntImm(const APInt &Imm, Type *Ty) const override
Returns true if it is beneficial to convert a load of a constant to just the constant itself...
static SDValue emitConjunctionDisjunctionTree(SelectionDAG &DAG, SDValue Val, AArch64CC::CondCode &OutCC)
Emit conjunction or disjunction tree with the CMP/FCMP followed by a chain of CCMP/CFCMP ops...
APInt ashr(unsigned ShiftAmt) const
Arithmetic right-shift function.
unsigned getBytesInStackArgArea() const
bool isBeforeLegalize() const
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
static void ReplaceCMP_SWAP_128Results(SDNode *N, SmallVectorImpl< SDValue > &Results, SelectionDAG &DAG)
static bool mayTailCallThisCC(CallingConv::ID CC)
Return true if we might ever do TCO for calls with this calling convention.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
bool CombineTo(SDValue O, SDValue N)
unsigned getOpcode() const
uint64_t getNumElements() const
TRAP - Trapping instruction.
unsigned GuaranteedTailCallOpt
GuaranteedTailCallOpt - This flag is enabled when -tailcallopt is specified on the commandline...
Value * getOperand(unsigned i) const
Value * getPointerOperand()
static bool isAdvSIMDModImmType8(uint64_t Imm)
AssertSext, AssertZext - These nodes record if a register contains a value that has already been zero...
void setPrefFunctionAlignment(unsigned Align)
Set the target's preferred function alignment.
static bool resultsCompatible(CallingConv::ID CalleeCC, CallingConv::ID CallerCC, MachineFunction &MF, LLVMContext &C, const SmallVectorImpl< ISD::InputArg > &Ins, CCAssignFn CalleeFn, CCAssignFn CallerFn)
Returns true if the results of the two calling conventions are compatible.
static mvt_range vector_valuetypes()
virtual bool useLoadStackGuardNode() const
If this function returns true, SelectionDAGBuilder emits a LOAD_STACK_GUARD node when it is lowering ...
self_iterator getIterator()
The memory access is non-temporal.
int getVarArgsGPRIndex() const
static MVT getVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
bool isCallingConvWin64(CallingConv::ID CC) const
uint64_t getConstantOperandVal(unsigned Num) const
Helper method returns the integer value of a ConstantSDNode operand.
void setVarArgsGPRIndex(int Index)
int CreateFixedObject(uint64_t Size, int64_t SPOffset, bool Immutable, bool isAliased=false)
Create a new object at a fixed location on the stack.
unsigned countPopulation() const
Count the number of bits set.
VAARG - VAARG has four operands: an input chain, a pointer, a SRCVALUE, and the alignment.
static void changeFPCCToAArch64CC(ISD::CondCode CC, AArch64CC::CondCode &CondCode, AArch64CC::CondCode &CondCode2)
changeFPCCToAArch64CC - Convert a DAG fp condition code to an AArch64 CC.
bool empty() const
empty - Check if the array is empty.
use_iterator use_begin() const
Provide iteration support to walk over all uses of an SDNode.
TargetLoweringBase::AtomicExpansionKind shouldExpandAtomicRMWInIR(AtomicRMWInst *AI) const override
Returns how the IR-level AtomicExpand pass should expand the given AtomicRMW, if at all...
bool isMisaligned128StoreSlow() const
const SDValue & getValue() const
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/...
unsigned MaxStoresPerMemmove
Specify maximum bytes of store instructions per memmove call.
Helper structure to be able to read SetCC information.
Val, OUTCHAIN = ATOMIC_CMP_SWAP(INCHAIN, ptr, cmp, swap) For double-word atomic operations: ValLo...
bool MaskedValueIsZero(SDValue Op, const APInt &Mask, unsigned Depth=0) const
Return true if 'Op & Mask' is known to be zero.
X = FP_EXTEND(Y) - Extend a smaller FP type into a larger FP type.
static SDValue addRequiredExtensionForVectorMULL(SDValue N, SelectionDAG &DAG, const EVT &OrigTy, const EVT &ExtTy, unsigned ExtOpcode)
static SDValue emitConjunctionDisjunctionTreeRec(SelectionDAG &DAG, SDValue Val, AArch64CC::CondCode &OutCC, bool Negate, SDValue CCOp, AArch64CC::CondCode Predicate)
Emit conjunction or disjunction tree with the CMP/FCMP followed by a chain of CCMP/CFCMP ops...
std::vector< ArgListEntry > ArgListTy
MO_HI12 - This flag indicates that a symbol operand represents the bits 13-24 of a 64-bit address...
bool isIntN(unsigned N, int64_t x)
Checks if an signed integer fits into the given (dynamic) bit width.
bool isPointerTy() const
True if this is an instance of PointerType.
static SDValue performIntToFpCombine(SDNode *N, SelectionDAG &DAG, const AArch64Subtarget *Subtarget)
unsigned getNextStackOffset() const
getNextStackOffset - Return the next stack offset such that all stack slots satisfy their alignment r...
void computeKnownBitsForTargetNode(const SDValue Op, KnownBits &Known, const APInt &DemandedElts, const SelectionDAG &DAG, unsigned Depth=0) const override
Determine which of the bits specified in Mask are known to be either zero or one and return them in t...
static bool isSingletonEXTMask(ArrayRef< int > M, EVT VT, unsigned &Imm)
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
LLVMContext & getContext() const
Value * CreateExtractValue(Value *Agg, ArrayRef< unsigned > Idxs, const Twine &Name="")
This structure contains all information that is necessary for lowering calls.
static PointerType * getInt8PtrTy(LLVMContext &C, unsigned AS=0)
static SDValue GenerateTBL(SDValue Op, ArrayRef< int > ShuffleMask, SelectionDAG &DAG)
unsigned countTrailingZeros() const
Count the number of trailing zero bits.
bool predictableSelectIsExpensive() const
std::pair< SDValue, SDValue > makeLibCall(SelectionDAG &DAG, RTLIB::Libcall LC, EVT RetVT, ArrayRef< SDValue > Ops, bool isSigned, const SDLoc &dl, bool doesNotReturn=false, bool isReturnValueUsed=true) const
Returns a pair of (return value, chain).
This class contains a discriminated union of information about pointers in memory operands...
bool isPowerOf2() const
Check if this APInt's value is a power of two greater than zero.
MO_TLS - Indicates that the operand being accessed is some kind of thread-local symbol.
unsigned char ClassifyGlobalReference(const GlobalValue *GV, const TargetMachine &TM) const
ClassifyGlobalReference - Find the target operand flags that describe how a global value should be re...
static SDValue LowerXOR(SDValue Op, SelectionDAG &DAG)
static uint8_t encodeAdvSIMDModImmType12(uint64_t Imm)
Value * CreateTrunc(Value *V, Type *DestTy, const Twine &Name="")
static SDValue performSTORECombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, SelectionDAG &DAG, const AArch64Subtarget *Subtarget)
static SDValue NarrowVector(SDValue V128Reg, SelectionDAG &DAG)
NarrowVector - Given a value in the V128 register class, produce the equivalent value in the V64 regi...
const BlockAddress * getBlockAddress() const
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode...
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...
Triple - Helper class for working with autoconf configuration names.
static bool isReleaseOrStronger(AtomicOrdering ao)
const MachinePointerInfo & getPointerInfo() const
int64_t getObjectOffset(int ObjectIdx) const
Return the assigned stack offset of the specified object from the incoming stack pointer.
unsigned getByValAlign() const
static bool findEXTRHalf(SDValue N, SDValue &Src, uint32_t &ShiftAmount, bool &FromHi)
An EXTR instruction is made up of two shifts, ORed together.
static const int BlockSize
static SDValue performORCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, const AArch64Subtarget *Subtarget)
void setHasExtractBitsInsn(bool hasExtractInsn=true)
Tells the code generator that the target has BitExtract instructions.
static cl::opt< bool > EnableAArch64SlrGeneration("aarch64-shift-insert-generation", cl::Hidden, cl::desc("Allow AArch64 SLI/SRI formation"), cl::init(false))
bool bitsGT(EVT VT) const
Return true if this has more bits than VT.
static uint8_t encodeAdvSIMDModImmType2(uint64_t Imm)
ArrayRef< int > getMask() const
Libcall getFPEXT(EVT OpVT, EVT RetVT)
getFPEXT - Return the FPEXT_*_* value for the given types, or UNKNOWN_LIBCALL if there is none...
IntegerType * getIntPtrType(LLVMContext &C, unsigned AddressSpace=0) const
Returns an integer type with size at least as big as that of a pointer in the given address space...
static uint64_t encodeLogicalImmediate(uint64_t imm, unsigned regSize)
encodeLogicalImmediate - Return the encoded immediate value for a logical immediate instruction of th...
SDValue getTargetConstantPool(const Constant *C, EVT VT, unsigned Align=0, int Offset=0, unsigned char TargetFlags=0)
SDValue getTargetJumpTable(int JTI, EVT VT, unsigned char TargetFlags=0)
bool hasExternalWeakLinkage() const
TokenFactor - This node takes multiple tokens as input and produces a single token result...
static int getFP64Imm(const APInt &Imm)
getFP64Imm - Return an 8-bit floating-point version of the 64-bit floating-point value.
bool isBuildVectorAllOnes(const SDNode *N)
Return true if the specified node is a BUILD_VECTOR where all of the elements are ~0 or undef...
static SDValue LowerBITCAST(SDValue Op, SelectionDAG &DAG)
Iterator for intrusive lists based on ilist_node.
CCState - This class holds information needed while lowering arguments and return values...
void addSuccessor(MachineBasicBlock *Succ, BranchProbability Prob=BranchProbability::getUnknown())
Add Succ as a successor of this MachineBasicBlock.
static unsigned getIntrinsicID(const SDNode *N)
This is the shared class of boolean and integer constants.
void dump() const
Dump this node, for debugging.
static SDValue splitStoreSplat(SelectionDAG &DAG, StoreSDNode &St, SDValue SplatVal, unsigned NumVecElts)
auto find(R &&Range, const T &Val) -> decltype(std::begin(Range))
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly...
bool isBaseWithConstantOffset(SDValue Op) const
Return true if the specified operand is an ISD::ADD with a ConstantSDNode on the right-hand side...
void computeKnownBits(SDValue Op, KnownBits &Known, unsigned Depth=0) const
Determine which bits of Op are known to be either zero or one and return them in Known.
EVT getOptimalMemOpType(uint64_t Size, unsigned DstAlign, unsigned SrcAlign, bool IsMemset, bool ZeroMemset, bool MemcpyStrSrc, MachineFunction &MF) const override
Returns the target specific optimal type for load and store operations as a result of memset...
EXTRACT_VECTOR_ELT(VECTOR, IDX) - Returns a single element from VECTOR identified by the (potentially...
uint64_t getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
static StructType * get(LLVMContext &Context, ArrayRef< Type * > Elements, bool isPacked=false)
This static method is the primary way to create a literal StructType.
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
MVT getScalarShiftAmountTy(const DataLayout &DL, EVT) const override
EVT is not used in-tree, but is used by out-of-tree target.
const Module * getModule() const
Return the module owning the function this instruction belongs to or nullptr it the function does not...
AArch64TargetLowering(const TargetMachine &TM, const AArch64Subtarget &STI)
unsigned logBase2() const
bool isPredecessorOf(const SDNode *N) const
Return true if this node is a predecessor of N.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Module.h This file contains the declarations for the Module class.
Type * getType() const
All values are typed, get the type of this value.
Instruction * user_back()
Specialize the methods defined in Value, as we know that an instruction can only be used by other ins...
static bool memOpAlign(unsigned DstAlign, unsigned SrcAlign, unsigned AlignCheck)
SDValue getBuildVector(EVT VT, const SDLoc &DL, ArrayRef< SDValue > Ops)
Return an ISD::BUILD_VECTOR node.
Provides information about what library functions are available for the current target.
static bool isLegalArithImmed(uint64_t C)
MDNode * getMetadata(unsigned KindID) const
Get the metadata of given kind attached to this Instruction.
CCValAssign - Represent assignment of one arg/retval to a location.
const uint32_t * getThisReturnPreservedMask(const MachineFunction &MF, CallingConv::ID) const
getThisReturnPreservedMask - Returns a call preserved mask specific to the case that 'returned' is on...
static unsigned getExtFactor(SDValue &V)
getExtFactor - Determine the adjustment factor for the position when generating an "extract from vect...
SDValue getMemcpy(SDValue Chain, const SDLoc &dl, SDValue Dst, SDValue Src, SDValue Size, unsigned Align, bool isVol, bool AlwaysInline, bool isTailCall, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo)
constexpr size_t array_lengthof(T(&)[N])
Find the length of an array.
Predicate
Predicate - These are "(BI << 5) | BO" for various predicates.
BRCOND - Conditional branch.
static bool isAllConstantBuildVector(const SDValue &PotentialBVec, uint64_t &ConstVal)
const SDValue & getChain() const
Byte Swap and Counting operators.
MachineMemOperand * getMemOperand() const
Return a MachineMemOperand object describing the memory reference performed by operation.
BasicBlock * GetInsertBlock() const
Value * CreateShuffleVector(Value *V1, Value *V2, Value *Mask, const Twine &Name="")
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
static SDValue tryCombineShiftImm(unsigned IID, SDNode *N, SelectionDAG &DAG)
static Constant * get(Type *Ty, uint64_t V, bool isSigned=false)
If Ty is a vector type, return a Constant with a splat of the given value.
Helper structure to keep track of ISD::SET_CC operands.
bool is64BitVector() const
Return true if this is a 64-bit vector type.
Represents one node in the SelectionDAG.
bool isProfitableToHoist(Instruction *I) const override
Check if it is profitable to hoist instruction in then/else to if.
CondCode getSetCCInverse(CondCode Operation, bool isInteger)
Return the operation corresponding to !(X op Y), where 'op' is a valid SetCC operation.
unsigned getPointerAddressSpace() const
Returns the address space of the pointer operand.
void setAdjustsStack(bool V)
static bool isSignExtended(SDNode *N, SelectionDAG &DAG)
SDValue getNOT(const SDLoc &DL, SDValue Val, EVT VT)
Create a bitwise NOT operation as (XOR Val, -1).
bool targetShrinkDemandedConstant(SDValue Op, const APInt &Demanded, TargetLoweringOpt &TLO) const override
BinOp getOperation() const
SDValue getCopyToReg(SDValue Chain, const SDLoc &dl, unsigned Reg, SDValue N)
bool lowerInterleavedStore(StoreInst *SI, ShuffleVectorInst *SVI, unsigned Factor) const override
Lower an interleaved store into a stN intrinsic.
static void changeFPCCToANDAArch64CC(ISD::CondCode CC, AArch64CC::CondCode &CondCode, AArch64CC::CondCode &CondCode2)
Convert a DAG fp condition code to an AArch64 CC.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
static mvt_range integer_valuetypes()
static SDValue performFDivCombine(SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const AArch64Subtarget *Subtarget)
Fold a floating-point divide by power of two into fixed-point to floating-point conversion.
MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr &MI, MachineBasicBlock *MBB) const override
This method should be implemented by targets that mark instructions with the 'usesCustomInserter' fla...
C - The default llvm calling convention, compatible with C.
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
static bool isZIPMask(ArrayRef< int > M, EVT VT, unsigned &WhichResult)
bool is128BitVector() const
Return true if this is a 128-bit vector type.
CCAssignFn * CCAssignFnForCall(CallingConv::ID CC, bool IsVarArg) const
Selects the correct CCAssignFn for a given CallingConvention value.
Value * getArgOperand(unsigned i) const
getArgOperand/setArgOperand - Return/set the i-th call argument.
ISD::LoadExtType getExtensionType() const
Return whether this is a plain node, or one of the varieties of value-extending loads.
Class to represent vector types.
void insertCopiesSplitCSR(MachineBasicBlock *Entry, const SmallVectorImpl< MachineBasicBlock * > &Exits) const override
Insert explicit copies in entry and exit blocks.
bool shouldExpandAtomicStoreInIR(StoreInst *SI) const override
Returns true if the given (atomic) store should be expanded by the IR-level AtomicExpand pass into an...
const char * getTargetNodeName(unsigned Opcode) const override
This method returns the name of a target specific DAG node.
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...
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...
static unsigned getNZCVToSatisfyCondCode(CondCode Code)
Given a condition code, return NZCV flags that would satisfy that condition.
static bool performTBISimplification(SDValue Addr, TargetLowering::DAGCombinerInfo &DCI, SelectionDAG &DAG)
Simplify Addr given that the top byte of it is ignored by HW during address translation.
Class for arbitrary precision integers.
SDValue getConstantFP(double Val, const SDLoc &DL, EVT VT, bool isTarget=false)
Create a ConstantFPSDNode wrapping a constant value.
Value * getIRStackGuard(IRBuilder<> &IRB) const override
If the target has a standard location for the stack protector cookie, returns the address of that loc...
iterator_range< use_iterator > uses()
unsigned getNumInterleavedAccesses(VectorType *VecTy, const DataLayout &DL) const
Returns the number of interleaved accesses that will be generated when lowering accesses of the given...
A "pseudo-class" with methods for operating on BUILD_VECTORs.
Select(COND, TRUEVAL, FALSEVAL).
void setMinFunctionAlignment(unsigned Align)
Set the target's minimum function alignment (in log2(bytes))
int64_t getSExtValue() const
static void changeVectorFPCCToAArch64CC(ISD::CondCode CC, AArch64CC::CondCode &CondCode, AArch64CC::CondCode &CondCode2, bool &Invert)
changeVectorFPCCToAArch64CC - Convert a DAG fp condition code to an AArch64 CC usable with the vector...
op_iterator op_begin() const
bool isIntegerTy() const
True if this is an instance of IntegerType.
unsigned EmulatedTLS
EmulatedTLS - This flag enables emulated TLS model, using emutls function in the runtime library...
static uint8_t encodeAdvSIMDModImmType10(uint64_t Imm)
static use_iterator use_end()
bool isNullFPConstant(SDValue V)
Returns true if V is an FP constant with a value of positive zero.
void setPrefLoopAlignment(unsigned Align)
Set the target's preferred loop alignment.
void setMaximumJumpTableSize(unsigned)
Indicate the maximum number of entries in jump tables.
ZERO_EXTEND - Used for integer types, zeroing the new bits.
unsigned getVectorNumElements() const
void AnalyzeCallOperands(const SmallVectorImpl< ISD::OutputArg > &Outs, CCAssignFn Fn)
AnalyzeCallOperands - Analyze the outgoing arguments to a call, incorporating info about the passed v...
Value * CreateShl(Value *LHS, Value *RHS, const Twine &Name="", bool HasNUW=false, bool HasNSW=false)
ANY_EXTEND - Used for integer types. The high bits are undefined.
static SDValue performNVCASTCombine(SDNode *N)
Get rid of unnecessary NVCASTs (that don't change the type).
static SDValue performMulCombine(SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const AArch64Subtarget *Subtarget)
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
iterator insert(iterator I, T &&Elt)
FCOPYSIGN(X, Y) - Return the value of X with the sign of Y.
FMINNAN/FMAXNAN - Behave identically to FMINNUM/FMAXNUM, except that when a single input is NaN...
Value * CreatePointerCast(Value *V, Type *DestTy, const Twine &Name="")
virtual TargetLoweringBase::LegalizeTypeAction getPreferredVectorAction(EVT VT) const
Return the preferred vector type legalization action.
bool isTargetDarwin() const
static SDValue skipExtensionForVectorMULL(SDNode *N, SelectionDAG &DAG)
iterator_range< value_op_iterator > op_values() const
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
static SDValue performPostLD1Combine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, bool IsLaneOp)
Target-specific DAG combine function for post-increment LD1 (lane) and post-increment LD1R...
static bool isAcquireOrStronger(AtomicOrdering ao)
Flags
Flags values. These may be or'd together.
The C convention as implemented on Windows/x86-64 and AArch64.
llvm_unreachable("Unknown RegBank!")
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
static uint8_t encodeAdvSIMDModImmType5(uint64_t Imm)
static bool isEquivalentMaskless(unsigned CC, unsigned width, ISD::LoadExtType ExtType, int AddConstant, int CompConstant)
static MachinePointerInfo getFixedStack(MachineFunction &MF, int FI, int64_t Offset=0)
Return a MachinePointerInfo record that refers to the specified FrameIndex.
Value * CreateTruncOrBitCast(Value *V, Type *DestTy, const Twine &Name="")
BR_JT - Jumptable branch.
static std::vector< std::string > Flags
static mvt_range all_valuetypes()
SimpleValueType Iteration.
Representation of each machine instruction.
VACOPY - VACOPY has 5 operands: an input chain, a destination pointer, a source pointer, a SRCVALUE for the destination, and a SRCVALUE for the source.
static bool isAdvSIMDModImmType10(uint64_t Imm)
#define FALKOR_STRIDED_ACCESS_MD
static uint8_t encodeAdvSIMDModImmType8(uint64_t Imm)
These are IR-level optimization flags that may be propagated to SDNodes.
Libcall getFPTOUINT(EVT OpVT, EVT RetVT)
getFPTOUINT - Return the FPTOUINT_*_* value for the given types, or UNKNOWN_LIBCALL if there is none...
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
SDValue getTargetBlockAddress(const BlockAddress *BA, EVT VT, int64_t Offset=0, unsigned char TargetFlags=0)
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
uint64_t getConstantOperandVal(unsigned i) const
constexpr bool isShiftedMask_64(uint64_t Value)
Return true if the argument contains a non-empty sequence of ones with the remainder zero (64 bit ver...
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
static SDValue LowerXALUO(SDValue Op, SelectionDAG &DAG)
Bitwise operators - logical and, logical or, logical xor.
pointer data()
Return a pointer to the vector's buffer, even if empty().
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
MachineBasicBlock * emitPatchPoint(MachineInstr &MI, MachineBasicBlock *MBB) const
Replace/modify any TargetFrameIndex operands with a targte-dependent sequence of memory operands that...
void splice(iterator Where, MachineBasicBlock *Other, iterator From)
Take an instruction from MBB 'Other' at the position From, and insert it into this MBB right before '...
SDValue getCopyFromReg(SDValue Chain, const SDLoc &dl, unsigned Reg, EVT VT)
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
const MCPhysReg * getCalleeSavedRegsViaCopy(const MachineFunction *MF) const
virtual void LowerAsmOperandForConstraint(SDValue Op, std::string &Constraint, std::vector< SDValue > &Ops, SelectionDAG &DAG) const
Lower the specified operand into the Ops vector.
FastISel * createFastISel(FunctionLoweringInfo &funcInfo, const TargetLibraryInfo *libInfo) const override
This method returns a target specific FastISel object, or null if the target does not support "fast" ...
bool isTargetWindows() const
SMUL_LOHI/UMUL_LOHI - Multiply two integers of type iN, producing a signed/unsigned value of type i[2...
static uint8_t encodeAdvSIMDModImmType4(uint64_t Imm)
SIGN_EXTEND_INREG - This operator atomically performs a SHL/SRA pair to sign extend a small value in ...
static uint8_t encodeAdvSIMDModImmType11(uint64_t Imm)
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
bool isMaskAndCmp0FoldingBeneficial(const Instruction &AndI) const override
Return if the target supports combining a chain like:
unsigned getSizeInBits() const
Return the size of the specified value type in bits.
int getVarArgsFPRIndex() const
void ReplaceAllUsesWith(SDValue From, SDValue Op)
Modify anything using 'From' to use 'To' instead.
static bool isAddSubSExt(SDNode *N, SelectionDAG &DAG)
ArrayRef< SDUse > ops() const
void AnalyzeReturn(const SmallVectorImpl< ISD::OutputArg > &Outs, CCAssignFn Fn)
AnalyzeReturn - Analyze the returned values of a return, incorporating info about the result values i...
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
bool hasOneUse() const
Return true if there is exactly one user of this value.
FunctionLoweringInfo - This contains information that is global to a function that is used when lower...
APFloat abs(APFloat X)
Returns the absolute value of the argument.
bool isIndexed() const
Return true if this is a pre/post inc/dec load/store.
MO_PAGEOFF - A symbol operand with this flag represents the offset of that symbol within a 4K page...
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
The memory access always returns the same value (or traps).
CallInst * CreateCall(Value *Callee, ArrayRef< Value * > Args=None, const Twine &Name="", MDNode *FPMathTag=nullptr)
unsigned MaxStoresPerMemmoveOptSize
Maximum number of store instructions that may be substituted for a call to memmove, used for functions with OptSize attribute.
unsigned MaxStoresPerMemcpyOptSize
Maximum number of store operations that may be substituted for a call to memcpy, used for functions w...
Value * emitLoadLinked(IRBuilder<> &Builder, Value *Addr, AtomicOrdering Ord) const override
Perform a load-linked operation on Addr, returning a "Value *" with the corresponding pointee type...
void setStackPointerRegisterToSaveRestore(unsigned R)
If set to a physical register, this specifies the register that llvm.savestack/llvm.restorestack should save and restore.
static SDValue getTestBitOperand(SDValue Op, unsigned &Bit, bool &Invert, SelectionDAG &DAG)
static bool isVShiftRImm(SDValue Op, EVT VT, bool isNarrow, int64_t &Cnt)
isVShiftRImm - Check if this is a valid build_vector for the immediate operand of a vector shift righ...
bool getTgtMemIntrinsic(IntrinsicInfo &Info, const CallInst &I, unsigned Intrinsic) const override
getTgtMemIntrinsic - Represent NEON load and store intrinsics as MemIntrinsicNodes.
op_iterator op_end() const
static bool optimizeLogicalImm(SDValue Op, unsigned Size, uint64_t Imm, const APInt &Demanded, TargetLowering::TargetLoweringOpt &TLO, unsigned NewOpc)
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
unsigned getVarArgsGPRSize() const
Fast - This calling convention attempts to make calls as fast as possible (e.g.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
static SDValue performIntrinsicCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, const AArch64Subtarget *Subtarget)
VectorType * getType() const
Overload to return most specific vector type.
static SDValue replaceSplatVectorStore(SelectionDAG &DAG, StoreSDNode &St)
Replace a splat of a scalar to a vector store by scalar stores of the scalar value.
static const int LAST_INDEXED_MODE
bool supportsAddressTopByteIgnored() const
CPU has TBI (top byte of addresses is ignored during HW address translation) and OS enables it...
FSINCOS - Compute both fsin and fcos as a single operation.
bool useLoadStackGuardNode() const override
If this function returns true, SelectionDAGBuilder emits a LOAD_STACK_GUARD node when it is lowering ...
unsigned MaxStoresPerMemcpy
Specify maximum bytes of store instructions per memcpy call.
int32_t getConstantFPSplatPow2ToLog2Int(BitVector *UndefElements, uint32_t BitWidth) const
If this is a constant FP splat and the splatted constant FP is an exact power or 2, return the log base 2 integer value.
int CreateStackObject(uint64_t Size, unsigned Alignment, bool isSS, const AllocaInst *Alloca=nullptr)
Create a new statically sized stack object, returning a nonnegative identifier to represent it...
EVT getValueType() const
Return the ValueType of the referenced return value.
Value * CreatePtrToInt(Value *V, Type *DestTy, const Twine &Name="")
SDValue getConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isTarget=false, bool isOpaque=false)
Create a ConstantSDNode wrapping a constant value.
void setBytesInStackArgArea(unsigned bytes)
Libcall getSINTTOFP(EVT OpVT, EVT RetVT)
getSINTTOFP - Return the SINTTOFP_*_* value for the given types, or UNKNOWN_LIBCALL if there is none...
void setUnsafeAlgebra(bool b)
bool is128BitVector() const
Return true if this is a 128-bit vector type.
TLSModel::Model getTLSModel(const GlobalValue *GV) const
Returns the TLS model which should be used for the given global variable.
static SDValue replaceZeroVectorStore(SelectionDAG &DAG, StoreSDNode &St)
Replace a splat of zeros to a vector store by scalar stores of WZR/XZR.
bool isLegalAddImmediate(int64_t) const override
Return true if the specified immediate is legal add immediate, that is the target has add instruction...
CONCAT_VECTORS(VECTOR0, VECTOR1, ...) - Given a number of values of vector type with the same length ...
unsigned getReg() const
getReg - Returns the register number.
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
bool EnableExtLdPromotion
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void insert(iterator MBBI, MachineBasicBlock *MBB)
bool isAllOnesConstant(SDValue V)
Returns true if V is an integer constant with all bits set.
SDValue getFrameIndex(int FI, EVT VT, bool isTarget=false)
LegalizeTypeAction
This enum indicates whether a types are legal for a target, and if not, what action should be used to...
static AArch64CC::CondCode changeIntCCToAArch64CC(ISD::CondCode CC)
changeIntCCToAArch64CC - Convert a DAG integer condition code to an AArch64 CC
MachineMemOperand::Flags getMMOFlags(const Instruction &I) const override
This callback is used to inspect load/store instructions and add target-specific MachineMemOperand fl...
static bool isSetCC(SDValue Op, SetCCInfoAndKind &SetCCInfo)
Check whether or not Op is a SET_CC operation, either a generic or an AArch64 lowered one...
void setReturnAddressIsTaken(bool s)
bool useSmallAddressing() const
bool isSimple() const
Test if the given EVT is simple (as opposed to being extended).
unsigned getVaListSizeInBits(const DataLayout &DL) const override
Returns the size of the platform's va_list object.
unsigned getAlignment() const
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...
void setSchedulingPreference(Sched::Preference Pref)
Specify the target scheduling preference.
static MachinePointerInfo getGOT(MachineFunction &MF)
Return a MachinePointerInfo record that refers to a GOT entry.
unsigned getPrimitiveSizeInBits() const LLVM_READONLY
Return the basic size of this type if it is a primitive type.
Module * getParent()
Get the module that this global value is contained inside of...
LLVM Value Representation.
FMA - Perform a * b + c with no intermediate rounding step.
SDValue getRegister(unsigned Reg, EVT VT)
FMIN/FMAX nodes can have flags, for NaN/NoNaN variants.
unsigned getOpcode() const
Returns a member of one of the enums like Instruction::Add.
unsigned getMaximumJumpTableSize() const
Return upper limit for number of entries in a jump table.
const MachineInstrBuilder & addMBB(MachineBasicBlock *MBB, unsigned char TargetFlags=0) const
const AArch64InstrInfo * getInstrInfo() const override
static void ReplaceBITCASTResults(SDNode *N, SmallVectorImpl< SDValue > &Results, SelectionDAG &DAG)
static VectorType * get(Type *ElementType, unsigned NumElements)
This static method is the primary way to construct an VectorType.
bool isNullConstant(SDValue V)
Returns true if V is a constant integer zero.
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
SDValue getValueType(EVT)
Value * emitStoreConditional(IRBuilder<> &Builder, Value *Val, Value *Addr, AtomicOrdering Ord) const override
Perform a store-conditional operation to Addr.
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.
static bool getVShiftImm(SDValue Op, unsigned ElementBits, int64_t &Cnt)
getVShiftImm - Check if this is a valid build_vector for the immediate operand of a vector shift oper...
PREFETCH - This corresponds to a prefetch intrinsic.
static bool isExtendedBUILD_VECTOR(SDNode *N, SelectionDAG &DAG, bool isSigned)
unsigned getPrefFunctionAlignment() const
bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const override
Return true if folding a constant offset with the given GlobalAddress is legal.
Value * CreateLShr(Value *LHS, Value *RHS, const Twine &Name="", bool isExact=false)
uint64_t getTypeSizeInBits(Type *Ty) const
Size examples:
unsigned getMaxSupportedInterleaveFactor() const override
Get the maximum supported factor for interleaved memory accesses.
const TargetLowering & getTargetLoweringInfo() const
void ReplaceAllUsesOfValueWith(SDValue From, SDValue To)
Replace any uses of From with To, leaving uses of other values produced by From.Val alone...
Primary interface to the complete machine description for the target machine.
PointerType * getPointerTo(unsigned AddrSpace=0) const
Return a pointer to the current type.
StringRef - Represent a constant reference to a string, i.e.
MO_NC - Indicates whether the linker is expected to check the symbol reference for overflow...
SetCC operator - This evaluates to a true value iff the condition is true.
virtual SDValue LowerToTLSEmulatedModel(const GlobalAddressSDNode *GA, SelectionDAG &DAG) const
Lower TLS global address SDNode for target independent emulated TLS model.
unsigned getPrefLoopAlignment() const
unsigned MaxStoresPerMemset
Specify maximum number of store instructions per memset call.
static uint8_t encodeAdvSIMDModImmType9(uint64_t Imm)
unsigned MaxStoresPerMemsetOptSize
Maximum number of stores operations that may be substituted for the call to memset, used for functions with OptSize attribute.
static bool isConcatMask(ArrayRef< int > Mask, EVT VT, bool SplitLHS)
static bool isAdvSIMDModImmType11(uint64_t Imm)
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml","ocaml 3.10-compatible collector")
bool hasPairedLoad(EVT LoadedType, unsigned &RequiredAligment) const override
Return true if the target supplies and combines to a paired load two loaded values of type LoadedType...
bool operator==(uint64_t V1, const APInt &V2)
MERGE_VALUES - This node takes multiple discrete operands and returns them all as its individual resu...
unsigned getLocMemOffset() const
MVT getVectorElementType() const
static bool isVolatile(Instruction *Inst)
SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override
Provide custom lowering hooks for some operations.
SDValue getEntryNode() const
Return the token chain corresponding to the entry of the function.
static cl::opt< bool > EnableOptimizeLogicalImm("aarch64-enable-logical-imm", cl::Hidden, cl::desc("Enable AArch64 logical imm instruction ""optimization"), cl::init(true))
SDValue getTargetInsertSubreg(int SRIdx, const SDLoc &DL, EVT VT, SDValue Operand, SDValue Subreg)
A convenience function for creating TargetInstrInfo::INSERT_SUBREG nodes.
TRUNCATE - Completely drop the high bits.
static void Split(std::vector< std::string > &V, StringRef S)
Splits a string of comma separated items in to a vector of strings.
auto find_if(R &&Range, UnaryPredicate P) -> decltype(std::begin(Range))
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly...
static SDValue emitConditionalComparison(SDValue LHS, SDValue RHS, ISD::CondCode CC, SDValue CCOp, AArch64CC::CondCode Predicate, AArch64CC::CondCode OutCC, const SDLoc &DL, SelectionDAG &DAG)
Create a conditional comparison; Use CCMP, CCMN or FCCMP as appropriate.
bool isUIntN(unsigned N, uint64_t x)
Checks if an unsigned integer fits into the given (dynamic) bit width.
unsigned getAlignment() const
static void getShuffleMask(Constant *Mask, SmallVectorImpl< int > &Result)
Convert the input shuffle mask operand to a vector of integers.
virtual ConstraintWeight getSingleConstraintMatchWeight(AsmOperandInfo &info, const char *constraint) const
Examine constraint string and operand type and determine a weight value.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
const MachineInstrBuilder & addReg(unsigned RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
MVT getSimpleValueType(unsigned ResNo) const
Return the type of a specified result as a simple type.
bool isShuffleMaskLegal(const SmallVectorImpl< int > &M, EVT VT) const override
Return true if the given shuffle mask can be codegen'd directly, or if it should be stack expanded...
bool is64BitVector() const
Return true if this is a 64-bit vector type.
FNEG, FABS, FSQRT, FSIN, FCOS, FPOWI, FPOW, FLOG, FLOG2, FLOG10, FEXP, FEXP2, FCEIL, FTRUNC, FRINT, FNEARBYINT, FROUND, FFLOOR - Perform various unary floating point operations.
static uint8_t encodeAdvSIMDModImmType7(uint64_t Imm)
Value * getPointerOperand()
static SDValue getEstimate(const AArch64Subtarget *ST, unsigned Opcode, SDValue Operand, SelectionDAG &DAG, int &ExtraSteps)
MachineInstr::mmo_iterator allocateMemRefsArray(unsigned long Num)
allocateMemRefsArray - Allocate an array to hold MachineMemOperand pointers.
static SDValue performSRLCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI)
unsigned Log2_64(uint64_t Value)
Return the floor log base 2 of the specified value, -1 if the value is zero.
static const MachineMemOperand::Flags MOStridedAccess
int64_t getObjectSize(int ObjectIdx) const
Return the size of the specified object.
SCALAR_TO_VECTOR(VAL) - This represents the operation of loading a scalar value into element 0 of the...
static bool isSplatMask(const int *Mask, EVT VT)
static bool resolveBuildVector(BuildVectorSDNode *BVN, APInt &CnstBits, APInt &UndefBits)
EVT changeVectorElementTypeToInteger() const
Return a vector with the same number of elements as this vector, but with the element type converted ...
bool PredictableSelectIsExpensive
Tells the code generator that select is more expensive than a branch if the branch is usually predict...
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
static bool canGuaranteeTCO(CallingConv::ID CC)
Return true if the calling convention is one that we can guarantee TCO for.
bool isMachineOpcode() const
Test if this node has a post-isel opcode, directly corresponding to a MachineInstr opcode...
LLVMContext & getContext() const
Get the global data context.
void CommitTargetLoweringOpt(const TargetLoweringOpt &TLO)
unsigned getMachineOpcode() const
This may only be called if isMachineOpcode returns true.
SDValue getTargetGlobalAddress(const GlobalValue *GV, const SDLoc &DL, EVT VT, int64_t offset=0, unsigned char TargetFlags=0)
bool isFMAFasterThanFMulAndFAdd(EVT VT) const override
Return true if an FMA operation is faster than a pair of fmul and fadd instructions.
static SDValue tryLowerToSLI(SDNode *N, SelectionDAG &DAG)
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 ...
gep_type_iterator gep_type_begin(const User *GEP)
uint64_t getZExtValue() const
MemIndexedMode
MemIndexedMode enum - This enum defines the load / store indexed addressing modes.
MULHU/MULHS - Multiply high - Multiply two integers of type iN, producing an unsigned/signed value of...
unsigned getVectorNumElements() const
Given a vector type, return the number of elements it contains.
This class is used to represent ISD::LOAD nodes.
DYNAMIC_STACKALLOC - Allocate some number of bytes on the stack aligned to a specified boundary...
void setIsSplitCSR(bool s)
static SDValue getAArch64Cmp(SDValue LHS, SDValue RHS, ISD::CondCode CC, SDValue &AArch64cc, SelectionDAG &DAG, const SDLoc &dl)