61 #include "llvm/IR/IntrinsicsAArch64.h" 96 #define DEBUG_TYPE "aarch64-lower" 98 STATISTIC(NumTailCalls,
"Number of tail calls");
99 STATISTIC(NumShiftInserts,
"Number of vector shift inserts");
100 STATISTIC(NumOptimizedImms,
"Number of times immediates were optimized");
104 cl::desc(
"Allow AArch64 SLI/SRI formation"),
112 cl::desc(
"Allow AArch64 Local Dynamic TLS code generation"),
117 cl::desc(
"Enable AArch64 logical imm instruction " 166 if (Subtarget->
hasSVE()) {
853 if (Subtarget->
hasSVE()) {
868 void AArch64TargetLowering::addTypeForNEON(
MVT VT,
MVT PromotedBitwiseVT) {
934 for (
unsigned Opcode :
947 void AArch64TargetLowering::addDRTypeForNEON(
MVT VT) {
952 void AArch64TargetLowering::addQRTypeForNEON(
MVT VT) {
965 const APInt &Demanded,
968 uint64_t OldImm = Imm, NewImm, Enc;
969 uint64_t
Mask = ((uint64_t)(-1LL) >> (64 -
Size)), OrigMask =
Mask;
973 if (Imm == 0 || Imm == Mask ||
977 unsigned EltSize =
Size;
991 uint64_t NonDemandedBits = ~DemandedBits;
992 uint64_t InvertedImm = ~Imm & DemandedBits;
993 uint64_t RotatedImm =
994 ((InvertedImm << 1) | (InvertedImm >> (EltSize - 1) & 1)) &
996 uint64_t Sum = RotatedImm + NonDemandedBits;
997 bool Carry = NonDemandedBits & ~Sum & (1ULL << (EltSize - 1));
998 uint64_t Ones = (Sum + Carry) & NonDemandedBits;
999 NewImm = (Imm | Ones) & Mask;
1013 uint64_t
Hi = Imm >> EltSize, DemandedBitsHi = DemandedBits >> EltSize;
1016 if (((Imm ^ Hi) & (DemandedBits & DemandedBitsHi) & Mask) != 0)
1021 DemandedBits |= DemandedBitsHi;
1027 while (EltSize < Size) {
1028 NewImm |= NewImm << EltSize;
1034 "demanded bits should never be altered");
1035 assert(OldImm != NewImm &&
"the new imm shouldn't be equal to the old imm");
1044 if (NewImm == 0 || NewImm == OrigMask) {
1073 assert((Size == 32 || Size == 64) &&
1074 "i32 or i64 is expected after legalization.");
1085 NewOpc = Size == 32 ? AArch64::ANDWri : AArch64::ANDXri;
1088 NewOpc = Size == 32 ? AArch64::ORRWri : AArch64::ORRXri;
1091 NewOpc = Size == 32 ? AArch64::EORWri : AArch64::EORXri;
1130 case Intrinsic::aarch64_ldaxr:
1131 case Intrinsic::aarch64_ldxr: {
1133 EVT VT = cast<MemIntrinsicSDNode>(
Op)->getMemoryVT();
1143 unsigned IntNo = cast<ConstantSDNode>(Op.
getOperand(0))->getZExtValue();
1147 case Intrinsic::aarch64_neon_umaxv:
1148 case Intrinsic::aarch64_neon_uminv: {
1156 assert(BitWidth >= 8 &&
"Unexpected width!");
1160 assert(BitWidth >= 16 &&
"Unexpected width!");
1477 "SEH does not use catchret!");
1496 case AArch64::F128CSEL:
1499 case TargetOpcode::STACKMAP:
1500 case TargetOpcode::PATCHPOINT:
1667 CondCode, CondCode2);
1674 bool IsLegal = (C >> 12 == 0) || ((C & 0xFFFULL) == 0 && C >> 24 == 0);
1676 <<
" legal: " << (IsLegal ?
"yes\n" :
"no\n"));
1700 assert(VT !=
MVT::f16 &&
"Lowering of strict fp16 not yet implemented");
1709 const bool FullFP16 =
1728 if (
isCMN(RHS, CC)) {
1732 }
else if (
isCMN(LHS, CC)) {
1809 unsigned Opcode = 0;
1810 const bool FullFP16 =
1835 return DAG.
getNode(Opcode, DL, MVT_CC, LHS, RHS, NZCVOp, Condition, CCOp);
1853 bool &MustBeFirst,
bool WillNegate,
1854 unsigned Depth = 0) {
1862 MustBeFirst =
false;
1869 bool IsOR = Opcode ==
ISD::OR;
1881 if (MustBeFirstL && MustBeFirstR)
1887 if (!CanNegateL && !CanNegateR)
1891 CanNegate = WillNegate && CanNegateL && CanNegateR;
1894 MustBeFirst = !CanNegate;
1899 MustBeFirst = MustBeFirstL || MustBeFirstR;
1944 Predicate = ExtraCC;
1957 bool IsOR = Opcode ==
ISD::OR;
1963 assert(ValidL &&
"Valid conjunction/disjunction tree");
1970 assert(ValidR &&
"Valid conjunction/disjunction tree");
1975 assert(!MustBeFirstR &&
"Valid conjunction/disjunction tree");
1984 bool NegateAfterAll;
1988 assert(CanNegateR &&
"at least one side must be negatable");
1989 assert(!MustBeFirstR &&
"invalid conjunction/disjunction tree");
1993 NegateAfterR =
true;
1996 NegateR = CanNegateR;
1997 NegateAfterR = !CanNegateR;
2000 NegateAfterAll = !Negate;
2002 assert(Opcode ==
ISD::AND &&
"Valid conjunction/disjunction tree");
2003 assert(!Negate &&
"Valid conjunction/disjunction tree");
2007 NegateAfterR =
false;
2008 NegateAfterAll =
false;
2028 bool DummyCanNegate;
2029 bool DummyMustBeFirst;
2041 auto isSupportedExtend = [&](
SDValue V) {
2046 if (
ConstantSDNode *MaskCst = dyn_cast<ConstantSDNode>(V.getOperand(1))) {
2047 uint64_t
Mask = MaskCst->getZExtValue();
2048 return (Mask == 0xFF || Mask == 0xFFFF || Mask == 0xFFFFFFFF);
2057 if (isSupportedExtend(Op))
2063 uint64_t Shift = ShiftCst->getZExtValue();
2065 return (Shift <= 4) ? 2 : 1;
2079 uint64_t
C = RHSC->getZExtValue();
2087 if ((VT ==
MVT::i32 && C != 0x80000000 &&
2089 (VT ==
MVT::i64 && C != 0x80000000ULL &&
2108 if ((VT ==
MVT::i32 && C != INT32_MAX &&
2119 if ((VT ==
MVT::i32 && C != UINT32_MAX &&
2142 if (!isa<ConstantSDNode>(RHS) ||
2173 if ((RHSC->
getZExtValue() >> 16 == 0) && isa<LoadSDNode>(LHS) &&
2174 cast<LoadSDNode>(LHS)->getExtensionType() ==
ISD::ZEXTLOAD &&
2175 cast<LoadSDNode>(LHS)->getMemoryVT() ==
MVT::i16 &&
2177 int16_t ValueofRHS = cast<ConstantSDNode>(RHS)->getZExtValue();
2201 AArch64cc = DAG.
getConstant(AArch64CC, dl, MVT_CC);
2205 static std::pair<SDValue, SDValue>
2208 "Unsupported value type");
2282 UpperBits).getValue(1);
2304 UpperBits).getValue(1);
2314 Value = DAG.
getNode(Opc, DL, VTs, LHS, RHS);
2317 return std::make_pair(Value, Overflow);
2323 unsigned Offset = IsStrict ? 1 : 0;
2326 MakeLibCallOptions CallOptions;
2330 CallOptions, dl, Chain);
2331 return IsStrict ? DAG.
getMergeValues({Result, Chain}, dl) : Result;
2396 if (!CFVal || !CTVal)
2401 if (CTVal->isAllOnesValue() && CFVal->
isNullValue()) {
2433 bool ExtraOp =
false;
2492 unsigned IsWrite = cast<ConstantSDNode>(Op.
getOperand(2))->getZExtValue();
2493 unsigned Locality = cast<ConstantSDNode>(Op.
getOperand(3))->getZExtValue();
2494 unsigned IsData = cast<ConstantSDNode>(Op.
getOperand(4))->getZExtValue();
2496 bool IsStream = !Locality;
2500 assert(Locality <= 3 &&
"Prefetch locality out-of-range");
2504 Locality = 3 - Locality;
2508 unsigned PrfOp = (IsWrite << 4) |
2523 return LowerF128Call(Op, DAG, LC);
2541 MakeLibCallOptions CallOptions;
2546 CallOptions, dl, Chain);
2547 return IsStrict ? DAG.
getMergeValues({Result, Chain}, dl) : Result;
2596 return LowerVectorFP_TO_INT(Op, DAG);
2600 assert(!IsStrict &&
"Lowering of strict fp16 not yet implemented");
2619 return LowerF128Call(Op, DAG, LC);
2643 In = DAG.
getNode(CastOpc, dl, CastVT, In);
2661 assert(!IsStrict &&
"Lowering of strict fp16 not yet implemented");
2685 return LowerF128Call(Op, DAG, LC);
2702 Entry.IsSExt =
false;
2703 Entry.IsZExt =
false;
2704 Args.push_back(Entry);
2707 : RTLIB::SINCOS_STRET_F32;
2718 std::pair<SDValue, SDValue> CallResult =
LowerCallTo(CLI);
2719 return CallResult.first;
2744 switch (OrigSimpleTy) {
2757 unsigned ExtOpcode) {
2781 unsigned HalfSize = EltSize / 2;
2783 if (!
isIntN(HalfSize,
C->getSExtValue()))
2786 if (!
isUIntN(HalfSize,
C->getZExtValue()))
2807 unsigned EltSize = VT.getScalarSizeInBits() / 2;
2808 unsigned NumElts = VT.getVectorNumElements();
2811 for (
unsigned i = 0; i != NumElts; ++i) {
2878 "unexpected type for custom-lowering ISD::MUL");
2881 unsigned NewOpc = 0;
2885 if (isN0SExt && isN1SExt)
2890 if (isN0ZExt && isN1ZExt)
2892 else if (isN1SExt || isN1ZExt) {
2926 "unexpected types for extended operands to VMULL");
2927 return DAG.
getNode(NewOpc, DL, VT, Op0, Op1);
2935 return DAG.
getNode(N0->getOpcode(), DL, VT,
2942 SDValue AArch64TargetLowering::LowerINTRINSIC_WO_CHAIN(
SDValue Op,
2944 unsigned IntNo = cast<ConstantSDNode>(Op.
getOperand(0))->getZExtValue();
2948 case Intrinsic::thread_pointer: {
2952 case Intrinsic::aarch64_neon_abs: {
2965 case Intrinsic::aarch64_neon_smax:
2968 case Intrinsic::aarch64_neon_umax:
2971 case Intrinsic::aarch64_neon_smin:
2974 case Intrinsic::aarch64_neon_umin:
2978 case Intrinsic::aarch64_sve_sunpkhi:
2981 case Intrinsic::aarch64_sve_sunpklo:
2984 case Intrinsic::aarch64_sve_uunpkhi:
2987 case Intrinsic::aarch64_sve_uunpklo:
2990 case Intrinsic::aarch64_sve_clasta_n:
2993 case Intrinsic::aarch64_sve_clastb_n:
2996 case Intrinsic::aarch64_sve_lasta:
2999 case Intrinsic::aarch64_sve_lastb:
3002 case Intrinsic::aarch64_sve_rev:
3005 case Intrinsic::aarch64_sve_tbl:
3008 case Intrinsic::aarch64_sve_trn1:
3011 case Intrinsic::aarch64_sve_trn2:
3014 case Intrinsic::aarch64_sve_uzp1:
3017 case Intrinsic::aarch64_sve_uzp2:
3020 case Intrinsic::aarch64_sve_zip1:
3023 case Intrinsic::aarch64_sve_zip2:
3026 case Intrinsic::aarch64_sve_ptrue:
3030 case Intrinsic::aarch64_sve_insr: {
3040 case Intrinsic::localaddress: {
3043 unsigned Reg = RegInfo->getLocalAddressRegister(MF);
3048 case Intrinsic::eh_recoverfp: {
3055 auto *Fn = dyn_cast_or_null<Function>(GSD ? GSD->
getGlobal() :
nullptr);
3058 "llvm.eh.recoverfp must take a function as the first argument");
3059 return IncomingFPOp;
3064 bool AArch64TargetLowering::isVectorLoadExtDesirable(
SDValue ExtVal)
const {
3107 assert (StoreNode &&
"Can only custom lower store nodes");
3157 return LowerGlobalAddress(Op, DAG);
3159 return LowerGlobalTLSAddress(Op, DAG);
3163 return LowerSETCC(Op, DAG);
3165 return LowerBR_CC(Op, DAG);
3167 return LowerSELECT(Op, DAG);
3169 return LowerSELECT_CC(Op, DAG);
3171 return LowerJumpTable(Op, DAG);
3173 return LowerBR_JT(Op, DAG);
3175 return LowerConstantPool(Op, DAG);
3177 return LowerBlockAddress(Op, DAG);
3179 return LowerVASTART(Op, DAG);
3181 return LowerVACOPY(Op, DAG);
3183 return LowerVAARG(Op, DAG);
3197 return LowerF128Call(Op, DAG, RTLIB::ADD_F128);
3199 return LowerF128Call(Op, DAG, RTLIB::SUB_F128);
3201 return LowerF128Call(Op, DAG, RTLIB::MUL_F128);
3203 return LowerF128Call(Op, DAG, RTLIB::DIV_F128);
3206 return LowerFP_ROUND(Op, DAG);
3208 return LowerFP_EXTEND(Op, DAG);
3210 return LowerFRAMEADDR(Op, DAG);
3212 return LowerSPONENTRY(Op, DAG);
3214 return LowerRETURNADDR(Op, DAG);
3216 return LowerADDROFRETURNADDR(Op, DAG);
3218 return LowerINSERT_VECTOR_ELT(Op, DAG);
3220 return LowerEXTRACT_VECTOR_ELT(Op, DAG);
3222 return LowerBUILD_VECTOR(Op, DAG);
3224 return LowerVECTOR_SHUFFLE(Op, DAG);
3226 return LowerSPLAT_VECTOR(Op, DAG);
3228 return LowerEXTRACT_SUBVECTOR(Op, DAG);
3232 return LowerVectorSRA_SRL_SHL(Op, DAG);
3234 return LowerShiftLeftParts(Op, DAG);
3237 return LowerShiftRightParts(Op, DAG);
3239 return LowerCTPOP(Op, DAG);
3241 return LowerFCOPYSIGN(Op, DAG);
3243 return LowerVectorOR(Op, DAG);
3252 return LowerINT_TO_FP(Op, DAG);
3257 return LowerFP_TO_INT(Op, DAG);
3259 return LowerFSINCOS(Op, DAG);
3261 return LowerFLT_ROUNDS_(Op, DAG);
3265 return LowerINTRINSIC_WO_CHAIN(Op, DAG);
3267 return LowerSTORE(Op, DAG);
3275 return LowerVECREDUCE(Op, DAG);
3277 return LowerATOMIC_LOAD_SUB(Op, DAG);
3279 return LowerATOMIC_LOAD_AND(Op, DAG);
3281 return LowerDYNAMIC_STACKALLOC(Op, DAG);
3291 bool IsVarArg)
const {
3330 SDValue AArch64TargetLowering::LowerFormalArguments(
3350 unsigned NumArgs = Ins.
size();
3352 unsigned CurArgIdx = 0;
3353 for (
unsigned i = 0; i != NumArgs; ++i) {
3354 MVT ValVT = Ins[i].VT;
3355 if (Ins[i].isOrigArg()) {
3356 std::advance(CurOrigArg, Ins[i].getOrigArgIndex() - CurArgIdx);
3357 CurArgIdx = Ins[i].getOrigArgIndex();
3372 assert(!Res &&
"Call operand has unhandled type");
3377 for (
unsigned i = 0,
e = ArgLocs.
size(); i !=
e; ++i) {
3380 if (Ins[i].Flags.isByVal()) {
3384 int Size = Ins[i].Flags.getByValSize();
3385 unsigned NumRegs = (Size + 7) / 8;
3404 RC = &AArch64::GPR32RegClass;
3406 RC = &AArch64::GPR64RegClass;
3408 RC = &AArch64::FPR16RegClass;
3410 RC = &AArch64::FPR32RegClass;
3412 RC = &AArch64::FPR64RegClass;
3414 RC = &AArch64::FPR128RegClass;
3417 RC = &AArch64::PPRRegClass;
3419 RC = &AArch64::ZPRRegClass;
3437 "Only scalable vectors can be passed indirectly");
3459 !Ins[i].Flags.isInConsecutiveRegs())
3460 BEAlign = 8 - ArgSize;
3480 "Only scalable vectors can be passed indirectly");
3494 ExtType, DL, VA.
getLocVT(), Chain, FIN,
3514 saveVarArgRegisters(CCInfo, DAG, DL, Chain);
3518 unsigned StackOffset = CCInfo.getNextStackOffset();
3530 CCInfo.analyzeMustTailForwardedRegisters(Forwards, RegParmTypes,
3534 if (!CCInfo.isAllocated(AArch64::X8)) {
3535 unsigned X8VReg = MF.
addLiveIn(AArch64::X8, &AArch64::GPR64RegClass);
3545 for (
unsigned I = 0,
E = Ins.
size();
I !=
E; ++
I) {
3546 if (Ins[
I].Flags.isInReg()) {
3561 unsigned StackArgSize = CCInfo.getNextStackOffset();
3563 if (DoesCalleeRestoreStack(CallConv, TailCallOpt)) {
3567 StackArgSize =
alignTo(StackArgSize, 16);
3587 void AArch64TargetLowering::saveVarArgRegisters(
CCState &CCInfo,
3600 AArch64::X3, AArch64::X4, AArch64::X5,
3601 AArch64::X6, AArch64::X7 };
3602 static const unsigned NumGPRArgRegs =
array_lengthof(GPRArgRegs);
3605 unsigned GPRSaveSize = 8 * (NumGPRArgRegs - FirstVariadicGPR);
3607 if (GPRSaveSize != 0) {
3610 if (GPRSaveSize & 15)
3618 for (
unsigned i = FirstVariadicGPR; i < NumGPRArgRegs; ++i) {
3619 unsigned VReg = MF.
addLiveIn(GPRArgRegs[i], &AArch64::GPR64RegClass);
3626 (i - FirstVariadicGPR) * 8)
3638 AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3,
3639 AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7};
3640 static const unsigned NumFPRArgRegs =
array_lengthof(FPRArgRegs);
3643 unsigned FPRSaveSize = 16 * (NumFPRArgRegs - FirstVariadicFPR);
3645 if (FPRSaveSize != 0) {
3650 for (
unsigned i = FirstVariadicFPR; i < NumFPRArgRegs; ++i) {
3651 unsigned VReg = MF.
addLiveIn(FPRArgRegs[i], &AArch64::FPR128RegClass);
3666 if (!MemOps.
empty()) {
3673 SDValue AArch64TargetLowering::LowerCallResult(
3689 for (
unsigned i = 0; i != RVLocs.
size(); ++i) {
3694 if (i == 0 && isThisReturn) {
3696 "unexpected return calling convention register assignment");
3754 bool AArch64TargetLowering::isEligibleForTailCallOptimization(
3765 bool CCMatch = CallerCC == CalleeCC;
3773 if (i->hasByValAttr())
3782 if (i->hasInRegAttr())
3811 "Unexpected variadic calling convention");
3814 if (isVarArg && !Outs.
empty()) {
3822 CCState CCInfo(CalleeCC, isVarArg, MF, ArgLocs, C);
3826 if (!ArgLoc.isRegLoc())
3844 if (!TRI->regmaskSubsetEqual(CallerPreserved, CalleePreserved))
3853 CCState CCInfo(CalleeCC, isVarArg, MF, ArgLocs, C);
3871 SDValue AArch64TargetLowering::addTokenForArgument(
SDValue Chain,
3874 int ClobberedFI)
const {
3877 int64_t LastByte = FirstByte + MFI.
getObjectSize(ClobberedFI) - 1;
3888 if (
LoadSDNode *L = dyn_cast<LoadSDNode>(*U))
3890 if (FI->getIndex() < 0) {
3892 int64_t InLastByte = InFirstByte;
3895 if ((InFirstByte <= FirstByte && FirstByte <= InLastByte) ||
3896 (FirstByte <= InFirstByte && InFirstByte <= LastByte))
3904 bool AArch64TargetLowering::DoesCalleeRestoreStack(
CallingConv::ID CallCC,
3905 bool TailCallOpt)
const {
3912 AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI,
3921 bool &IsTailCall = CLI.IsTailCall;
3923 bool IsVarArg = CLI.IsVarArg;
3927 bool IsThisReturn =
false;
3931 bool IsSibCall =
false;
3935 IsTailCall = isEligibleForTailCallOptimization(
3936 Callee, CallConv, IsVarArg, Outs, OutVals, Ins, DAG);
3937 if (!IsTailCall && CLI.CS && CLI.CS.isMustTailCall())
3939 "site marked musttail");
3943 if (!TailCallOpt && IsTailCall)
3958 unsigned NumArgs = Outs.
size();
3960 for (
unsigned i = 0; i != NumArgs; ++i) {
3961 MVT ArgVT = Outs[i].VT;
3966 assert(!Res &&
"Call operand has unhandled type");
3976 unsigned NumArgs = Outs.
size();
3977 for (
unsigned i = 0; i != NumArgs; ++i) {
3978 MVT ValVT = Outs[i].VT;
3981 CLI.getArgs()[Outs[i].OrigArgIndex].Ty,
3993 assert(!Res &&
"Call operand has unhandled type");
4014 if (IsTailCall && !IsSibCall) {
4019 NumBytes =
alignTo(NumBytes, 16);
4024 FPDiff = NumReusableBytes - NumBytes;
4031 assert(FPDiff % 16 == 0 &&
"unaligned stack on tail call");
4047 if (IsVarArg && CLI.CS && CLI.CS.isMustTailCall()) {
4049 for (
const auto &
F : Forwards) {
4056 for (
unsigned i = 0,
e = ArgLocs.
size(); i !=
e; ++i) {
4074 if (Outs[i].ArgVT ==
MVT::i1) {
4098 "Only scalable vectors can be passed indirectly");
4106 "unexpected calling convention register assignment");
4108 "unexpected use of 'returned'");
4109 IsThisReturn =
true;
4118 [=](
const std::pair<unsigned, SDValue> &Elt) {
4149 OpSize = (OpSize + 7) / 8;
4153 BEAlign = 8 - OpSize;
4156 int32_t
Offset = LocMemOffset + BEAlign;
4161 Offset = Offset + FPDiff;
4171 Chain = addTokenForArgument(Chain, DAG, MF.
getFrameInfo(), FI);
4180 if (Outs[i].Flags.
isByVal()) {
4184 Chain, DL, DstAddr, Arg, SizeNode, Outs[i].Flags.
getByValAlign(),
4204 if (!MemOpChains.
empty())
4210 for (
auto &RegToPass : RegsToPass) {
4212 RegToPass.second, InFlag);
4219 if (
auto *
G = dyn_cast<GlobalAddressSDNode>(Callee)) {
4220 auto GV =
G->getGlobal();
4230 }
else if (
auto *S = dyn_cast<ExternalSymbolSDNode>(Callee)) {
4233 const char *Sym = S->getSymbol();
4237 const char *Sym = S->getSymbol();
4246 if (IsTailCall && !IsSibCall) {
4252 std::vector<SDValue> Ops;
4253 Ops.push_back(Chain);
4254 Ops.push_back(Callee);
4265 for (
auto &RegToPass : RegsToPass)
4267 RegToPass.second.getValueType()));
4279 if (CalleeInSVE || CalleeOutSVE)
4290 IsThisReturn =
false;
4302 assert(Mask &&
"Missing call preserved mask for calling convention");
4306 Ops.push_back(InFlag);
4324 uint64_t CalleePopBytes =
4325 DoesCalleeRestoreStack(CallConv, TailCallOpt) ?
alignTo(NumBytes, 16) : 0;
4335 return LowerCallResult(Chain, InFlag, CallConv, IsVarArg, Ins, DL, DAG,
4336 InVals, IsThisReturn,
4337 IsThisReturn ? OutVals[0] :
SDValue());
4340 bool AArch64TargetLowering::CanLowerReturn(
4347 CCState CCInfo(CallConv, isVarArg, MF, RVLocs, Context);
4372 for (
unsigned i = 0, realRVLocIdx = 0; i != RVLocs.
size();
4373 ++i, ++realRVLocIdx) {
4382 if (Outs[i].ArgVT ==
MVT::i1) {
4408 [=](
const std::pair<unsigned, SDValue> &Elt) {
4420 for (
auto &RetVal : RetVals) {
4421 Chain = DAG.
getCopyToReg(Chain, DL, RetVal.first, RetVal.second, Flag);
4424 DAG.
getRegister(RetVal.first, RetVal.second.getValueType()));
4431 if (
unsigned SRetReg = FuncInfo->getSRetReturnReg()) {
4435 unsigned RetValReg = AArch64::X0;
4436 Chain = DAG.
getCopyToReg(Chain, DL, RetValReg, Val, Flag);
4448 if (AArch64::GPR64RegClass.
contains(*I))
4450 else if (AArch64::FPR64RegClass.
contains(*I))
4472 unsigned Flag)
const {
4479 unsigned Flag)
const {
4485 unsigned Flag)
const {
4492 unsigned Flag)
const {
4497 template <
class NodeTy>
4499 unsigned Flags)
const {
4510 template <
class NodeTy>
4512 unsigned Flags)
const {
4526 template <
class NodeTy>
4528 unsigned Flags)
const {
4540 template <
class NodeTy>
4542 unsigned Flags)
const {
4546 SDValue Sym = getTargetNode(N, Ty, DAG, Flags);
4558 "unexpected offset in global node");
4563 return getGOT(GN, DAG, OpFlags);
4568 Result = getAddrLarge(GN, DAG, OpFlags);
4570 Result = getAddrTiny(GN, DAG, OpFlags);
4572 Result = getAddr(GN, DAG, OpFlags);
4611 AArch64TargetLowering::LowerDarwinGlobalTLSAddress(
SDValue Op,
4614 "This function expects a Darwin target");
4619 const GlobalValue *GV = cast<GlobalAddressSDNode>(
Op)->getGlobal();
4629 PtrMemVT, DL, Chain, DescAddr,
4631 PtrMemVT.getSizeInBits() / 8,
4769 SDValue AArch64TargetLowering::LowerELFTLSDescCallSeq(
SDValue SymAddr,
4785 AArch64TargetLowering::LowerELFGlobalTLSAddress(
SDValue Op,
4801 "in local exec TLS model");
4817 return LowerELFTLSLocalExec(GV, ThreadBase, DL, DAG);
4840 TPOff = LowerELFTLSDescCallSeq(SymAddr, DL, DAG);
4864 TPOff = LowerELFTLSDescCallSeq(SymAddr, DL, DAG);
4872 AArch64TargetLowering::LowerWindowsGlobalTLSAddress(
SDValue Op,
4937 return LowerDarwinGlobalTLSAddress(Op, DAG);
4939 return LowerELFGlobalTLSAddress(Op, DAG);
4941 return LowerWindowsGlobalTLSAddress(Op, DAG);
4958 bool ProduceNonFlagSettingCondBr =
5003 if (RHSC && RHSC->
getZExtValue() == 0 && ProduceNonFlagSettingCondBr) {
5092 else if (SrcVT.
bitsGT(VT))
5099 auto setVecVal = [&] (
int Idx) {
5113 EltMask = 0x80000000ULL;
5114 setVecVal(AArch64::ssub);
5123 setVecVal(AArch64::dsub);
5126 EltMask = 0x8000ULL;
5127 setVecVal(AArch64::hsub);
5157 Attribute::NoImplicitFloat))
5192 "Unexpected type for custom ctpop lowering");
5199 unsigned EltSize = 8;
5216 return LowerVSETCC(Op, DAG);
5220 unsigned OpNo = IsStrict ? 1 : 0;
5243 "Unexpected setcc expansion!");
5360 }
else if (CTVal && CFVal) {
5361 const int64_t TrueVal = CTVal->getSExtValue();
5368 if (TrueVal == ~FalseVal) {
5370 }
else if (TrueVal == -FalseVal) {
5378 const uint32_t TrueVal32 = CTVal->getZExtValue();
5381 if ((TrueVal32 == FalseVal32 + 1) || (TrueVal32 + 1 == FalseVal32)) {
5384 if (TrueVal32 > FalseVal32) {
5389 }
else if ((TrueVal == FalseVal + 1) || (TrueVal + 1 == FalseVal)) {
5392 if (TrueVal > FalseVal) {
5424 else if (CFVal && CFVal == RHSVal && AArch64CC ==
AArch64CC::NE)
5427 assert (CTVal && CFVal &&
"Expected constant operands for CSNEG.");
5441 return DAG.
getNode(Opcode, dl, VT, TVal, FVal, CCVal, Cmp);
5460 if (RHSVal && RHSVal->
isZero()) {
5468 CFVal && CFVal->
isZero() &&
5497 return LowerSELECT_CC(CC, LHS, RHS, TVal, FVal, DL, DAG);
5529 CC = cast<CondCodeSDNode>(CCVal->
getOperand(2))->
get();
5535 return LowerSELECT_CC(CC, LHS, RHS, TVal, FVal, DL, DAG);
5546 return getAddrLarge(JT, DAG);
5548 return getAddrTiny(JT, DAG);
5550 return getAddr(JT, DAG);
5560 int JTI = cast<JumpTableSDNode>(JT.
getNode())->getIndex();
5576 return getGOT(CP, DAG);
5578 return getAddrLarge(CP, DAG);
5580 return getAddrTiny(CP, DAG);
5582 return getAddr(CP, DAG);
5591 return getAddrLarge(BA, DAG);
5593 return getAddrTiny(BA, DAG);
5595 return getAddr(BA, DAG);
5701 return LowerWin64_VASTART(Op, DAG);
5703 return LowerDarwin_VASTART(Op, DAG);
5705 return LowerAAPCS_VASTART(Op, DAG);
5716 const Value *DestSV = cast<SrcValueSDNode>(Op.
getOperand(3))->getValue();
5717 const Value *SrcSV = cast<SrcValueSDNode>(Op.
getOperand(4))->getValue();
5727 "automatic va_arg instruction only works on Darwin");
5743 if (Align > MinSlotSize) {
5744 assert(((Align & (Align - 1)) == 0) &&
"Expected Align to be a power of 2");
5759 ArgSize =
std::max(ArgSize, MinSlotSize);
5760 bool NeedFPTrunc =
false;
5798 unsigned Depth = cast<ConstantSDNode>(Op.
getOperand(0))->getZExtValue();
5822 #define GET_REGISTER_MATCHER 5823 #include "AArch64GenAsmMatcher.inc" 5830 if (AArch64::X1 <= Reg && Reg <= AArch64::X28) {
5864 unsigned Depth = cast<ConstantSDNode>(Op.
getOperand(0))->getZExtValue();
5866 SDValue FrameAddr = LowerFRAMEADDR(Op, DAG);
5874 unsigned Reg = MF.
addLiveIn(AArch64::LR, &AArch64::GPR64RegClass);
5904 HiBitsForLo, CCVal, Cmp);
5916 SDValue LoForBigShift = DAG.
getNode(Opc, dl, VT, ShOpHi, ExtraShAmt);
5918 LoForNormalShift, CCVal, Cmp);
5922 SDValue HiForNormalShift = DAG.
getNode(Opc, dl, VT, ShOpHi, ShAmt);
5925 ? DAG.
getNode(Opc, dl, VT, ShOpHi,
5929 HiForNormalShift, CCVal, Cmp);
5959 LoBitsForHi, CCVal, Cmp);
5973 HiForNormalShift, CCVal, Cmp);
5980 LoForNormalShift, CCVal, Cmp);
5994 bool OptForSize)
const {
5995 bool IsLegal =
false;
6021 unsigned Limit = (OptForSize ? 1 : (Subtarget->
hasFuseLiterals() ? 5 : 2));
6022 IsLegal = Insn.
size() <= Limit;
6026 <<
" imm value: "; Imm.
dump(););
6042 if (ExtraSteps == TargetLoweringBase::ReciprocalEstimate::Unspecified)
6050 return DAG.
getNode(Opcode,
SDLoc(Operand), VT, Operand);
6060 bool Reciprocal)
const {
6062 (Enabled == ReciprocalEstimate::Unspecified && Subtarget->
useRSqrt()))
6073 for (
int i = ExtraSteps; i > 0; --i) {
6088 VT, Eq, Operand, Estimate);
6100 int &ExtraSteps)
const {
6112 for (
int i = ExtraSteps; i > 0; --i) {
6152 const char *AArch64TargetLowering::LowerXConstraint(
EVT ConstraintVT)
const {
6182 if (Constraint ==
"Upa")
6184 if (Constraint ==
"Upl")
6192 AArch64TargetLowering::getConstraintType(
StringRef Constraint)
const {
6193 if (Constraint.
size() == 1) {
6194 switch (Constraint[0]) {
6228 AArch64TargetLowering::getSingleConstraintMatchWeight(
6229 AsmOperandInfo &
info,
const char *constraint)
const {
6231 Value *CallOperandVal = info.CallOperandVal;
6234 if (!CallOperandVal)
6238 switch (*constraint) {
6259 std::pair<unsigned, const TargetRegisterClass *>
6260 AArch64TargetLowering::getRegForInlineAsmConstraint(
6262 if (Constraint.
size() == 1) {
6263 switch (Constraint[0]) {
6266 return std::make_pair(0U, &AArch64::GPR64commonRegClass);
6267 return std::make_pair(0U, &AArch64::GPR32commonRegClass);
6272 return std::make_pair(0U, &AArch64::ZPRRegClass);
6274 return std::make_pair(0U, &AArch64::FPR16RegClass);
6276 return std::make_pair(0U, &AArch64::FPR32RegClass);
6278 return std::make_pair(0U, &AArch64::FPR64RegClass);
6280 return std::make_pair(0U, &AArch64::FPR128RegClass);
6288 return std::make_pair(0U, &AArch64::ZPR_4bRegClass);
6290 return std::make_pair(0U, &AArch64::FPR128_loRegClass);
6296 return std::make_pair(0U, &AArch64::ZPR_3bRegClass);
6304 return restricted ? std::make_pair(0U, &AArch64::PPR_3bRegClass)
6305 : std::make_pair(0U, &AArch64::PPRRegClass);
6308 if (
StringRef(
"{cc}").equals_lower(Constraint))
6309 return std::make_pair(
unsigned(AArch64::NZCV), &AArch64::CCRRegClass);
6313 std::pair<unsigned, const TargetRegisterClass *> Res;
6319 if ((Size == 4 || Size == 5) && Constraint[0] ==
'{' &&
6320 tolower(Constraint[1]) ==
'v' && Constraint[Size - 1] ==
'}') {
6323 if (!Failed && RegNo >= 0 && RegNo <= 31) {
6328 Res.first = AArch64::FPR64RegClass.getRegister(RegNo);
6329 Res.second = &AArch64::FPR64RegClass;
6331 Res.first = AArch64::FPR128RegClass.getRegister(RegNo);
6332 Res.second = &AArch64::FPR128RegClass;
6338 if (Res.second && !Subtarget->
hasFPARMv8() &&
6339 !AArch64::GPR32allRegClass.hasSubClassEq(Res.second) &&
6340 !AArch64::GPR64allRegClass.hasSubClassEq(Res.second))
6341 return std::make_pair(0U,
nullptr);
6348 void AArch64TargetLowering::LowerAsmOperandForConstraint(
6349 SDValue Op, std::string &Constraint, std::vector<SDValue> &Ops,
6354 if (Constraint.length() != 1)
6357 char ConstraintLetter = Constraint[0];
6358 switch (ConstraintLetter) {
6379 GA->getValueType(0));
6381 dyn_cast<BlockAddressSDNode>(Op)) {
6385 dyn_cast<ExternalSymbolSDNode>(Op)) {
6405 switch (ConstraintLetter) {
6413 if (isUInt<12>(CVal) || isShiftedUInt<12, 12>(CVal))
6418 if (isUInt<12>(NVal) || isShiftedUInt<12, 12>(NVal)) {
6450 if ((CVal & 0xFFFF) == CVal)
6452 if ((CVal & 0xFFFF0000ULL) == CVal)
6455 if ((NCVal & 0xFFFFULL) == NCVal)
6457 if ((NCVal & 0xFFFF0000ULL) == NCVal)
6464 if ((CVal & 0xFFFFULL) == CVal)
6466 if ((CVal & 0xFFFF0000ULL) == CVal)
6468 if ((CVal & 0xFFFF00000000ULL) == CVal)
6470 if ((CVal & 0xFFFF000000000000ULL) == CVal)
6472 uint64_t NCVal = ~CVal;
6473 if ((NCVal & 0xFFFFULL) == NCVal)
6475 if ((NCVal & 0xFFFF0000ULL) == NCVal)
6477 if ((NCVal & 0xFFFF00000000ULL) == NCVal)
6479 if ((NCVal & 0xFFFF000000000000ULL) == NCVal)
6493 Ops.push_back(Result);
6541 LLVM_DEBUG(
dbgs() <<
"AArch64TargetLowering::ReconstructShuffle\n");
6546 struct ShuffleSourceInfo {
6561 ShuffleSourceInfo(
SDValue Vec)
6563 ShuffleVec(Vec), WindowBase(0), WindowScale(1) {}
6571 for (
unsigned i = 0; i < NumElts; ++i) {
6578 dbgs() <<
"Reshuffle failed: " 6579 "a shuffle can only come from building a vector from " 6580 "various elements of other vectors, provided their " 6581 "indices are constant\n");
6592 unsigned EltNo = cast<ConstantSDNode>(V.
getOperand(1))->getZExtValue();
6597 if (Sources.
size() > 2) {
6599 dbgs() <<
"Reshuffle failed: currently only do something sane when at " 6600 "most two source vectors are involved\n");
6607 for (
auto &
Source : Sources) {
6608 EVT SrcEltTy =
Source.Vec.getValueType().getVectorElementType();
6609 if (SrcEltTy.
bitsLT(SmallestEltTy)) {
6610 SmallestEltTy = SrcEltTy;
6613 unsigned ResMultiplier =
6621 for (
auto &Src : Sources) {
6622 EVT SrcVT = Src.ShuffleVec.getValueType();
6639 DAG.
getUNDEF(Src.ShuffleVec.getValueType()));
6645 if (Src.MaxElt - Src.MinElt >= NumSrcElts) {
6647 dbgs() <<
"Reshuffle failed: span too large for a VEXT to cope\n");
6651 if (Src.MinElt >= NumSrcElts) {
6656 Src.WindowBase = -NumSrcElts;
6657 }
else if (Src.MaxElt < NumSrcElts) {
6675 Src.WindowBase = -Src.MinElt;
6682 for (
auto &Src : Sources) {
6684 if (SrcEltTy == SmallestEltTy)
6689 Src.WindowBase *= Src.WindowScale;
6695 assert(Src.ShuffleVec.getValueType() == ShuffleVT););
6706 int EltNo = cast<ConstantSDNode>(Entry.
getOperand(1))->getSExtValue();
6714 int LanesDefined = BitsDefined / BitsPerShuffleLane;
6718 int *LaneMask = &
Mask[i * ResMultiplier];
6720 int ExtractBase = EltNo * Src->WindowScale + Src->WindowBase;
6721 ExtractBase += NumElts * (Src - Sources.begin());
6722 for (
int j = 0; j < LanesDefined; ++j)
6723 LaneMask[j] = ExtractBase + j;
6728 LLVM_DEBUG(
dbgs() <<
"Reshuffle failed: illegal shuffle mask\n");
6733 for (
unsigned i = 0; i < Sources.size(); ++i)
6734 ShuffleOps[i] = Sources[i].ShuffleVec;
6737 ShuffleOps[1],
Mask);
6741 dbgs() <<
"Reshuffle, creating node: "; V.
dump(););
6760 unsigned ExpectedElt = Imm;
6761 for (
unsigned i = 1; i < NumElts; ++i) {
6765 if (ExpectedElt == NumElts)
6770 if (ExpectedElt != static_cast<unsigned>(M[i]))
6782 const int *FirstRealElt =
find_if(M, [](
int Elt) {
return Elt >= 0; });
6787 APInt ExpectedElt =
APInt(MaskBits, *FirstRealElt + 1);
6791 [&](
int Elt) {
return Elt != ExpectedElt++ && Elt != -1;});
6792 if (FirstWrongElt != M.
end())
6821 assert((BlockSize == 16 || BlockSize == 32 || BlockSize == 64) &&
6822 "Only possible block sizes for REV are: 16, 32, 64");
6829 unsigned BlockElts = M[0] + 1;
6832 BlockElts = BlockSize / EltSz;
6834 if (BlockSize <= EltSz || BlockSize != BlockElts * EltSz)
6837 for (
unsigned i = 0; i < NumElts; ++i) {
6840 if ((
unsigned)M[i] != (i - i % BlockElts) + (BlockElts - 1 - i % BlockElts))
6849 if (NumElts % 2 != 0)
6851 WhichResult = (M[0] == 0 ? 0 : 1);
6852 unsigned Idx = WhichResult * NumElts / 2;
6853 for (
unsigned i = 0; i != NumElts; i += 2) {
6854 if ((M[i] >= 0 && (
unsigned)M[i] != Idx) ||
6855 (M[i + 1] >= 0 && (
unsigned)M[i + 1] != Idx + NumElts))
6865 WhichResult = (M[0] == 0 ? 0 : 1);
6866 for (
unsigned i = 0; i != NumElts; ++i) {
6869 if ((
unsigned)M[i] != 2 * i + WhichResult)
6878 if (NumElts % 2 != 0)
6880 WhichResult = (M[0] == 0 ? 0 : 1);
6881 for (
unsigned i = 0; i < NumElts; i += 2) {
6882 if ((M[i] >= 0 && (
unsigned)M[i] != i + WhichResult) ||
6883 (M[i + 1] >= 0 && (
unsigned)M[i + 1] != i + NumElts + WhichResult))
6894 if (NumElts % 2 != 0)
6896 WhichResult = (M[0] == 0 ? 0 : 1);
6897 unsigned Idx = WhichResult * NumElts / 2;
6898 for (
unsigned i = 0; i != NumElts; i += 2) {
6899 if ((M[i] >= 0 && (
unsigned)M[i] != Idx) ||
6900 (M[i + 1] >= 0 && (
unsigned)M[i + 1] != Idx))
6913 WhichResult = (M[0] == 0 ? 0 : 1);
6914 for (
unsigned j = 0; j != 2; ++j) {
6915 unsigned Idx = WhichResult;
6916 for (
unsigned i = 0; i != Half; ++i) {
6917 int MIdx = M[i + j * Half];
6918 if (MIdx >= 0 && (
unsigned)MIdx != Idx)
6932 if (NumElts % 2 != 0)
6934 WhichResult = (M[0] == 0 ? 0 : 1);
6935 for (
unsigned i = 0; i < NumElts; i += 2) {
6936 if ((M[i] >= 0 && (
unsigned)M[i] != i + WhichResult) ||
6937 (M[i + 1] >= 0 && (
unsigned)M[i + 1] != i + WhichResult))
6944 bool &DstIsLeft,
int &Anomaly) {
6945 if (M.
size() !=
static_cast<size_t>(NumInputElements))
6948 int NumLHSMatch = 0, NumRHSMatch = 0;
6949 int LastLHSMismatch = -1, LastRHSMismatch = -1;
6951 for (
int i = 0; i < NumInputElements; ++i) {
6961 LastLHSMismatch = i;
6963 if (M[i] == i + NumInputElements)
6966 LastRHSMismatch = i;
6969 if (NumLHSMatch == NumInputElements - 1) {
6971 Anomaly = LastLHSMismatch;
6973 }
else if (NumRHSMatch == NumInputElements - 1) {
6975 Anomaly = LastRHSMismatch;
6988 for (
int I = 0,
E = NumElts / 2;
I !=
E;
I++) {
6993 int Offset = NumElts / 2;
6994 for (
int I = NumElts / 2,
E = NumElts;
I !=
E;
I++) {
6995 if (Mask[
I] !=
I + SplitLHS * Offset)
7035 unsigned OpNum = (PFEntry >> 26) & 0x0F;
7036 unsigned LHSID = (PFEntry >> 13) & ((1 << 13) - 1);
7037 unsigned RHSID = (PFEntry >> 0) & ((1 << 13) - 1);
7058 if (LHSID == (1 * 9 + 2) * 9 + 3)
7060 assert(LHSID == ((4 * 9 + 5) * 9 + 6) * 9 + 7 &&
"Illegal OP_COPY!");
7104 return DAG.
getNode(Opcode, dl, VT, OpLHS, Lane);
7145 for (
int Val : ShuffleMask) {
7146 for (
unsigned Byte = 0; Byte < BytesPerElt; ++Byte) {
7147 unsigned Offset = Byte + Val * BytesPerElt;
7153 unsigned IndexLen = 8;
7172 if (IndexLen == 8) {
7244 auto getScaledOffsetDup = [](
SDValue BitCast,
int &LaneC,
MVT &CastVT) {
7255 unsigned ExtIdxInBits = ExtIdx * SrcEltBitWidth;
7257 if (ExtIdxInBits % CastedEltBitWidth != 0)
7261 LaneC += ExtIdxInBits / CastedEltBitWidth;
7268 unsigned SrcVecNumElts =
7275 if (getScaledOffsetDup(V1, Lane, CastVT)) {
7302 bool ReverseEXT =
false;
7304 if (
isEXTMask(ShuffleMask, VT, ReverseEXT, Imm)) {
7316 unsigned WhichResult;
7317 if (
isZIPMask(ShuffleMask, VT, WhichResult)) {
7321 if (
isUZPMask(ShuffleMask, VT, WhichResult)) {
7325 if (
isTRNMask(ShuffleMask, VT, WhichResult)) {
7349 if (
isINSMask(ShuffleMask, NumInputElements, DstIsLeft, Anomaly)) {
7354 int SrcLane = ShuffleMask[Anomaly];
7355 if (SrcLane >= NumInputElements) {
7376 unsigned PFIndexes[4];
7377 for (
unsigned i = 0; i != 4; ++i) {
7378 if (ShuffleMask[i] < 0)
7381 PFIndexes[i] = ShuffleMask[i];
7385 unsigned PFTableIndex = PFIndexes[0] * 9 * 9 * 9 + PFIndexes[1] * 9 * 9 +
7386 PFIndexes[2] * 9 + PFIndexes[3];
7388 unsigned Cost = (PFEntry >> 30);
7440 APInt SplatBits, SplatUndef;
7441 unsigned SplatBitSize;
7443 if (BVN->
isConstantSplat(SplatBits, SplatUndef, SplatBitSize, HasAnyUndefs)) {
7446 for (
unsigned i = 0; i < NumSplats; ++i) {
7447 CnstBits <<= SplatBitSize;
7448 UndefBits <<= SplatBitSize;
7450 UndefBits |= (SplatBits ^ SplatUndef).zextOrTrunc(VT.
getSizeInBits());
7483 const SDValue *LHS =
nullptr) {
7488 bool isAdvSIMDModImm =
false;
7508 if (isAdvSIMDModImm) {
7513 Mov = DAG.
getNode(NewOp, dl, MovTy, *LHS,
7517 Mov = DAG.
getNode(NewOp, dl, MovTy,
7531 const SDValue *LHS =
nullptr) {
7536 bool isAdvSIMDModImm =
false;
7548 if (isAdvSIMDModImm) {
7553 Mov = DAG.
getNode(NewOp, dl, MovTy, *LHS,
7557 Mov = DAG.
getNode(NewOp, dl, MovTy,
7575 bool isAdvSIMDModImm =
false;
7587 if (isAdvSIMDModImm) {
7628 bool isAdvSIMDModImm =
false;
7640 if (isAdvSIMDModImm) {
7655 uint64_t &ConstVal) {
7664 for (
unsigned i = 1; i < NumElts; ++i)
7665 if (dyn_cast<ConstantSDNode>(Bvec->
getOperand(i)) != FirstElt)
7677 unsigned IID = cast<ConstantSDNode>(N->
getOperand(0))->getZExtValue();
7678 if (IID < Intrinsic::num_intrinsics)
7725 if (C2 > ElemSizeInBits)
7727 unsigned ElemMask = (1 << ElemSizeInBits) - 1;
7728 if ((C1 & ElemMask) != (~C2 & ElemMask))
7735 IsShiftRight ? Intrinsic::aarch64_neon_vsri : Intrinsic::aarch64_neon_vsli;
7783 UndefBits, &LHS)) ||
7811 if (
auto *CstLane = dyn_cast<ConstantSDNode>(Lane)) {
7813 CstLane->getZExtValue());
7815 }
else if (Lane.getNode()->isUndef()) {
7819 "Unexpected BUILD_VECTOR operand type");
7848 DefBits = UndefBits;
7857 DefBits = ~UndefBits;
7883 Const->getAPIntValue().zextOrTrunc(BitSize).getZExtValue());
7884 if (Val.isNullValue() || Val.isAllOnesValue())
7906 bool isOnlyLowElement =
true;
7907 bool usesOnlyOneValue =
true;
7908 bool usesOnlyOneConstantValue =
true;
7910 bool AllLanesExtractElt =
true;
7911 unsigned NumConstantLanes = 0;
7914 for (
unsigned i = 0; i < NumElts; ++i) {
7917 AllLanesExtractElt =
false;
7921 isOnlyLowElement =
false;
7922 if (!isa<ConstantFPSDNode>(V) && !isa<ConstantSDNode>(V))
7925 if (isa<ConstantSDNode>(V) || isa<ConstantFPSDNode>(V)) {
7929 else if (ConstantValue != V)
7930 usesOnlyOneConstantValue =
false;
7935 else if (V != Value)
7936 usesOnlyOneValue =
false;
7941 dbgs() <<
"LowerBUILD_VECTOR: value undefined, creating undef node\n");
7948 if (isOnlyLowElement && !(NumElts == 1 && isa<ConstantSDNode>(Value))) {
7949 LLVM_DEBUG(
dbgs() <<
"LowerBUILD_VECTOR: only low element used, creating 1 " 7950 "SCALAR_TO_VECTOR node\n");
7954 if (AllLanesExtractElt) {
7960 for (
unsigned i = 0; i < NumElts; ++i) {
7975 }
else if (Vector != N0.
getNode()) {
7988 if (Val - 1 == 2 * i) {
8017 if (usesOnlyOneValue) {
8022 dbgs() <<
"LowerBUILD_VECTOR: use DUP for non-constant splats\n");
8032 dbgs() <<
"LowerBUILD_VECTOR: DUPLANE works on 128-bit vectors, " 8038 return DAG.
getNode(Opcode, dl, VT, Value, Lane);
8045 "Unsupported floating-point vector type");
8047 dbgs() <<
"LowerBUILD_VECTOR: float constant splats, creating int " 8048 "BITCASTS, and try again\n");
8050 for (
unsigned i = 0; i < NumElts; ++i)
8054 LLVM_DEBUG(
dbgs() <<
"LowerBUILD_VECTOR: trying to lower new vector: ";
8056 Val = LowerBUILD_VECTOR(Val, DAG);
8066 if (NumConstantLanes > 0 && usesOnlyOneConstantValue) {
8077 for (
unsigned i = 0; i < NumElts; ++i) {
8080 if (!isa<ConstantSDNode>(V) && !isa<ConstantFPSDNode>(V))
8091 dbgs() <<
"LowerBUILD_VECTOR: all elements are constant, use default " 8108 if (!isConstant && !usesOnlyOneValue) {
8110 dbgs() <<
"LowerBUILD_VECTOR: alternatives failed, creating sequence " 8111 "of INSERT_VECTOR_ELT\n");
8128 LLVM_DEBUG(
dbgs() <<
"Creating node for op0, it is not undefined:\n");
8133 <<
"Creating nodes for the other vector elements:\n";);
8134 for (; i < NumElts; ++i) {
8145 dbgs() <<
"LowerBUILD_VECTOR: use default expansion, failed to find " 8146 "better alternative\n");
8150 SDValue AArch64TargetLowering::LowerINSERT_VECTOR_ELT(
SDValue Op,
8157 if (!CI || CI->
getZExtValue() >= VT.getVectorNumElements())
8184 AArch64TargetLowering::LowerEXTRACT_VECTOR_ELT(
SDValue Op,
8191 if (!CI || CI->
getZExtValue() >= VT.getVectorNumElements())
8220 SDValue AArch64TargetLowering::LowerEXTRACT_SUBVECTOR(
SDValue Op,
8250 unsigned PFIndexes[4];
8251 for (
unsigned i = 0; i != 4; ++i) {
8255 PFIndexes[i] = M[i];
8259 unsigned PFTableIndex = PFIndexes[0] * 9 * 9 * 9 + PFIndexes[1] * 9 * 9 +
8260 PFIndexes[2] * 9 + PFIndexes[3];
8262 unsigned Cost = (PFEntry >> 30);
8270 unsigned DummyUnsigned;
8274 isEXTMask(M, VT, DummyBool, DummyUnsigned) ||
8293 APInt SplatBits, SplatUndef;
8294 unsigned SplatBitSize;
8296 if (!BVN || !BVN->
isConstantSplat(SplatBits, SplatUndef, SplatBitSize,
8297 HasAnyUndefs, ElementBits) ||
8298 SplatBitSize > ElementBits)
8309 assert(VT.
isVector() &&
"vector shift count is not a vector type");
8313 return (Cnt >= 0 && (isLong ? Cnt - 1 : Cnt) < ElementBits);
8320 assert(VT.
isVector() &&
"vector shift count is not a vector type");
8324 return (Cnt >= 1 && Cnt <= (isNarrow ? ElementBits / 2 : ElementBits));
8327 SDValue AArch64TargetLowering::LowerVectorSRA_SRL_SHL(
SDValue Op,
8363 : Intrinsic::aarch64_neon_ushl;
8370 return NegShiftLeft;
8381 "function only supposed to emit natural comparisons");
8387 bool IsZero = IsCnst && (CnstBits == 0);
8487 const bool FullFP16 =
8579 if (!Subtarget.hasLSE())
8596 if (!Subtarget.hasLSE())
8610 SDValue AArch64TargetLowering::LowerWindowsDYNAMIC_STACKALLOC(
8618 if (Subtarget->hasCustomCallingConv())
8639 AArch64TargetLowering::LowerDYNAMIC_STACKALLOC(
SDValue Op,
8641 assert(Subtarget->isTargetWindows() &&
8642 "Only Windows alloca probing supported");
8648 unsigned Align = cast<ConstantSDNode>(Op.
getOperand(2))->getZExtValue();
8652 "no-stack-arg-probe")) {
8666 Chain = LowerWindowsDYNAMIC_STACKALLOC(Op, Chain, Size, DAG);
8689 unsigned Intrinsic)
const {
8691 switch (Intrinsic) {
8692 case Intrinsic::aarch64_neon_ld2:
8693 case Intrinsic::aarch64_neon_ld3:
8694 case Intrinsic::aarch64_neon_ld4:
8695 case Intrinsic::aarch64_neon_ld1x2:
8696 case Intrinsic::aarch64_neon_ld1x3:
8697 case Intrinsic::aarch64_neon_ld1x4:
8698 case Intrinsic::aarch64_neon_ld2lane:
8699 case Intrinsic::aarch64_neon_ld3lane:
8700 case Intrinsic::aarch64_neon_ld4lane:
8701 case Intrinsic::aarch64_neon_ld2r:
8702 case Intrinsic::aarch64_neon_ld3r:
8703 case Intrinsic::aarch64_neon_ld4r: {
8706 uint64_t NumElts = DL.getTypeSizeInBits(I.
getType()) / 64;
8715 case Intrinsic::aarch64_neon_st2:
8716 case Intrinsic::aarch64_neon_st3:
8717 case Intrinsic::aarch64_neon_st4:
8718 case Intrinsic::aarch64_neon_st1x2:
8719 case Intrinsic::aarch64_neon_st1x3:
8720 case Intrinsic::aarch64_neon_st1x4:
8721 case Intrinsic::aarch64_neon_st2lane:
8722 case Intrinsic::aarch64_neon_st3lane:
8723 case Intrinsic::aarch64_neon_st4lane: {
8726 unsigned NumElts = 0;
8731 NumElts += DL.getTypeSizeInBits(ArgTy) / 64;
8741 case Intrinsic::aarch64_ldaxr:
8742 case Intrinsic::aarch64_ldxr: {
8752 case Intrinsic::aarch64_stlxr:
8753 case Intrinsic::aarch64_stxr: {
8763 case Intrinsic::aarch64_ldaxp:
8764 case Intrinsic::aarch64_ldxp:
8772 case Intrinsic::aarch64_stlxp:
8773 case Intrinsic::aarch64_stxp:
8781 case Intrinsic::aarch64_sve_ldnt1: {
8791 case Intrinsic::aarch64_sve_stnt1: {
8832 if (ShiftAmount ==
Log2_32(LoadBytes))
8845 return NumBits1 > NumBits2;
8852 return NumBits1 > NumBits2;
8859 if (I->
getOpcode() != Instruction::FMul)
8868 !(User->
getOpcode() == Instruction::FSub ||
8869 User->
getOpcode() == Instruction::FAdd))
8890 return NumBits1 == 32 && NumBits2 == 64;
8897 return NumBits1 == 32 && NumBits2 == 64;
8915 bool AArch64TargetLowering::isExtFreeImpl(
const Instruction *
Ext)
const {
8916 if (isa<FPExtInst>(Ext))
8923 for (
const Use &U : Ext->
uses()) {
8928 const Instruction *Instr = cast<Instruction>(U.getUser());
8932 case Instruction::Shl:
8936 case Instruction::GetElementPtr: {
8939 std::advance(GTI, U.getOperandNo()-1);
8949 if (ShiftAmt == 0 || ShiftAmt > 4)
8953 case Instruction::Trunc:
8972 auto areTypesHalfed = [](
Value *FullV,
Value *HalfV) {
8973 auto *FullVT = cast<VectorType>(FullV->
getType());
8974 auto *HalfVT = cast<VectorType>(HalfV->getType());
8975 return FullVT->getBitWidth() == 2 * HalfVT->getBitWidth();
8978 auto extractHalf = [](
Value *FullV,
Value *HalfV) {
8979 auto *FullVT = cast<VectorType>(FullV->
getType());
8980 auto *HalfVT = cast<VectorType>(HalfV->getType());
8981 return FullVT->getNumElements() == 2 * HalfVT->getNumElements();
8985 Value *S1Op1, *S2Op1;
8992 if (!areTypesHalfed(S1Op1, Op1) || !areTypesHalfed(S2Op1, Op2) ||
8993 !extractHalf(S1Op1, Op1) || !extractHalf(S2Op1, Op2))
9000 int NumElements = cast<VectorType>(Op1->
getType())->getNumElements() * 2;
9003 M1Start != M2Start || (M1Start != 0 && M2Start != (NumElements / 2)))
9019 !areExtDoubled(cast<Instruction>(Ext1)) ||
9020 !areExtDoubled(cast<Instruction>(Ext2)))
9035 switch (II->getIntrinsicID()) {
9036 case Intrinsic::aarch64_neon_umull:
9048 case Instruction::Sub:
9055 auto Ext1 = cast<Instruction>(I->
getOperand(0));
9056 auto Ext2 = cast<Instruction>(I->
getOperand(1));
9074 unsigned &RequiredAligment)
const {
9079 RequiredAligment = 0;
9081 return NumBits == 32 || NumBits == 64;
9111 if (ElSize != 8 && ElSize != 16 && ElSize != 32 && ElSize != 64)
9116 return VecSize == 64 || VecSize % 128 == 0;
9134 "Invalid interleave factor");
9135 assert(!Shuffles.
empty() &&
"Empty shufflevector input");
9137 "Unmatched number of shufflevectors and indices");
9178 Type *Tys[2] = {VecTy, PtrTy};
9179 static const Intrinsic::ID LoadInts[3] = {Intrinsic::aarch64_neon_ld2,
9180 Intrinsic::aarch64_neon_ld3,
9181 Intrinsic::aarch64_neon_ld4};
9190 for (
unsigned LoadCount = 0; LoadCount < NumLoads; ++LoadCount) {
9203 for (
unsigned i = 0; i < Shuffles.
size(); i++) {
9205 unsigned Index = Indices[i];
9214 SubVecs[SVI].push_back(SubVec);
9223 auto &SubVec = SubVecs[SVI];
9226 SVI->replaceAllUsesWith(WideVec);
9260 unsigned Factor)
const {
9262 "Invalid interleave factor");
9266 "Invalid interleaved store");
9303 if (NumStores > 1) {
9306 LaneLen /= NumStores;
9320 Type *Tys[2] = {SubVecTy, PtrTy};
9321 static const Intrinsic::ID StoreInts[3] = {Intrinsic::aarch64_neon_st2,
9322 Intrinsic::aarch64_neon_st3,
9323 Intrinsic::aarch64_neon_st4};
9327 for (
unsigned StoreCount = 0; StoreCount < NumStores; ++StoreCount) {
9332 for (
unsigned i = 0; i < Factor; i++) {
9333 unsigned IdxI = StoreCount * LaneLen * Factor + i;
9334 if (
Mask[IdxI] >= 0) {
9338 unsigned StartMask = 0;
9339 for (
unsigned j = 1; j < LaneLen; j++) {
9340 unsigned IdxJ = StoreCount * LaneLen * Factor + j;
9341 if (
Mask[IdxJ * Factor + IdxI] >= 0) {
9342 StartMask =
Mask[IdxJ * Factor + IdxI] - IdxJ;
9360 BaseAddr, LaneLen * Factor);
9369 unsigned AlignCheck) {
9370 return ((SrcAlign == 0 || SrcAlign % AlignCheck == 0) &&
9371 (DstAlign == 0 || DstAlign % AlignCheck == 0));
9375 uint64_t Size,
unsigned DstAlign,
unsigned SrcAlign,
bool IsMemset,
9376 bool ZeroMemset,
bool MemcpyStrSrc,
9378 bool CanImplicitFloat =
9380 bool CanUseNEON = Subtarget->hasNEON() && CanImplicitFloat;
9381 bool CanUseFP = Subtarget->hasFPARMv8() && CanImplicitFloat;
9385 bool IsSmallMemset = IsMemset && Size < 32;
9386 auto AlignmentIsAcceptable = [&](
EVT VT,
unsigned AlignCheck) {
9387 if (
memOpAlign(SrcAlign, DstAlign, AlignCheck))
9395 if (CanUseNEON && IsMemset && !IsSmallMemset &&
9398 if (CanUseFP && !IsSmallMemset && AlignmentIsAcceptable(
MVT::f128, 16))
9400 if (Size >= 8 && AlignmentIsAcceptable(
MVT::i64, 8))
9402 if (Size >= 4 && AlignmentIsAcceptable(
MVT::i32, 4))
9408 uint64_t Size,
unsigned DstAlign,
unsigned SrcAlign,
bool IsMemset,
9409 bool ZeroMemset,
bool MemcpyStrSrc,
9411 bool CanImplicitFloat =
9413 bool CanUseNEON = Subtarget->hasNEON() && CanImplicitFloat;
9414 bool CanUseFP = Subtarget->hasFPARMv8() && CanImplicitFloat;
9418 bool IsSmallMemset = IsMemset && Size < 32;
9419 auto AlignmentIsAcceptable = [&](
EVT VT,
unsigned AlignCheck) {
9420 if (
memOpAlign(SrcAlign, DstAlign, AlignCheck))
9428 if (CanUseNEON && IsMemset && !IsSmallMemset &&
9431 if (CanUseFP && !IsSmallMemset && AlignmentIsAcceptable(
MVT::f128, 16))
9433 if (Size >= 8 && AlignmentIsAcceptable(
MVT::i64, 8))
9435 if (Size >= 4 && AlignmentIsAcceptable(
MVT::i32, 4))
9442 if (Immed == std::numeric_limits<int64_t>::min()) {
9444 <<
": avoid UB for INT64_MIN\n");
9449 bool IsLegal = ((Immed >> 12) == 0 ||
9450 ((Immed & 0xfff) == 0 && Immed >> 24 == 0));
9452 <<
" legal add imm: " << (IsLegal ?
"yes" :
"no") <<
"\n");
9484 uint64_t NumBytes = 0;
9487 NumBytes = NumBits / 8;
9496 if (isInt<9>(Offset))
9500 unsigned shift =
Log2_64(NumBytes);
9501 if (NumBytes && Offset > 0 && (Offset / NumBytes) <= (1LL << 12) - 1 &&
9503 (Offset >> shift) << shift == Offset)
9510 return AM.
Scale == 1 || (AM.
Scale > 0 && (uint64_t)AM.
Scale == NumBytes);
9520 unsigned AS)
const {
9569 static const MCPhysReg ScratchRegs[] = {
9570 AArch64::X16, AArch64::X17, AArch64::LR, 0
9605 if ((int64_t)Val < 0)
9608 Val &= (1LL << 32) - 1;
9611 unsigned Shift = (63 - LZ) / 16;
9617 unsigned Index)
const {
9645 if (!ShiftAmt || ShiftAmt->getZExtValue() != ShiftEltTy.getSizeInBits() - 1)
9692 AArch64TargetLowering::BuildSDIVPow2(
SDNode *N,
const APInt &Divisor,
9702 !(Divisor.
isPowerOf2() || (-Divisor).isPowerOf2()))
9738 case Intrinsic::aarch64_sve_cntb:
9739 case Intrinsic::aarch64_sve_cnth:
9740 case Intrinsic::aarch64_sve_cntw:
9741 case Intrinsic::aarch64_sve_cntd:
9766 if (ConstValue.sge(1) && ConstValue.sle(16))
9781 unsigned TrailingZeroes = ConstValue.countTrailingZeros();
9782 if (TrailingZeroes) {
9796 APInt ShiftedConstValue = ConstValue.
ashr(TrailingZeroes);
9798 unsigned ShiftAmt, AddSubOpc;
9800 bool ShiftValUseIsN0 =
true;
9802 bool NegateResult =
false;
9804 if (ConstValue.isNonNegative()) {
9808 APInt SCVMinus1 = ShiftedConstValue - 1;
9809 APInt CVPlus1 = ConstValue + 1;
9821 APInt CVNegPlus1 = -ConstValue + 1;
9822 APInt CVNegMinus1 = -ConstValue - 1;
9826 ShiftValUseIsN0 =
false;
9830 NegateResult =
true;
9840 SDValue AddSubN0 = ShiftValUseIsN0 ? ShiftedVal : N0;
9841 SDValue AddSubN1 = ShiftValUseIsN0 ? N0 : ShiftedVal;
9842 SDValue Res = DAG.
getNode(AddSubOpc, DL, VT, AddSubN0, AddSubN1);
9843 assert(!(NegateResult && TrailingZeroes) &&
9844 "NegateResult and TrailingZeroes cannot both be true for now.");
9881 if (!BV->isConstant())
9886 EVT IntVT = BV->getValueType(0);
9957 if (!isa<BuildVectorSDNode>(ConstVec))
9962 if (FloatBits != 32 && FloatBits != 64)
9967 if (IntBits != 16 && IntBits != 32 && IntBits != 64)
9971 if (IntBits > FloatBits)
9976 int32_t
Bits = IntBits == 64 ? 64 : 32;
9978 if (C == -1 || C == 0 || C > Bits)
9998 "Illegal vector type after legalization");
10002 unsigned IntrinsicOpcode = IsSigned ? Intrinsic::aarch64_neon_vcvtfp2fxs
10003 : Intrinsic::aarch64_neon_vcvtfp2fxu;
10009 if (IntBits < FloatBits)
10031 if (!isa<BuildVectorSDNode>(ConstVec))
10036 if (IntBits != 16 && IntBits != 32 && IntBits != 64)
10041 if (FloatBits != 32 && FloatBits != 64)
10045 if (IntBits > FloatBits)
10051 if (C == -1 || C == 0 || C > FloatBits)
10056 switch (NumLanes) {
10073 if (IntBits < FloatBits)
10077 unsigned IntrinsicOpcode = IsSigned ? Intrinsic::aarch64_neon_vcvtfxs2fp
10078 : Intrinsic::aarch64_neon_vcvtfxu2fp;
10121 bool LHSFromHi =
false;
10127 bool RHSFromHi =
false;
10133 if (LHSFromHi == RHSFromHi)
10168 uint64_t BitMask = Bits == 64 ? -1ULL : ((1ULL <<
Bits) - 1);
10169 for (
int i = 1; i >= 0; --i)
10170 for (
int j = 1; j >= 0; --j) {
10173 if (!BVN0 || !BVN1)
10176 bool FoundMatch =
true;
10180 if (!CN0 || !CN1 ||
10181 CN0->
getZExtValue() != (BitMask & ~CN1->getZExtValue())) {
10182 FoundMatch =
false;
10217 uint64_t MaskForTy = 0ull;
10220 MaskForTy = 0xffull;
10223 MaskForTy = 0xffffull;
10226 MaskForTy = 0xffffffffull;
10234 if (
auto *Op0 = dyn_cast<ConstantSDNode>(N->
getOperand(0)))
10235 return Op0->getAPIntValue().getLimitedValue() == MaskForTy;
10299 DefBits = ~DefBits;
10306 UndefBits = ~UndefBits;
10308 UndefBits, &LHS)) ||
10333 uint64_t ShiftAmt =
C->getZExtValue();
10334 if (VT ==
MVT::i32 && ShiftAmt == 16 &&
10337 if (VT ==
MVT::i64 && ShiftAmt == 32 &&
10375 for (
size_t i = 0; i <
Mask.size(); ++i)
10417 dbgs() <<
"aarch64-lower: concat_vectors bitcast simplification\n");
10459 "unexpected vector size on extract_vector_elt!");
10529 return cast<ConstantSDNode>(N.
getOperand(1))->getAPIntValue() ==
10586 cast<ConstantSDNode>(Op.
getOperand(2))->getZExtValue());
10595 if (!TValue || !FValue)
10599 if (!TValue->
isOne()) {
10605 return TValue->
isOne() && FValue->isNullValue();
10731 "unexpected shape for long operation");
10754 int64_t ShiftAmount;
10756 APInt SplatValue, SplatUndef;
10757 unsigned SplatBitSize;
10759 if (!BVN->isConstantSplat(SplatValue, SplatUndef, SplatBitSize,
10760 HasAnyUndefs, ElemBits) ||
10761 SplatBitSize != ElemBits)
10766 ShiftAmount = CVN->getSExtValue();
10775 case Intrinsic::aarch64_neon_sqshl:
10777 IsRightShift =
false;
10779 case Intrinsic::aarch64_neon_uqshl:
10781 IsRightShift =
false;
10783 case Intrinsic::aarch64_neon_srshl:
10785 IsRightShift =
true;
10787 case Intrinsic::aarch64_neon_urshl:
10789 IsRightShift =
true;
10791 case Intrinsic::aarch64_neon_sqshlu:
10793 IsRightShift =
false;
10795 case Intrinsic::aarch64_neon_sshl:
10796 case Intrinsic::aarch64_neon_ushl:
10801 IsRightShift =
false;
10805 if (IsRightShift && ShiftAmount <= -1 && ShiftAmount >= -(
int)ElemBits) {
10809 }
else if (!IsRightShift && ShiftAmount >= 0 && ShiftAmount < ElemBits) {
10920 case Intrinsic::aarch64_sve_cmpeq_wide:
10921 case Intrinsic::aarch64_sve_cmpne_wide:
10922 case Intrinsic::aarch64_sve_cmpge_wide:
10923 case Intrinsic::aarch64_sve_cmpgt_wide:
10924 case Intrinsic::aarch64_sve_cmplt_wide:
10925 case Intrinsic::aarch64_sve_cmple_wide: {
10926 if (
auto *CN = dyn_cast<ConstantSDNode>(Comparator.
getOperand(0))) {
10927 int64_t ImmVal = CN->getSExtValue();
10928 if (ImmVal >= -16 && ImmVal <= 15)
10936 case Intrinsic::aarch64_sve_cmphs_wide:
10937 case Intrinsic::aarch64_sve_cmphi_wide:
10938 case Intrinsic::aarch64_sve_cmplo_wide:
10939 case Intrinsic::aarch64_sve_cmpls_wide: {
10940 if (
auto *CN = dyn_cast<ConstantSDNode>(Comparator.
getOperand(0))) {
10941 uint64_t ImmVal = CN->getZExtValue();
10962 ID, Pred, Op0, Op1);
10975 "Expected legal scalable vector type!");
11000 case Intrinsic::aarch64_neon_vcvtfxs2fp:
11001 case Intrinsic::aarch64_neon_vcvtfxu2fp:
11003 case Intrinsic::aarch64_neon_saddv:
11005 case Intrinsic::aarch64_neon_uaddv:
11007 case Intrinsic::aarch64_neon_sminv:
11009 case Intrinsic::aarch64_neon_uminv:
11011 case Intrinsic::aarch64_neon_smaxv:
11013 case Intrinsic::aarch64_neon_umaxv:
11015 case Intrinsic::aarch64_neon_fmax:
11018 case Intrinsic::aarch64_neon_fmin:
11021 case Intrinsic::aarch64_neon_fmaxnm:
11024 case Intrinsic::aarch64_neon_fminnm:
11027 case Intrinsic::aarch64_neon_smull:
11028 case Intrinsic::aarch64_neon_umull:
11029 case Intrinsic::aarch64_neon_pmull:
11030 case Intrinsic::aarch64_neon_sqdmull:
11032 case Intrinsic::aarch64_neon_sqshl:
11033 case Intrinsic::aarch64_neon_uqshl:
11034 case Intrinsic::aarch64_neon_sqshlu:
11035 case Intrinsic::aarch64_neon_srshl:
11036 case Intrinsic::aarch64_neon_urshl:
11037 case Intrinsic::aarch64_neon_sshl:
11038 case Intrinsic::aarch64_neon_ushl:
11040 case Intrinsic::aarch64_crc32b:
11041 case Intrinsic::aarch64_crc32cb:
11043 case Intrinsic::aarch64_crc32h:
11044 case Intrinsic::aarch64_crc32ch:
11046 case Intrinsic::aarch64_sve_smaxv:
11048 case Intrinsic::aarch64_sve_umaxv:
11050 case Intrinsic::aarch64_sve_sminv:
11052 case Intrinsic::aarch64_sve_uminv:
11054 case Intrinsic::aarch64_sve_orv:
11056 case Intrinsic::aarch64_sve_eorv:
11058 case Intrinsic::aarch64_sve_andv:
11060 case Intrinsic::aarch64_sve_ext:
11062 case Intrinsic::aarch64_sve_cmpeq_wide:
11065 case Intrinsic::aarch64_sve_cmpne_wide:
11068 case Intrinsic::aarch64_sve_cmpge_wide:
11071 case Intrinsic::aarch64_sve_cmpgt_wide:
11074 case Intrinsic::aarch64_sve_cmplt_wide:
11077 case Intrinsic::aarch64_sve_cmple_wide:
11080 case Intrinsic::aarch64_sve_cmphs_wide:
11083 case Intrinsic::aarch64_sve_cmphi_wide:
11086 case Intrinsic::aarch64_sve_cmplo_wide:
11089 case Intrinsic::aarch64_sve_cmpls_wide:
11092 case Intrinsic::aarch64_sve_ptest_any:
11095 case Intrinsic::aarch64_sve_ptest_first:
11098 case Intrinsic::aarch64_sve_ptest_last:
11116 if (IID == Intrinsic::aarch64_neon_sabd ||
11117 IID == Intrinsic::aarch64_neon_uabd) {
11185 assert(!(NumElements & 1) &&
"Splitting vector, but not in half!");
11204 SDValue SplatVal,
unsigned NumVecElts) {
11215 uint64_t BaseOffset = 0;
11223 if (BasePtr->getOpcode() ==
ISD::ADD &&
11224 isa<ConstantSDNode>(BasePtr->getOperand(1))) {
11225 BaseOffset = cast<ConstantSDNode>(BasePtr->getOperand(1))->getSExtValue();
11226 BasePtr = BasePtr->getOperand(0);
11229 unsigned Offset = EltOffset;
11230 while (--NumVecElts) {
11231 unsigned Alignment =
MinAlign(OrigAlignment, Offset);
11236 PtrInfo.getWithOffset(Offset), Alignment,
11238 Offset += EltOffset;
11252 auto *MINode = cast<MemIntrinsicSDNode>(
N);
11255 MINode->getOperand(3), DAG.
getUNDEF(PtrTy),
11257 MINode->getMemoryVT(), MINode->getMemOperand(),
11278 auto *MINode = cast<MemIntrinsicSDNode>(
N);
11281 MINode->getMemoryVT(), MINode->getMemOperand(),
11307 if (!(((NumVecElts == 2 || NumVecElts == 3) &&
11309 ((NumVecElts == 2 || NumVecElts == 3 || NumVecElts == 4) &&
11331 if (Offset < -512 || Offset > 504)
11335 for (
int I = 0;
I < NumVecElts; ++
I) {
11347 ZeroReg = AArch64::WZR;
11350 ZeroReg = AArch64::XZR;
11374 if (NumVecElts != 4 && NumVecElts != 2)
11385 std::bitset<4> IndexNotInserted((1 << NumVecElts) - 1);
11387 for (
unsigned I = 0;
I < NumVecElts; ++
I) {
11403 if (IndexVal >= NumVecElts)
11405 IndexNotInserted.reset(IndexVal);
11410 if (IndexNotInserted.any())
11433 return ReplacedZeroSplat;
11464 return ReplacedSplat;
11497 unsigned LoadIdx = IsLaneOp ? 1 : 0;
11522 if (UI.getUse().getResNo() == 1)
11535 || UI.getUse().getResNo() != Addr.
getResNo())
11541 uint32_t IncVal = CInc->getZExtValue();
11543 if (IncVal != NumBytes)
11600 if (TLI.SimplifyDemandedBits(Addr, DemandedMask, Known, TLO)) {
11638 UI.getUse().getResNo() != Addr.
getResNo())
11653 bool IsStore =
false;
11654 bool IsLaneOp =
false;
11655 bool IsDupOp =
false;
11656 unsigned NewOpc = 0;
11657 unsigned NumVecs = 0;
11658 unsigned IntNo = cast<ConstantSDNode>(N->
getOperand(1))->getZExtValue();
11662 NumVecs = 2;
break;
11664 NumVecs = 3;
break;
11666 NumVecs = 4;
break;
11668 NumVecs = 2; IsStore =
true;
break;
11670 NumVecs = 3; IsStore =
true;
break;
11672 NumVecs = 4; IsStore =
true;
break;
11674 NumVecs = 2;
break;
11676 NumVecs = 3;
break;
11678 NumVecs = 4;
break;
11680 NumVecs = 2; IsStore =
true;
break;
11682 NumVecs = 3; IsStore =
true;
break;
11684 NumVecs = 4; IsStore =
true;
break;
11686 NumVecs = 2; IsDupOp =
true;
break;
11688 NumVecs = 3; IsDupOp =
true;
break;
11690 NumVecs = 4; IsDupOp =
true;
break;
11692 NumVecs = 2; IsLaneOp =
true;
break;
11694 NumVecs = 3; IsLaneOp =
true;
break;
11696 NumVecs = 4; IsLaneOp =
true;
break;
11698 NumVecs = 2; IsStore =
true; IsLaneOp =
true;
break;
11700 NumVecs = 3; IsStore =
true; IsLaneOp =
true;
break;
11702 NumVecs = 4; IsStore =
true; IsLaneOp =
true;
break;
11714 uint32_t IncVal = CInc->getZExtValue();
11716 if (IsLaneOp || IsDupOp)
11718 if (IncVal != NumBytes)
11725 if (IsLaneOp || IsStore)
11726 for (
unsigned i = 2; i < AddrOpIdx; ++i)
11733 unsigned NumResultVecs = (IsStore ? 0 : NumVecs);
11735 for (n = 0; n < NumResultVecs; ++n)
11747 std::vector<SDValue> NewResults;
11748 for (
unsigned i = 0; i < NumResultVecs; ++i) {
11749 NewResults.push_back(
SDValue(UpdN.getNode(), i));
11751 NewResults.push_back(
SDValue(UpdN.getNode(), NumResultVecs + 1));
11798 1LL << (width - 1);
11868 int CompConstant) {
11872 int MaxUInt = (1 << width);
11880 AddConstant -= (1 << (width-1));
11885 if ((AddConstant == 0) ||
11886 (CompConstant == MaxUInt - 1 && AddConstant < 0) ||
11887 (AddConstant >= 0 && CompConstant < 0) ||
11888 (AddConstant <= 0 && CompConstant <= 0 && CompConstant < AddConstant))
11893 if ((AddConstant == 0) ||
11894 (AddConstant >= 0 && CompConstant <= 0) ||
11895 (AddConstant <= 0 && CompConstant <= 0 && CompConstant <= AddConstant))
11900 if ((AddConstant >= 0 && CompConstant < 0) ||
11901 (AddConstant <= 0 && CompConstant >= -1 &&
11902 CompConstant < AddConstant + MaxUInt))
11907 if ((AddConstant == 0) ||
11908 (AddConstant > 0 && CompConstant <= 0) ||
11909 (AddConstant < 0 && CompConstant <= AddConstant))
11914 if ((AddConstant >= 0 && CompConstant <= 0) ||
11915 (AddConstant <= 0 && CompConstant >= 0 &&
11916 CompConstant <= AddConstant + MaxUInt))
11921 if ((AddConstant > 0 && CompConstant < 0) ||
11922 (AddConstant < 0 && CompConstant >= 0 &&
11923 CompConstant < AddConstant + MaxUInt) ||
11924 (AddConstant >= 0 && CompConstant >= 0 &&
11925 CompConstant >= AddConstant) ||
11926 (AddConstant <= 0 && CompConstant < 0 && CompConstant < AddConstant))
11945 unsigned CmpIndex) {
11946 unsigned CC = cast<ConstantSDNode>(N->
getOperand(CCIndex))->getSExtValue();
11948 unsigned CondOpcode = SubsNode->
getOpcode();
11957 unsigned MaskBits = 0;
11963 uint32_t CNV = CN->getZExtValue();
11966 else if (CNV == 65535)
11987 if (!isa<ConstantSDNode>(AddInputValue2.
getNode()) ||
11988 !isa<ConstantSDNode>(SubsInputValue.
getNode()))
11999 cast<ConstantSDNode>(AddInputValue2.
getNode())->getSExtValue(),
12000 cast<ConstantSDNode>(SubsInputValue.
getNode())->getSExtValue()))
12033 assert(isa<ConstantSDNode>(CCVal) &&
"Expected a ConstantSDNode here!");
12034 unsigned CC = cast<ConstantSDNode>(CCVal)->getZExtValue();
12051 "Expected the value type to be the same for both operands!");
12118 if ((
C->getZExtValue() >>
Bit) & 1)
12124 if (
C->getZExtValue() <= Bit &&
12125 (Bit -
C->getZExtValue()) < Op->getValueType(0).getSizeInBits()) {
12126 Bit = Bit -
C->getZExtValue();
12133 Bit = Bit +
C->getZExtValue();
12134 if (Bit >= Op->getValueType(0).getSizeInBits())
12135 Bit = Op->getValueType(0).getSizeInBits() - 1;
12140 if ((Bit +
C->getZExtValue()) < Op->getValueType(0).getSizeInBits()) {
12141 Bit = Bit +
C->getZExtValue();
12148 if ((
C->getZExtValue() >>
Bit) & 1)
12158 unsigned Bit = cast<ConstantSDNode>(N->
getOperand(2))->getZExtValue();
12159 bool Invert =
false;
12163 if (TestSrc == NewTestSrc)
12206 cast<CondCodeSDNode>(N0.
getOperand(2))->
get());
12228 "Scalar-SETCC feeding SELECT has unexpected result type!");
12241 if (!ResVT.
isVector() || NumMaskElts == 0)
12289 auto *GN = cast<GlobalAddressSDNode>(
N);
12294 uint64_t MinOffset = -1ull;
12303 MinOffset = std::min(MinOffset,
C->getZExtValue());
12305 uint64_t
Offset = MinOffset + GN->getOffset();
12310 if (Offset <= uint64_t(GN->getOffset()))
12321 if (Offset >= (1 << 21))
12339 assert(ContentTy.
isSimple() &&
"No SVE containers for extended types");
12361 bool OnlyPackedOffsets =
true) {
12365 "Scatter stores are only possible for SVE vectors");
12393 if (!OnlyPackedOffsets &&
12425 return DAG.
getNode(Opcode, DL, VTs, Ops);
12430 bool OnlyPackedOffsets =
true) {
12433 "Gather loads are only possible for SVE vectors");
12453 if (!OnlyPackedOffsets &&
12476 if (RetVT.
isInteger() && (RetVT != HwRetVt))
12526 EVT SignExtSrcVT = cast<VTSDNode>(N->
getOperand(1))->getVT();
12527 EVT GLD1SrcMemVT = cast<VTSDNode>(Src->
getOperand(4))->getVT();
12529 if ((SignExtSrcVT != GLD1SrcMemVT) || !Src.
hasOneUse())
12608 switch (cast<ConstantSDNode>(N->
getOperand(1))->getZExtValue()) {
12609 case Intrinsic::aarch64_neon_ld2:
12610 case Intrinsic::aarch64_neon_ld3:
12611 case Intrinsic::aarch64_neon_ld4:
12612 case Intrinsic::aarch64_neon_ld1x2:
12613 case Intrinsic::aarch64_neon_ld1x3:
12614 case Intrinsic::aarch64_neon_ld1x4:
12615 case Intrinsic::aarch64_neon_ld2lane:
12616 case Intrinsic::aarch64_neon_ld3lane:
12617 case Intrinsic::aarch64_neon_ld4lane:
12618 case Intrinsic::aarch64_neon_ld2r:
12619 case Intrinsic::aarch64_neon_ld3r:
12620 case Intrinsic::aarch64_neon_ld4r:
12621 case Intrinsic::aarch64_neon_st2:
12622 case Intrinsic::aarch64_neon_st3:
12623 case Intrinsic::aarch64_neon_st4:
12624 case Intrinsic::aarch64_neon_st1x2:
12625 case Intrinsic::aarch64_neon_st1x3:
12626 case Intrinsic::aarch64_neon_st1x4:
12627 case Intrinsic::aarch64_neon_st2lane:
12628 case Intrinsic::aarch64_neon_st3lane:
12629 case Intrinsic::aarch64_neon_st4lane:
12631 case Intrinsic::aarch64_sve_ldnt1:
12633 case Intrinsic::aarch64_sve_stnt1:
12635 case Intrinsic::aarch64_sve_ld1_gather:
12637 case Intrinsic::aarch64_sve_ld1_gather_index:
12639 case Intrinsic::aarch64_sve_ld1_gather_sxtw:
12642 case Intrinsic::aarch64_sve_ld1_gather_uxtw:
12645 case Intrinsic::aarch64_sve_ld1_gather_sxtw_index:
12648 case Intrinsic::aarch64_sve_ld1_gather_uxtw_index:
12651 case Intrinsic::aarch64_sve_ld1_gather_imm:
12653 case Intrinsic::aarch64_sve_st1_scatter:
12655 case Intrinsic::aarch64_sve_st1_scatter_index:
12657 case Intrinsic::aarch64_sve_st1_scatter_sxtw:
12660 case Intrinsic::aarch64_sve_st1_scatter_uxtw:
12663 case Intrinsic::aarch64_sve_st1_scatter_sxtw_index:
12666 case Intrinsic::aarch64_sve_st1_scatter_uxtw_index:
12669 case Intrinsic::aarch64_sve_st1_scatter_imm:
12685 bool AArch64TargetLowering::isUsedByReturnOnly(
SDNode *N,
12704 bool HasRet =
false;
12722 bool AArch64TargetLowering::mayBeEmittedAsTailCall(
const CallInst *CI)
const {
12738 int64_t RHSC = RHS->getSExtValue();
12740 RHSC = -(uint64_t)RHSC;
12741 if (!isInt<9>(RHSC))
12750 bool AArch64TargetLowering::getPreIndexedAddressParts(
SDNode *N,
SDValue &Base,
12757 VT =
LD->getMemoryVT();
12758 Ptr =
LD->getBasePtr();
12760 VT =
ST->getMemoryVT();
12761 Ptr =
ST->getBasePtr();
12766 if (!getIndexedAddressParts(Ptr.
getNode(), Base,
Offset, AM, IsInc, DAG))
12772 bool AArch64TargetLowering::getPostIndexedAddressParts(
12778 VT =
LD->getMemoryVT();
12779 Ptr =
LD->getBasePtr();
12781 VT =
ST->getMemoryVT();
12782 Ptr =
ST->getBasePtr();
12787 if (!getIndexedAddressParts(Op, Base, Offset, AM, IsInc, DAG))
12817 unsigned AcrossOp) {
12834 return std::make_pair(Lo, Hi);
12850 const SDValue Ops[] = { RegClass, VLo, SubReg0, VHi, SubReg1 };
12860 "AtomicCmpSwap on types less than 128 should be legal");
12862 if (Subtarget->
hasLSE()) {
12877 Opcode = AArch64::CASPX;
12880 Opcode = AArch64::CASPAX;
12883 Opcode = AArch64::CASPLX;
12887 Opcode = AArch64::CASPALX;
12897 unsigned SubReg1 = AArch64::sube64, SubReg2 = AArch64::subo64;
12913 AArch64::CMP_SWAP_128,
SDLoc(N),
12924 void AArch64TargetLowering::ReplaceNodeResults(
12968 "unexpected load's value type");
12978 DAG.
getVTList({MVT::i64, MVT::i64, MVT::Other}),
12990 "custom lowering for unexpected type");
12997 case Intrinsic::aarch64_sve_clasta_n: {
13005 case Intrinsic::aarch64_sve_clastb_n: {
13013 case Intrinsic::aarch64_sve_lasta: {
13020 case Intrinsic::aarch64_sve_lastb: {
13033 if (Subtarget->isTargetAndroid() || Subtarget->isTargetFuchsia())
13038 unsigned AArch64TargetLowering::combineRepeatedFPDivisors()
const {
13060 return Size == 128;
13090 if (Subtarget->hasLSE())
13105 Type *ValTy = cast<PointerType>(Addr->
getType())->getElementType();
13113 IsAcquire ? Intrinsic::aarch64_ldaxp : Intrinsic::aarch64_ldxp;
13129 IsAcquire ? Intrinsic::aarch64_ldaxr : Intrinsic::aarch64_ldxr;
13132 Type *EltTy = cast<PointerType>(Addr->
getType())->getElementType();
13158 IsRelease ? Intrinsic::aarch64_stlxp : Intrinsic::aarch64_stxp;
13169 IsRelease ? Intrinsic::aarch64_stlxr : Intrinsic::aarch64_stxr;
13188 bool AArch64TargetLowering::shouldNormalizeToSelectSequence(
LLVMContext &,
13207 if (Subtarget->isTargetAndroid())
13212 if (Subtarget->isTargetFuchsia())
13220 if (Subtarget->getTargetTriple().isWindowsMSVCEnvironment()) {
13231 F->addAttribute(1, Attribute::AttrKind::InReg);
13240 if (Subtarget->getTargetTriple().isWindowsMSVCEnvironment())
13247 if (Subtarget->getTargetTriple().isWindowsMSVCEnvironment())
13256 if (Subtarget->isTargetAndroid())
13261 if (Subtarget->isTargetFuchsia())
13283 unsigned OldShiftOpcode,
unsigned NewShiftOpcode,
13287 X, XC, CC, Y, OldShiftOpcode, NewShiftOpcode, DAG))
13296 !Subtarget->isTargetWindows() && !Subtarget->isTargetDarwin())
13320 if (AArch64::GPR64RegClass.
contains(*
I))
13321 RC = &AArch64::GPR64RegClass;
13322 else if (AArch64::FPR64RegClass.
contains(*
I))
13323 RC = &AArch64::FPR64RegClass;
13334 Attribute::NoUnwind) &&
13335 "Function should be nounwind in insertCopiesSplitCSR!");
13341 for (
auto *Exit : Exits)
13343 TII->
get(TargetOpcode::COPY), *
I)
13372 if (Subtarget->isTargetDarwin() || Subtarget->isTargetWindows())
13378 void AArch64TargetLowering::finalizeLowering(
MachineFunction &MF)
const {
const Triple & getTargetTriple() const
SDValue getStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
Helper function to build ISD::STORE nodes.
std::pair< Value *, Value * > ShuffleOps
We are building a shuffle to create V, which is a sequence of insertelement, extractelement pairs...
static bool isAdvSIMDModImmType6(uint64_t Imm)
Type * getVectorElementType() const
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)
void setAllowReassociation(bool b)
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()
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.
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...
bool getTgtMemIntrinsic(IntrinsicInfo &Info, const CallInst &I, MachineFunction &MF, unsigned Intrinsic) const override
getTgtMemIntrinsic - Represent NEON load and store intrinsics as MemIntrinsicNodes.
A parsed version of the target data layout string in and methods for querying it. ...
reference emplace_back(ArgTypes &&... Args)
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
FMINNUM/FMAXNUM - Perform floating-point minimum or maximum on two values.
EVT getValueType() const
Return the ValueType of the referenced return value.
class_match< Value > m_Value()
Match an arbitrary value and ignore it.
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...
class_match< UndefValue > m_Undef()
Match an arbitrary undef constant.
Value * CreateConstGEP1_32(Value *Ptr, unsigned Idx0, const Twine &Name="")
static SDValue LowerADDC_ADDE_SUBC_SUBE(SDValue Op, SelectionDAG &DAG)
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
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)
unsigned ClassifyGlobalReference(const GlobalValue *GV, const TargetMachine &TM) const
ClassifyGlobalReference - Find the target operand flags that describe how a global value should be re...
This SDNode is used for target intrinsics that touch memory and need an associated MachineMemOperand...
bool isLittleEndian() const
const MCPhysReg * getScratchRegisters(CallingConv::ID CC) const override
Returns a 0 terminated array of registers that can be safely used as scratch registers.
const GlobalValue * getGlobal() const
EXTRACT_ELEMENT - This is used to get the lower or upper (determined by a Constant, which is required to be operand #1) half of the integer or float value specified as operand #0.
uint64_t getZExtValue() const
Get zero extended value.
AArch64FunctionInfo - This class is derived from MachineFunctionInfo and contains private AArch64-spe...
unsigned MaxLoadsPerMemcmpOptSize
Likewise for functions with the OptSize attribute.
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
static uint8_t encodeAdvSIMDModImmType3(uint64_t Imm)
This class represents an incoming formal argument to a Function.
StackOffset is a wrapper around scalable and non-scalable offsets and is used in several functions su...
static SDValue performLDNT1Combine(SDNode *N, SelectionDAG &DAG)
bool isExtractSubvectorCheap(EVT ResVT, EVT SrcVT, unsigned Index) const override
Return true if EXTRACT_SUBVECTOR is cheap for this result type with this index.
DiagnosticInfoOptimizationBase::Argument NV
void setVarArgsGPRSize(unsigned Size)
bool isMisaligned128StoreSlow() const
bool isIndexed() const
Return true if this is a pre/post inc/dec load/store.
bool isOSMSVCRT() const
Is this a "Windows" OS targeting a "MSVCRT.dll" environment.
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)
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 SDValue performNEONPostLDSTCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, SelectionDAG &DAG)
Target-specific DAG combine function for NEON load/store intrinsics to merge base address updates...
EXTRACT_SUBVECTOR(VECTOR, IDX) - Returns a subvector from VECTOR (an vector value) starting with the ...
CondCode getSetCCInverse(CondCode Operation, EVT Type)
Return the operation corresponding to !(X op Y), where 'op' is a valid SetCC operation.
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.
This class represents lattice values for constants.
Register getLocReg() const
static SDValue performLD1GatherCombine(SDNode *N, SelectionDAG &DAG, unsigned Opcode, bool OnlyPackedOffsets=true)
static unsigned MatchRegisterName(StringRef Name)
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...
Type * getParamType(unsigned i) const
Parameter type accessors.
static MVT getVectorVT(MVT VT, unsigned NumElements)
FMINIMUM/FMAXIMUM - NaN-propagating minimum/maximum that also treat -0.0 as less than 0...
Describes a register that needs to be forwarded from the prologue to a musttail call.
VECTOR_SHUFFLE(VEC1, VEC2) - Returns a vector, of the same type as VEC1/VEC2.
EVT getScalarType() const
If this is a vector type, return the element type, otherwise return this.
bool hasCustomCallingConv() const
unsigned EnableDebugEntryValues
Emit debug info about parameter's entry values.
static int getFP16Imm(const APInt &Imm)
getFP16Imm - Return an 8-bit floating-point version of the 16-bit floating-point value.
A Module instance is used to store all the information related to an LLVM module. ...
static bool areExtractExts(Value *Ext1, Value *Ext2)
Check if Ext1 and Ext2 are extends of the same type, doubling the bitwidth of the vector elements...
bool isSized(SmallPtrSetImpl< Type *> *Visited=nullptr) const
Return true if it makes sense to take the size of this type.
SDValue scalarizeVectorStore(StoreSDNode *ST, SelectionDAG &DAG) const
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)
2: 32-bit floating point type
Register createVirtualRegister(const TargetRegisterClass *RegClass, StringRef Name="")
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
int getVarArgsStackIndex() const
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
An instruction that atomically checks whether a specified value is in a memory location, and, if it is, stores a new value there.
bool CC_AArch64_DarwinPCS_VarArg(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
static bool IsSVECntIntrinsic(SDValue S)
int getSplatIndex() const
static bool isAdvSIMDModImmType4(uint64_t Imm)
bool isVector() const
Return true if this is a vector value type.
static SDValue performXorCombine(SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const AArch64Subtarget *Subtarget)
static uint8_t encodeAdvSIMDModImmType1(uint64_t Imm)
const SDValue & getBasePtr() const
LLT getOptimalMemOpLLT(uint64_t Size, unsigned DstAlign, unsigned SrcAlign, bool IsMemset, bool ZeroMemset, bool MemcpyStrSrc, const AttributeList &FuncAttributes) const override
LLT returning variant.
bool predictableSelectIsExpensive() const
A handy container for a FunctionType+Callee-pointer pair, which can be passed around as a single enti...
SDValue getMaskedLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Base, SDValue Offset, SDValue Mask, SDValue Src0, EVT MemVT, MachineMemOperand *MMO, ISD::MemIndexedMode AM, ISD::LoadExtType, bool IsExpanding=false)
Carry-setting nodes for multiple precision addition and subtraction.
static constexpr unsigned SVEBitsPerBlock
void push_back(const T &Elt)
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
virtual void LowerAsmOperandForConstraint(SDValue Op, std::string &Constraint, std::vector< SDValue > &Ops, SelectionDAG &DAG) const
Lower the specified operand into the Ops vector.
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
static bool isINSMask(ArrayRef< int > M, int NumInputElements, bool &DstIsLeft, int &Anomaly)
static bool isAddSubZExt(SDNode *N, SelectionDAG &DAG)
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)
TypeSize getSizeInBits() const
Returns the size of the specified MVT in bits.
void setVarArgsStackIndex(int Index)
EVT getHalfNumVectorElementsVT(LLVMContext &Context) const
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.
static MVT getSVEContainerType(EVT ContentTy)
MachineMemOperand::Flags flags
bool isScalarInteger() const
Return true if this is an integer, but not a vector.
const SDValue & getValue() const
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.
SDValue getTargetExternalSymbol(const char *Sym, EVT VT, unsigned TargetFlags=0)
static APInt getLowBitsSet(unsigned numBits, unsigned loBitsSet)
Get a value with low bits set.
static SDValue ConstantBuildVector(SDValue Op, SelectionDAG &DAG)
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
Libcall
RTLIB::Libcall enum - This enum defines all of the runtime library calls the backend can emit...
class_match< Constant > m_Constant()
Match an arbitrary Constant and ignore it.
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...
MachineBasicBlock * EmitLoweredCatchRet(MachineInstr &MI, MachineBasicBlock *BB) const
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 getVectorNumElements() const
const SDValue & getChain() const
Function Alias Analysis Results
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)
SPLAT_VECTOR(VAL) - Returns a vector with the scalar value VAL duplicated in all lanes.
static SDValue performVectorCompareAndMaskUnaryOpCombine(SDNode *N, SelectionDAG &DAG)
unsigned getAlignment() const
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
virtual std::pair< unsigned, const TargetRegisterClass * > getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI, StringRef Constraint, MVT VT) const
Given a physical register constraint (e.g.
bool isScalableVector() const
Return true if this is a vector type where the runtime length is machine dependent.
const Use & getOperandUse(unsigned i) const
Function * getSSPStackGuardCheck(const Module &M) const override
If the target has a standard stack protection check function that performs validation and error handl...
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...
C - The default llvm calling convention, compatible with C.
GlobalVariable * getGlobalVariable(StringRef Name) const
Look up the specified global variable in the module symbol table.
static SDValue LowerPREFETCH(SDValue Op, SelectionDAG &DAG)
STATISTIC(NumFunctions, "Total number of functions")
unsigned const TargetRegisterInfo * TRI
MVT getSimpleValueType(unsigned ResNo) const
Return the type of a specified result as a simple type.
bool isInteger() const
Return true if this is an integer or a vector integer type.
MO_G0 - A symbol operand with this flag (granule 0) represents the bits 0-15 of a 64-bit address...
TypeSize getScalarValueSizeInBits() const
CallLoweringInfo & setDebugLoc(const SDLoc &dl)
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...
ThreeOps_match< V1_t, V2_t, Mask_t, Instruction::ShuffleVector > m_ShuffleVector(const V1_t &v1, const V2_t &v2, const Mask_t &m)
Matches ShuffleVectorInst.
static SDValue performExtendCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, SelectionDAG &DAG)
static SDValue NormalizeBuildVector(SDValue Op, SelectionDAG &DAG)
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)
static IntegerType * getInt64Ty(LLVMContext &C)
bool hasExternalWeakLinkage() const
static bool isAdvSIMDModImmType3(uint64_t Imm)
[US]{MIN/MAX} - Binary minimum or maximum or signed or unsigned integers.
APInt zextOrTrunc(unsigned width) const
Zero extend or truncate to width.
const SDNodeFlags getFlags() const
an instruction that atomically reads a memory location, combines it with another value, and then stores the result back.
SDNode * getNode() const
get the SDNode which holds the desired result
TypeSize getTypeSizeInBits(Type *Ty) const
Size examples:
SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
bool isVectorTy() const
True if this is an instance of VectorType.
static SDValue LowerVectorINT_TO_FP(SDValue Op, SelectionDAG &DAG)
Calling convention between AArch64 SVE functions.
static SDValue performSetccAddFolding(SDNode *Op, SelectionDAG &DAG)
This defines the Use class.
AtomicExpansionKind
Enum that specifies what an atomic load/AtomicRMWInst is expanded to, if at all.
static SDValue EmitVectorComparison(SDValue LHS, SDValue RHS, AArch64CC::CondCode CC, bool NoNans, EVT VT, const SDLoc &dl, SelectionDAG &DAG)
bool shouldConsiderGEPOffsetSplit() const override
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...
MachineMemOperand * getMemOperand() const
Return a MachineMemOperand object describing the memory reference performed by operation.
static SDValue tryCombineFixedPointConvert(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, SelectionDAG &DAG)
INSERT_SUBVECTOR(VECTOR1, VECTOR2, IDX) - Returns a vector with VECTOR2 inserted into VECTOR1 at the ...
unsigned getBitWidth() const
Get the bit width of this value.
virtual SDValue LowerToTLSEmulatedModel(const GlobalAddressSDNode *GA, SelectionDAG &DAG) const
Lower TLS global address SDNode for target independent emulated TLS model.
void setVarArgsFPRSize(unsigned Size)
static bool isZeroExtended(SDNode *N, SelectionDAG &DAG)
static std::pair< SDValue, SDValue > getAArch64XALUOOp(AArch64CC::CondCode &CC, SDValue Op, SelectionDAG &DAG)
unsigned getSizeInBytes() const
Returns the total size of the type in bytes, i.e.
bool isAnyArgRegReserved(const MachineFunction &MF) const
const MachineInstrBuilder & addMBB(MachineBasicBlock *MBB, unsigned TargetFlags=0) const
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...
bool isCallingConvWin64(CallingConv::ID CC) const
Select with condition operator - This selects between a true value and a false value (ops #2 and #3) ...
bool hasOneUse() const
Return true if there is exactly one node using value ResNo of Node.
bool hasFuseLiterals() const
bool hasAttribute(unsigned Index, Attribute::AttrKind Kind) const
Return true if the attribute exists at the given index.
Libcall getFPROUND(EVT OpVT, EVT RetVT)
getFPROUND - Return the FPROUND_*_* value for the given types, or UNKNOWN_LIBCALL if there is none...
bool isUnsignedIntSetCC(CondCode Code)
Return true if this is a setcc instruction that performs an unsigned comparison when used with intege...
static SDValue performIntegerAbsCombine(SDNode *N, SelectionDAG &DAG)
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
void setTruncStoreAction(MVT ValVT, MVT MemVT, LegalizeAction Action)
Indicate that the specified truncating store does not work with the specified type and indicate what ...
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
RESULT,OUTCHAIN = INTRINSIC_W_CHAIN(INCHAIN, INTRINSICID, arg1, ...) This node represents a target in...
bool isTruncatingStore() const
Return true if the op does a truncation before store.
static bool hasPredecessorHelper(const SDNode *N, SmallPtrSetImpl< const SDNode *> &Visited, SmallVectorImpl< const SDNode *> &Worklist, unsigned int MaxSteps=0, bool TopologicalPrune=false)
Returns true if N is a predecessor of any node in Worklist.
unsigned getAddressSpace() const
Return the address space for the associated pointer.
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...
MO_G2 - A symbol operand with this flag (granule 2) represents the bits 32-47 of a 64-bit address...
unsigned classifyGlobalFunctionReference(const GlobalValue *GV, const TargetMachine &TM) const
SDIVREM/UDIVREM - Divide two integers and produce both a quotient and remainder result.
Value * getArgOperand(unsigned i) const
static SDValue performANDCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI)
unsigned 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...
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
static bool isEssentiallyExtractHighSubvector(SDValue N)
SHL_PARTS/SRA_PARTS/SRL_PARTS - These operators are used for expanded integer shift operations...
unsigned countTrailingZeros() const
Count the number of trailing zero bits.
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
SDValue getIntPtrConstant(uint64_t Val, const SDLoc &DL, bool isTarget=false)
static bool isAdvSIMDModImmType7(uint64_t Imm)
static SDValue tryFormConcatFromShuffle(SDValue Op, SelectionDAG &DAG)
bool match(Val *V, const Pattern &P)
static bool isTRNMask(ArrayRef< int > M, EVT VT, unsigned &WhichResult)
MVT getPointerTy(const DataLayout &DL, uint32_t AS=0) const override
Return the pointer type for the given address space, defaults to the pointer type from the data layou...
bool hasOneUse() const
Return true if there is exactly one use of this node.
bool isBeforeLegalize() const
cl::opt< bool > EnableAArch64ELFLocalDynamicTLSGeneration("aarch64-elf-ldtls-generation", cl::Hidden, cl::desc("Allow AArch64 Local Dynamic TLS code generation"), cl::init(false))
int getVarArgsGPRIndex() const
A description of a memory reference used in the backend.
APInt getLoBits(unsigned numBits) const
Compute an APInt containing numBits lowbits from this APInt.
static SDValue performTBZCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, SelectionDAG &DAG)
static SDValue performCONDCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, SelectionDAG &DAG, unsigned CCIndex, unsigned CmpIndex)
bool isTargetDarwin() const
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
static void ReplaceCMP_SWAP_128Results(SDNode *N, SmallVectorImpl< SDValue > &Results, SelectionDAG &DAG, const AArch64Subtarget *Subtarget)
const HexagonInstrInfo * TII
bool CC_AArch64_DarwinPCS_ILP32_VarArg(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
static SDValue performST1ScatterCombine(SDNode *N, SelectionDAG &DAG, unsigned Opcode, bool OnlyPackedOffsets=true)
bool isNonNegative() const
Determine if this APInt Value is non-negative (>= 0)
static SDValue tryCombineCRC32(unsigned Mask, SDNode *N, SelectionDAG &DAG)
static bool isConstantSplatVectorMaskForType(SDNode *N, EVT MemVT)
static Value * UseTlsOffset(IRBuilder<> &IRB, unsigned Offset)
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
TypeID getTypeID() const
Return the type id for the type.
bool isFloatingPointTy() const
Return true if this is one of the six floating-point types.
Shift and rotation operations.
static SDValue performAddSubLongCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, SelectionDAG &DAG)
Type * getTypeForEVT(LLVMContext &Context) const
This method returns an LLVM type corresponding to the specified EVT.
Class to represent struct types.
LLVMContext & getContext() const
Get the global data context.
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.
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.
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.
PointerType * getPointerTo(unsigned AddrSpace=0) const
Return a pointer to the current type.
BinOp getOperation() const
static uint8_t encodeAdvSIMDModImmType6(uint64_t Imm)
CallLoweringInfo & setChain(SDValue InChain)
BUILD_PAIR - This is the opposite of EXTRACT_ELEMENT in some ways.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
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...
bool isIntegerTy() const
True if this is an instance of IntegerType.
op_iterator op_end() const
uint64_t getConstantOperandVal(unsigned i) const
int64_t getObjectOffset(int ObjectIdx) const
Return the assigned stack offset of the specified object from the incoming stack pointer.
static SDValue tryAdvSIMDModImm32(unsigned NewOp, SDValue Op, SelectionDAG &DAG, const APInt &Bits, const SDValue *LHS=nullptr)
EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Context, EVT VT) const override
Return the ISD::SETCC ValueType.
ISD::LoadExtType getExtensionType() const
Return whether this is a plain node, or one of the varieties of value-extending loads.
Helper structure to keep track of a SET_CC lowered into AArch64 code.
FLT_ROUNDS_ - Returns current rounding mode: -1 Undefined 0 Round to 0 1 Round to nearest 2 Round to ...
virtual bool useLoadStackGuardNode() const
If this function returns true, SelectionDAGBuilder emits a LOAD_STACK_GUARD node when it is lowering ...
SDValue getTargetJumpTable(int JTI, EVT VT, unsigned TargetFlags=0)
This file contains the simple types necessary to represent the attributes associated with functions a...
bool isInConsecutiveRegs() const
bool RetCC_AArch64_WebKit_JS(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
The memory access is dereferenceable (i.e., doesn't trap).
static SDValue LowerMUL(SDValue Op, SelectionDAG &DAG)
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...
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
LLVM_NODISCARD StringRef slice(size_t Start, size_t End) const
Return a reference to the substring from [Start, End).
SDValue getEntryNode() const
Return the token chain corresponding to the entry of the function.
void setOperationAction(unsigned Op, MVT VT, LegalizeAction Action)
Indicate that the specified operation does not work with the specified type and indicate what to do a...
bool isTargetMachO() const
TypeSize getValueSizeInBits() const
Returns the size of the value in bits.
static SDValue combineAcrossLanesIntrinsic(unsigned Opc, SDNode *N, SelectionDAG &DAG)
const DataLayout & getDataLayout() const
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.
bool isLegalInterleavedAccessType(VectorType *VecTy, const DataLayout &DL) const
Returns true if VecTy is a legal interleaved access type.
APInt getHiBits(unsigned numBits) const
Compute an APInt containing numBits highbits from this APInt.
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...
const BlockAddress * getBlockAddress() const
This is an SDNode representing atomic operations.
uint64_t getNumElements() const
For scalable vectors, this will return the minimum number of elements in the vector.
LocInfo getLocInfo() const
static bool isAdvSIMDModImmType5(uint64_t Imm)
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
static StructType * get(LLVMContext &Context, ArrayRef< Type *> Elements, bool isPacked=false)
This static method is the primary way to create a literal StructType.
This file implements a class to represent arbitrary precision integral constant values and operations...
bool is64BitVector() const
Return true if this is a 64-bit vector type.
OutputArg - This struct carries flags and a value for a single outgoing (actual) argument or outgoing...
static SDValue emitConditionalComparison(SDValue LHS, SDValue RHS, ISD::CondCode CC, SDValue CCOp, AArch64CC::CondCode Predicate, AArch64CC::CondCode OutCC, const SDLoc &DL, SelectionDAG &DAG)
can be transformed to: not (and (not (and (setCC (cmp C)) (setCD (cmp D)))) (and (not (setCA (cmp A))...
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())
AtomicOrdering
Atomic ordering for LLVM's memory model.
STACKSAVE - STACKSAVE has one operand, an input chain.
Structure used to represent pair of argument number after call lowering and register used to transfer...
SDValue getMergeValues(ArrayRef< SDValue > Ops, const SDLoc &dl)
Create a MERGE_VALUES node from the given operands.
Value * getSafeStackPointerLocation(IRBuilder<> &IRB) const override
If the target has a standard location for the unsafe stack pointer, returns the address of that locat...
bool isFMAFasterThanFMulAndFAdd(const MachineFunction &MF, EVT VT) const override
Return true if an FMA operation is faster than a pair of fmul and fadd instructions.
static const unsigned PerfectShuffleTable[6561+1]
Value * CreateIntToPtr(Value *V, Type *DestTy, const Twine &Name="")
int64_t getSExtValue() const
SDValue getSExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT)
Convert Op, which must be of integer type, to the integer type VT, by either sign-extending or trunca...
int getDwarfRegNum(MCRegister RegNum, bool isEH) const
Map a target register to an equivalent dwarf register number.
unsigned getPointerAddressSpace() const
Returns the address space of the pointer operand.
void setArgumentStackToRestore(unsigned bytes)
This is a fast-path instruction selection class that generates poor code and doesn't support illegal ...
STRICT_FSETCC/STRICT_FSETCCS - Constrained versions of SETCC, used for floating-point operands only...
unsigned getNextStackOffset() const
getNextStackOffset - Return the next stack offset such that all stack slots satisfy their alignment r...
Value * CreateBitCast(Value *V, Type *DestTy, const Twine &Name="")
int64_t getSExtValue() const
Get sign extended value.
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...
AtomicOrdering getOrdering() const
Return the atomic ordering requirements for this memory operation.
static SDValue performConcatVectorsCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, SelectionDAG &DAG)
Type * getType() const
All values are typed, get the type of this value.
CATCHPAD - Represents a catchpad instruction.
MachineFunction & getMachineFunction() const
[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
static bool checkValueWidth(SDValue V, unsigned width, ISD::LoadExtType &ExtType)
virtual const TargetRegisterClass * getRegClassFor(MVT VT, bool isDivergent=false) const
Return the register class that should be used for the specified value type.
MO_GOT - This flag indicates that a symbol operand represents the address of the GOT entry for the sy...
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
unsigned MaxLoadsPerMemcmp
Specify maximum number of load instructions per memcmp call.
static SDValue tryAdvSIMDModImm8(unsigned NewOp, SDValue Op, SelectionDAG &DAG, const APInt &Bits)
const TargetMachine & getTarget() const
BasicBlock * GetInsertBlock() const
Select with a vector condition (op #0) and two vector operands (ops #1 and #2), returning a vector re...
void setMinFunctionAlignment(Align Alignment)
Set the target's minimum function alignment.
unsigned getSRetReturnReg() const
Simple integer binary arithmetic operators.
STRICT_[US]INT_TO_FP - Convert a signed or unsigned integer to a floating point value.
static bool isOverflowIntrOpRes(SDValue Op)
MDNode * getMetadata(unsigned KindID) const
Get the metadata of given kind attached to this Instruction.
SDValue getSetCC(const SDLoc &DL, EVT VT, SDValue LHS, SDValue RHS, ISD::CondCode Cond, SDValue Chain=SDValue(), bool IsSignaling=false)
Helper function to make it easier to build SetCC's if you just have an ISD::CondCode instead of an SD...
LLVM_NODISCARD size_t size() const
size - Get the string size.
const APInt & getValue() const
Return the constant as an APInt value reference.
unsigned getOpcode() const
Returns a member of one of the enums like Instruction::Add.
bool enableAggressiveFMAFusion(EVT VT) const override
Enable aggressive FMA fusion on targets that want it.
static bool isAdvSIMDModImmType2(uint64_t Imm)
SDValue getUNDEF(EVT VT)
Return an UNDEF node. UNDEF does not have a useful SDLoc.
TLSModel::Model getTLSModel(const GlobalValue *GV) const
Returns the TLS model which should be used for the given global variable.
AttributeList getAttributes() const
Return the attribute list for this Function.
An instruction for storing to memory.
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out...
static Error getOffset(const SymbolRef &Sym, SectionRef Sec, uint64_t &Result)
op_iterator op_begin() const
TargetConstant* - Like Constant*, but the DAG does not do any folding, simplification, or lowering of the constant.
static LLT scalar(unsigned SizeInBits)
Get a low-level scalar or aggregate "bag of bits".
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 ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
SDValue getSplatBuildVector(EVT VT, const SDLoc &DL, SDValue Op)
Return a splat ISD::BUILD_VECTOR node, consisting of Op splatted to all elements. ...
ArrayRef< SDUse > ops() const
TargetLoweringBase::AtomicExpansionKind shouldExpandAtomicLoadInIR(LoadInst *LI) const override
Returns how the given (atomic) load should be expanded by the IR-level AtomicExpand pass...
bool isFPImmLegal(const APFloat &Imm, EVT VT, bool ForCodeSize) const override
Returns true if the target can instruction select the specified FP immediate natively.
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...
static SDValue getReductionSDNode(unsigned Op, SDLoc DL, SDValue ScalarOp, SelectionDAG &DAG)
static const MCPhysReg GPRArgRegs[]
FastISel * createFastISel(FunctionLoweringInfo &funcInfo, const TargetLibraryInfo *libInfo)
bool isXRegisterReserved(size_t i) const
unsigned getPrefFunctionLogAlignment() const
Value * CreateZExtOrBitCast(Value *V, Type *DestTy, const Twine &Name="")
RESULT = INTRINSIC_WO_CHAIN(INTRINSICID, arg1, arg2, ...) This node represents a target intrinsic fun...
Function * getDeclaration(Module *M, ID id, ArrayRef< Type *> Tys=None)
Create or insert an LLVM Function declaration for an intrinsic, and return it.
int64_t getObjectSize(int ObjectIdx) const
Return the size of the specified object.
MachineBasicBlock * CreateMachineBasicBlock(const BasicBlock *bb=nullptr)
CreateMachineBasicBlock - Allocate a new MachineBasicBlock.
void initializeSplitCSR(MachineBasicBlock *Entry) const override
Perform necessary initialization to handle a subset of CSRs explicitly via copies.
bool functionArgumentNeedsConsecutiveRegisters(Type *Ty, CallingConv::ID CallConv, bool isVarArg) const override
For some targets, an LLVM struct type must be broken down into multiple simple types, but the calling convention specifies that the entire struct must be passed in a block of consecutive registers.
SDValue getAtomic(unsigned Opcode, const SDLoc &dl, EVT MemVT, SDValue Chain, SDValue Ptr, SDValue Val, MachineMemOperand *MMO)
Gets a node for an atomic op, produces result (if relevant) and chain and takes 2 operands...
bool supportsAddressTopByteIgnored() const
CPU has TBI (top byte of addresses is ignored during HW address translation) and OS enables it...
static SDValue WidenVector(SDValue V64Reg, SelectionDAG &DAG)
WidenVector - Given a value in the V64 register class, produce the equivalent value in the V128 regis...
MVT getVectorElementType() const
Value * getOperand(unsigned i) const
Analysis containing CSE Info
const DataLayout & getDataLayout() const
Return the DataLayout attached to the Module associated to this MF.
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...
bool allowsMisalignedMemoryAccesses(EVT VT, unsigned AddrSpace=0, unsigned Align=1, MachineMemOperand::Flags Flags=MachineMemOperand::MONone, bool *Fast=nullptr) const override
Returns true if the target allows unaligned memory accesses of the specified type.
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.
unsigned getByValSize() const
const uint32_t * getCallPreservedMask(const MachineFunction &MF, CallingConv::ID) const override
This class is used to represent ISD::STORE nodes.
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)
static SDValue emitConjunction(SelectionDAG &DAG, SDValue Val, AArch64CC::CondCode &OutCC)
Emit expression as a conjunction (a series of CCMP/CFCMP ops).
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
static bool isExtractSubvectorMask(ArrayRef< int > Mask, int NumSrcElts, int &Index)
Return true if this shuffle mask is an extract subvector mask.
void setPrefFunctionAlignment(Align Alignment)
Set the target's preferred function alignment.
bool isScalableVector() const
Return true if this is a vector value type where the runtime length is machine dependent.
Flag
These should be considered private to the implementation of the MCInstrDesc class.
static SDValue LowerSVEIntrinsicEXT(SDNode *N, SelectionDAG &DAG)
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
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.
void addLiveIn(MCRegister PhysReg, LaneBitmask LaneMask=LaneBitmask::getAll())
Adds the specified register as a live in.
MVT getSimpleValueType() const
Return the simple ValueType of the referenced return value.
Type * getScalarType() const
If this is a vector type, return the element type, otherwise return 'this'.
bool is128BitVector() const
Return true if this is a 128-bit vector type.
bool isTargetWindows() const
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...
bool bitsGT(EVT VT) const
Return true if this has more bits than VT.
The C convention as implemented on Windows/x86-64 and AArch64.
static bool isAdvSIMDModImmType9(uint64_t Imm)
bool isShuffleMaskLegal(ArrayRef< 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 isZero() const
Return true if the value is positive or negative zero.
bool useEmulatedTLS() const
Returns true if this target uses emulated TLS.
bool isOSWindows() const
Tests whether the OS is Windows.
bool isTruncateFree(Type *Ty1, Type *Ty2) const override
Return true if it's free to truncate a value of type FromTy to type ToTy.
The memory access is volatile.
virtual Value * getIRStackGuard(IRBuilder<> &IRB) const
If the target has a standard location for the stack protector guard, returns the address of that loca...
constexpr uint64_t MinAlign(uint64_t A, uint64_t B)
A and B are either alignments or offsets.
unsigned getNumValues() const
Return the number of values defined/returned by this operator.
void setPrefLoopAlignment(Align Alignment)
Set the target's preferred loop alignment.
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...
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)
const SDValue & getBasePtr() const
static SDValue emitStrictFPComparison(SDValue LHS, SDValue RHS, const SDLoc &dl, SelectionDAG &DAG, SDValue Chain, bool IsSignaling)
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.
int64_t getOffset() const
OUTCHAIN = INTRINSIC_VOID(INCHAIN, INTRINSICID, arg1, arg2, ...) This node represents a target intrin...
unsigned UnsafeFPMath
UnsafeFPMath - This flag is enabled when the -enable-unsafe-fp-math flag is specified on the command ...
FPOpFusion::FPOpFusionMode AllowFPOpFusion
AllowFPOpFusion - This flag is set by the -fuse-fp-ops=xxx option.
bool isDesirableToCommuteWithShift(const SDNode *N, CombineLevel Level) const override
Returns false if N is a bit extraction pattern of (X >> C) & Mask.
Control flow instructions. These all have token chains.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
MO_G1 - A symbol operand with this flag (granule 1) represents the bits 16-31 of a 64-bit address...
CodeGenOpt::Level getOptLevel() const
Returns the optimization level: None, Less, Default, or Aggressive.
bool requiresStrictAlign() const
unsigned const MachineRegisterInfo * MRI
static int getFP32Imm(const APInt &Imm)
getFP32Imm - Return an 8-bit floating-point version of the 32-bit floating-point value.
unsigned countPopulation() const
Count the number of bits set.
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...
use_iterator use_begin() const
Provide iteration support to walk over all uses of an SDNode.
bool CC_AArch64_DarwinPCS(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
unsigned getPrefLoopLogAlignment() const
Value * concatenateVectors(IRBuilder<> &Builder, ArrayRef< Value *> Vecs)
Concatenate a list of vectors.
LLVM Basic Block Representation.
TypeSize getPrimitiveSizeInBits() const LLVM_READONLY
Return the basic size of this type if it is a primitive type.
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.
void addRegisterClass(MVT VT, const TargetRegisterClass *RC)
Add the specified register class as an available regclass for the specified value type...
virtual ConstraintType getConstraintType(StringRef Constraint) const
Given a constraint, return the type of constraint it is for this target.
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...
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
unsigned getVectorNumElements() const
Given a vector type, return the number of elements it contains.
unsigned TLSSize
Bit size of immediate TLS offsets (0 == use the default).
MachineBasicBlock * EmitLoweredCatchPad(MachineInstr &MI, MachineBasicBlock *BB) const
size_t size() const
size - Get the array size.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This is an important base class in LLVM.
void incNumLocalDynamicTLSAccesses()
VAEND, VASTART - VAEND and VASTART have three operands: an input chain, pointer, and a SRCVALUE...
bool isFloatingPointOperation() const
iterator_range< value_op_iterator > op_values() const
const SDValue & getOperand(unsigned Num) const
LoadExtType
LoadExtType enum - This enum defines the three variants of LOADEXT (load with extension).
INSERT_VECTOR_ELT(VECTOR, VAL, IDX) - Returns VECTOR with the element at IDX replaced with VAL...
TargetLoweringBase::LegalizeTypeAction getPreferredVectorAction(MVT VT) const override
Return the preferred vector type legalization action.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
unsigned getVarArgsGPRSize() const
bool isPointerTy() const
True if this is an instance of PointerType.
static const MVT MVT_CC
Value type used for condition codes.
Carry-using nodes for multiple precision addition and subtraction.
TypeSize getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
static SDValue tryCombineLongOpWithDup(unsigned IID, SDNode *N, TargetLowering::DAGCombinerInfo &DCI, SelectionDAG &DAG)
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
unsigned getVarArgsFPRSize() const
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 ...
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...
bool isAcquireOrStronger(AtomicOrdering ao)
std::pair< SDValue, SDValue > SplitVectorOperand(const SDNode *N, unsigned OpNo)
Split the node's operand with EXTRACT_SUBVECTOR and return the low/high part.
static SDValue performSVEAndCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI)
CCAssignFn * CCAssignFnForReturn(CallingConv::ID CC) const
Selects the correct CCAssignFn for a given CallingConvention value.
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)
EHPersonality classifyEHPersonality(const Value *Pers)
See if the given exception handling personality function is one that we understand.
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...
static Type * getVoidTy(LLVMContext &C)
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...
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of 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...
static unsigned getCmpOperandFoldingProfit(SDValue Op)
Returns how profitable it is to fold a comparison's operand's shift and/or extension operations...
virtual ConstraintWeight getSingleConstraintMatchWeight(AsmOperandInfo &info, const char *constraint) const
Examine constraint string and operand type and determine a weight value.
void setSRetReturnReg(unsigned Reg)
static bool mayTailCallThisCC(CallingConv::ID CC)
Return true if we might ever do TCO for calls with this calling convention.
void setOperationPromotedToType(unsigned Opc, MVT OrigVT, MVT DestVT)
Convenience method to set an operation to Promote and specify the type in a single call...
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)
void ReplaceAllUsesWith(SDValue From, SDValue To)
Modify anything using 'From' to use 'To' instead.
MVT getPointerMemTy(const DataLayout &DL, uint32_t AS=0) const
Return the in-memory pointer type for the given address space, defaults to the pointer type from the ...
match_combine_or< CastClass_match< OpTy, Instruction::ZExt >, CastClass_match< OpTy, Instruction::SExt > > m_ZExtOrSExt(const OpTy &Op)
TypeSize getStoreSize() const
Return the number of bytes overwritten by a store of the specified value type.
void computeMaxCallFrameSize(const MachineFunction &MF)
Computes the maximum size of a callframe and the AdjustsStack property.
const uint32_t * getThisReturnPreservedMask(const MachineFunction &MF, CallingConv::ID) const
getThisReturnPreservedMask - Returns a call preserved mask specific to the case that 'returned' is on...
TRAP - Trapping instruction.
const APInt & getAPIntValue() const
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
std::string getEVTString() const
This function returns value type as a string, e.g. "i32".
unsigned GuaranteedTailCallOpt
GuaranteedTailCallOpt - This flag is enabled when -tailcallopt is specified on the commandline...
const Triple & getTargetTriple() const
Value * getPointerOperand()
static bool isAdvSIMDModImmType8(uint64_t Imm)
static SDValue getPTest(SelectionDAG &DAG, EVT VT, SDValue Pg, SDValue Op, AArch64CC::CondCode Cond)
AssertSext, AssertZext - These nodes record if a register contains a value that has already been zero...
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.
DEBUGTRAP - Trap intended to get the attention of a debugger.
static SDValue tryConvertSVEWideCompare(SDNode *N, unsigned ReplacementIID, bool Invert, TargetLowering::DAGCombinerInfo &DCI, SelectionDAG &DAG)
self_iterator getIterator()
The memory access is non-temporal.
bool hasNUsesOfValue(unsigned NUses, unsigned Value) const
Return true if there are exactly NUSES uses of the indicated value.
const MCPhysReg * getCalleeSavedRegsViaCopy(const MachineFunction *MF) const
Class to represent integer types.
CondCode getSetCCSwappedOperands(CondCode Operation)
Return the operation corresponding to (Y op X) when given the operation for (X op Y)...
static MVT getVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
std::pair< NoneType, bool > insert(const T &V)
insert - Insert an element into the set if it isn't already there.
void setVarArgsGPRIndex(int Index)
SmallVectorImpl< ForwardedRegister > & getForwardedMustTailRegParms()
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.
auto find_if(R &&Range, UnaryPredicate P) -> decltype(adl_begin(Range))
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly...
IntegerType * getIntNTy(unsigned N)
Fetch the type representing an N-bit integer.
TargetLoweringBase::AtomicExpansionKind shouldExpandAtomicRMWInIR(AtomicRMWInst *AI) const override
Returns how the IR-level AtomicExpand pass should expand the given AtomicRMW, if at all...
const Function * getFunction() const
Return the function this instruction belongs to.
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 number of store instructions per memmove call.
auto remove_if(R &&Range, UnaryPredicate P) -> decltype(adl_begin(Range))
Provide wrappers to std::remove_if which take ranges instead of having to pass begin/end explicitly...
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
ConstantSDNode * getConstantSplatNode(const APInt &DemandedElts, BitVector *UndefElements=nullptr) const
Returns the demanded splatted constant or null if this is not a constant splat.
Helper structure to be able to read SetCC information.
Val, OUTCHAIN = ATOMIC_CMP_SWAP(INCHAIN, ptr, cmp, swap) For double-word atomic operations: ValLo...
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)
Type * getIndexedType() const
std::vector< ArgListEntry > ArgListTy
MO_HI12 - This flag indicates that a symbol operand represents the bits 13-24 of a 64-bit address...
virtual Value * getSafeStackPointerLocation(IRBuilder<> &IRB) const
Returns the target-specific address of the unsafe stack pointer.
unsigned getAlignment() const
bool isIntN(unsigned N, int64_t x)
Checks if an signed integer fits into the given (dynamic) bit width.
iterator erase(const_iterator CI)
static SDValue performIntToFpCombine(SDNode *N, SelectionDAG &DAG, const AArch64Subtarget *Subtarget)
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...
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
unsigned 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...
Value * CreateExtractValue(Value *Agg, ArrayRef< unsigned > Idxs, const Twine &Name="")
This structure contains all information that is necessary for lowering calls.
auto find(R &&Range, const T &Val) -> decltype(adl_begin(Range))
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly...
bool isBeforeLegalizeOps() const
PointerType * getInt8PtrTy(unsigned AddrSpace=0)
Fetch the type representing a pointer to an 8-bit integer value.
static PointerType * getInt8PtrTy(LLVMContext &C, unsigned AS=0)
static SDValue GenerateTBL(SDValue Op, ArrayRef< int > ShuffleMask, SelectionDAG &DAG)
static SDValue LowerTruncateVectorStore(SDLoc DL, StoreSDNode *ST, EVT VT, EVT MemVT, SelectionDAG &DAG)
const TargetMachine & getTargetMachine() const
This class contains a discriminated union of information about pointers in memory operands...
MO_TLS - Indicates that the operand being accessed is some kind of thread-local symbol.
unsigned getNumOperands() const
Return the number of values used by this operation.
static SDValue LowerXOR(SDValue Op, SelectionDAG &DAG)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static uint8_t encodeAdvSIMDModImmType12(uint64_t Imm)
EVT getValueType(const DataLayout &DL, Type *Ty, bool AllowUnknown=false) const
Return the EVT corresponding to this LLVM type.
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...
This struct is a compact representation of a valid (non-zero power of two) alignment.
SDValue getLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr)
Loads are not normal binary operators: their result type is not determined by their operands...
Triple - Helper class for working with autoconf configuration names.
SDValue getTargetBlockAddress(const BlockAddress *BA, EVT VT, int64_t Offset=0, unsigned TargetFlags=0)
static bool findEXTRHalf(SDValue N, SDValue &Src, uint32_t &ShiftAmount, bool &FromHi)
An EXTR instruction is made up of two shifts, ORed together.
The memory access writes data.
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.
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.
TargetLoweringBase::AtomicExpansionKind shouldExpandAtomicCmpXchgInIR(AtomicCmpXchgInst *AI) const override
Returns how the given atomic cmpxchg should be expanded by the IR-level AtomicExpand pass...
static cl::opt< bool > EnableAArch64SlrGeneration("aarch64-shift-insert-generation", cl::Hidden, cl::desc("Allow AArch64 SLI/SRI formation"), cl::init(false))
bool isReleaseOrStronger(AtomicOrdering ao)
static uint8_t encodeAdvSIMDModImmType2(uint64_t Imm)
static SDValue performSignExtendInRegCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, SelectionDAG &DAG)
SDValue getBitcast(EVT VT, SDValue V)
Return a bitcast using the SDLoc of the value operand, and casting to the provided type...
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
Libcall getFPEXT(EVT OpVT, EVT RetVT)
getFPEXT - Return the FPEXT_*_* value for the given types, or UNKNOWN_LIBCALL if there is none...
static uint64_t encodeLogicalImmediate(uint64_t imm, unsigned regSize)
encodeLogicalImmediate - Return the encoded immediate value for a logical immediate instruction of th...
APInt ashr(unsigned ShiftAmt) const
Arithmetic right-shift function.
RESULT = [US]ADDSAT(LHS, RHS) - Perform saturation addition on 2 integers with the same bit width (W)...
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...
void dump() const
Dump this node, for debugging.
static SDValue LowerBITCAST(SDValue Op, SelectionDAG &DAG)
const TargetLowering & getTargetLoweringInfo() const
SDValue getTargetConstantPool(const Constant *C, EVT VT, unsigned Align=0, int Offset=0, unsigned TargetFlags=0)
bool lowerInterleavedLoad(LoadInst *LI, ArrayRef< ShuffleVectorInst *> Shuffles, ArrayRef< unsigned > Indices, unsigned Factor) const override
Lower an interleaved load into a ldN intrinsic.
bool preferIncOfAddToSubOfNot(EVT VT) const override
These two forms are equivalent: sub y, (xor x, -1) add (add x, 1), y The variant with two add's is IR...
bool shouldExpandShift(SelectionDAG &DAG, SDNode *N) const override
Return true if SHIFT instructions should be expanded to SHIFT_PARTS instructions, and false if a libr...
Iterator for intrusive lists based on ilist_node.
bool shouldReduceLoadWidth(SDNode *Load, ISD::LoadExtType ExtTy, EVT NewVT) const override
Return true if it is profitable to reduce a load to a smaller type.
CCState - This class holds information needed while lowering arguments and return values...
SDValue getTargetGlobalAddress(const GlobalValue *GV, const SDLoc &DL, EVT VT, int64_t offset=0, unsigned TargetFlags=0)
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
unsigned getBytesInStackArgArea() const
void addSuccessor(MachineBasicBlock *Succ, BranchProbability Prob=BranchProbability::getUnknown())
Add Succ as a successor of this MachineBasicBlock.
virtual bool shouldReduceLoadWidth(SDNode *Load, ISD::LoadExtType ExtTy, EVT NewVT) const
Return true if it is profitable to reduce a load to a smaller type.
static unsigned getIntrinsicID(const SDNode *N)
This is the shared class of boolean and integer constants.
static SDValue createGPRPairNode(SelectionDAG &DAG, SDValue V)
static SDValue splitStoreSplat(SelectionDAG &DAG, StoreSDNode &St, SDValue SplatVal, unsigned NumVecElts)
Align max(MaybeAlign Lhs, Align Rhs)
EXTRACT_VECTOR_ELT(VECTOR, IDX) - Returns a single element from VECTOR identified by the (potentially...
EVT getVectorElementType() const
Given a vector type, return the type of each element.
testing::Matcher< const detail::ErrorHolder & > Failed()
unsigned getScalarSizeInBits() const LLVM_READONLY
If this is a vector type, return the getPrimitiveSizeInBits value for the element type...
This struct is a compact representation of a valid (power of two) or undefined (0) alignment...
static SDValue tryAdvSIMDModImm321s(unsigned NewOp, SDValue Op, SelectionDAG &DAG, const APInt &Bits)
CallingConv::ID getCallingConv() const
getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this functio...
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.
static bool isCMN(SDValue Op, ISD::CondCode CC)
SDValue getZExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT)
Convert Op, which must be of integer type, to the integer type VT, by either zero-extending or trunca...
AArch64TargetLowering(const TargetMachine &TM, const AArch64Subtarget &STI)
unsigned getMaximumJumpTableSize() const
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
static mvt_range integer_scalable_vector_valuetypes()
Module.h This file contains the declarations for the Module class.
Instruction * user_back()
Specialize the methods defined in Value, as we know that an instruction can only be used by other ins...
static void getShuffleMask(const Constant *Mask, SmallVectorImpl< int > &Result)
Convert the input shuffle mask operand to a vector of integers.
unsigned getMaximumJumpTableSize() const
Return upper limit for number of entries in a jump table.
bool CC_AArch64_Win64_VarArg(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
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)
void addCallSiteInfo(const SDNode *CallNode, CallSiteInfoImpl &&CallInfo)
CCValAssign - Represent assignment of one arg/retval to a location.
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.
EVT changeVectorElementTypeToInteger() const
Return a vector with the same number of elements as this vector, but with the element type converted ...
BRCOND - Conditional branch.
An SDNode that represents everything that will be needed to construct a MachineInstr.
static bool isAllConstantBuildVector(const SDValue &PotentialBVec, uint64_t &ConstVal)
Byte Swap and Counting operators.
This is an abstract virtual class for memory operations.
int CreateFixedObject(uint64_t Size, int64_t SPOffset, bool IsImmutable, bool isAliased=false)
Create a new object at a fixed location on the stack.
virtual Function * getSSPStackGuardCheck(const Module &M) const
If the target has a standard stack protection check function that performs validation and error handl...
const Constant * getConstVal() const
bool isCalledByLegalizer() 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)
bool shouldSinkOperands(Instruction *I, SmallVectorImpl< Use *> &Ops) const override
Check if sinking I's operands to I's basic block is profitable, because the operands can be folded in...
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 hasMustTailInVarArgFunc() const
Returns true if the function is variadic and contains a musttail call.
FunctionCallee getOrInsertFunction(StringRef Name, FunctionType *T, AttributeList AttributeList)
Look up the specified function in the module symbol table.
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.
static SDValue tryAdvSIMDModImmFP(unsigned NewOp, SDValue Op, SelectionDAG &DAG, const APInt &Bits)
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
SDValue getCopyToReg(SDValue Chain, const SDLoc &dl, unsigned Reg, SDValue N)
const Function & getFunction() const
Return the LLVM function that this machine code represents.
MVT getScalarType() const
If this is a vector, return the element type, otherwise return this.
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.
unsigned logBase2() const
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...
unsigned Log2_32(uint32_t Value)
Return the floor log base 2 of the specified value, -1 if the value is zero.
Function * getFunction(StringRef Name) const
Look up the specified function in the module symbol table.
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)
unsigned getVectorNumElements() const
FunctionType * getFunctionType() const
Returns the FunctionType for me.
Class to represent vector types.
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 Module * getModule() const
Return the module owning the function this instruction belongs to or nullptr it the function does not...
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...
EVT getMemoryVT() const
Return the type of the in-memory value.
static unsigned getNZCVToSatisfyCondCode(CondCode Code)
Given a condition code, return NZCV flags that would satisfy that condition.
bool isTypeLegal(EVT VT) const
Return true if the target has native support for the specified value type.
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.
unsigned getByValAlign() const
CodeModel::Model getCodeModel() const
Returns the code model.
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()
amdgpu Simplify well known AMD library false FunctionCallee Callee
A "pseudo-class" with methods for operating on BUILD_VECTORs.
Select(COND, TRUEVAL, FALSEVAL).
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...
bool bitsLT(EVT VT) const
Return true if this has less bits than VT.
bool isPowerOf2() const
Check if this APInt's value is a power of two greater than zero.
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 setMaximumJumpTableSize(unsigned)
Indicate the maximum number of entries in jump tables.
ZERO_EXTEND - Used for integer types, zeroing the new bits.
void UpdateCustomCallPreservedMask(MachineFunction &MF, const uint32_t **Mask) const
IntegerType * getInt8Ty()
Fetch the type representing an 8-bit integer.
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).
SDValue getGlobalAddress(const GlobalValue *GV, const SDLoc &DL, EVT VT, int64_t offset=0, bool isTargetGA=false, unsigned TargetFlags=0)
static SDValue performMulCombine(SDNode *N, SelectionDAG &DAG, TargetLowering::DAGCombinerInfo &DCI, const AArch64Subtarget *Subtarget)
static SDValue tryAdvSIMDModImm64(unsigned NewOp, SDValue Op, SelectionDAG &DAG, const APInt &Bits)
iterator insert(iterator I, T &&Elt)
FCOPYSIGN(X, Y) - Return the value of X with the sign of Y.
Value * CreatePointerCast(Value *V, Type *DestTy, const Twine &Name="")
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
const uint32_t * getWindowsStackProbePreservedMask() const
Stack probing calls preserve different CSRs to the normal CC.
void expandMOVImm(uint64_t Imm, unsigned BitSize, SmallVectorImpl< ImmInsnModel > &Insn)
Expand a MOVi32imm or MOVi64imm pseudo instruction to one or more real move-immediate instructions to...
static SDValue skipExtensionForVectorMULL(SDNode *N, SelectionDAG &DAG)
CATCHRET - Represents a return from a catch block funclet.
static SDValue performPostLD1Combine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, bool IsLaneOp)
Target-specific DAG combine function for post-increment LD1 (lane) and post-increment LD1R...
Flags
Flags values. These may be or'd together.
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
The memory access reads data.
static uint8_t encodeAdvSIMDModImmType5(uint64_t Imm)
static bool canEmitConjunction(const SDValue Val, bool &CanNegate, bool &MustBeFirst, bool WillNegate, unsigned Depth=0)
Returns true if Val is a tree of AND/OR/SETCC operations that can be expressed as a conjunction...
std::pair< SDValue, SDValue > LowerCallTo(CallLoweringInfo &CLI) const
This function lowers an abstract call to a function into an actual call.
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.
static SDValue performSTNT1Combine(SDNode *N, SelectionDAG &DAG)
CCAssignFn * CCAssignFnForCall(CallingConv::ID CC, bool IsVarArg) const
Selects the correct CCAssignFn for a given CallingConvention value.
virtual bool shouldProduceAndByConstByHoistingConstFromShiftsLHSOfAnd(SDValue X, ConstantSDNode *XC, ConstantSDNode *CC, SDValue Y, unsigned OldShiftOpcode, unsigned NewShiftOpcode, SelectionDAG &DAG) const
Given the pattern (X & (C l>>/<< Y)) ==/!= 0 return true if it should be transformed into: ((X <</l>> Y) ...
BR_JT - Jumptable branch.
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.
void UpdateCustomCalleeSavedRegs(MachineFunction &MF) const
static bool isAdvSIMDModImmType10(uint64_t Imm)
#define FALKOR_STRIDED_ACCESS_MD
void emitReservedArgRegCallError(const MachineFunction &MF) const
static uint8_t encodeAdvSIMDModImmType8(uint64_t Imm)
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
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...
bool is64BitVector() const
Return true if this is a 64-bit vector type.
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...
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
unsigned getNumArgOperands() const
bool CheckReturn(const SmallVectorImpl< ISD::OutputArg > &Outs, CCAssignFn Fn)
CheckReturn - Analyze the return values of a function, returning true if the return can be performed ...
bool isVector() const
Return true if this is a vector value type.
MachineBasicBlock * EmitF128CSEL(MachineInstr &MI, MachineBasicBlock *BB) const
static SDValue LowerXALUO(SDValue Op, SelectionDAG &DAG)
bool CC_AArch64_Win64_CFGuard_Check(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
Constant * getOrInsertGlobal(StringRef Name, Type *Ty, function_ref< GlobalVariable *()> CreateGlobalCallback)
Look up the specified global in the module symbol table.
bool CC_AArch64_WebKit_JS(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
Bitwise operators - logical and, logical or, logical xor.
pointer data()
Return a pointer to the vector's buffer, even if empty().
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.
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.
unsigned getNumInterleavedAccesses(VectorType *VecTy, const DataLayout &DL) const
Returns the number of interleaved accesses that will be generated when lowering accesses of the given...
unsigned getLocMemOffset() const
bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM, Type *Ty, unsigned AS, Instruction *I=nullptr) const override
Return true if the addressing mode represented by AM is legal for this target, for a load/store of th...
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" ...
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)
MO_COFFSTUB - On a symbol operand "FOO", this indicates that the reference is actually to the "...
LLVM_NODISCARD bool empty() const
bool is128BitVector() const
Return true if this is a 128-bit vector type.
MO_DLLIMPORT - On a symbol operand, this represents that the reference to the symbol is for an import...
SIGN_EXTEND_INREG - This operator atomically performs a SHL/SRA pair to sign extend a small value in ...
void insertSSPDeclarations(Module &M) const override
Inserts necessary declarations for SSP (stack protection) purpose.
uint64_t getKnownMinSize() const
static uint8_t encodeAdvSIMDModImmType11(uint64_t Imm)
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode...
static VectorType * get(Type *ElementType, ElementCount EC)
This static method is the primary way to construct an VectorType.
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
PointerUnion< const Value *, const PseudoSourceValue * > ptrVal
bool isMaskAndCmp0FoldingBeneficial(const Instruction &AndI) const override
Return if the target supports combining a chain like:
const Function * getParent() const
Return the enclosing method, or null if none.
static bool isAddSubSExt(SDNode *N, SelectionDAG &DAG)
void AnalyzeReturn(const SmallVectorImpl< ISD::OutputArg > &Outs, CCAssignFn Fn)
AnalyzeReturn - Analyze the returned values of a return, incorporating info about the result values i...
const TargetSubtargetInfo & getSubtarget() const
FunctionLoweringInfo - This contains information that is global to a function that is used when lower...
Flags getFlags() const
Return the raw flags of the source value,.
unsigned MaxGluedStoresPerMemcpy
Specify max number of store instructions to glue in inlined memcpy.
APFloat abs(APFloat X)
Returns the absolute value of the argument.
MO_PAGEOFF - A symbol operand with this flag represents the offset of that symbol within a 4K page...
bool hasMinSize() const
Optimize this function for minimum size (-Oz).
The memory access always returns the same value (or traps).
unsigned MaxStoresPerMemmoveOptSize
Likewise for functions with the OptSize attribute.
unsigned MaxStoresPerMemcpyOptSize
Likewise for functions with the OptSize attribute.
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)
bool CC_AArch64_AAPCS(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
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...
const BasicBlock * getBasicBlock() const
Return the LLVM basic block that this instance corresponded to originally.
static bool optimizeLogicalImm(SDValue Op, unsigned Size, uint64_t Imm, const APInt &Demanded, TargetLowering::TargetLoweringOpt &TLO, unsigned NewOpc)
void setLibcallName(RTLIB::Libcall Call, const char *Name)
Rename the default libcall routine name for the specified libcall.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
RESULT = [US]SUBSAT(LHS, RHS) - Perform saturation subtraction on 2 integers with the same bit width ...
Type * getValueType() const
bool shouldProduceAndByConstByHoistingConstFromShiftsLHSOfAnd(SDValue X, ConstantSDNode *XC, ConstantSDNode *CC, SDValue Y, unsigned OldShiftOpcode, unsigned NewShiftOpcode, SelectionDAG &DAG) const override
Given the pattern (X & (C l>>/<< Y)) ==/!= 0 return true if it should be transformed into: ((X <</l>> Y) ...
static SDValue performIntrinsicCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI, const AArch64Subtarget *Subtarget)
X = STRICT_FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating point type down to the precision ...
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
CallInst * CreateCall(FunctionType *FTy, Value *Callee, ArrayRef< Value *> Args=None, const Twine &Name="", MDNode *FPMathTag=nullptr)
bool needsFixedCatchObjects() const override
Used for exception handling on Win64.
unsigned getOpcode() const
FSINCOS - Compute both fsin and fcos as a single operation.
SDValue getValue(unsigned R) const
bool useLoadStackGuardNode() const override
If this function returns true, SelectionDAGBuilder emits a LOAD_STACK_GUARD node when it is lowering ...
const uint32_t * getTLSCallPreservedMask() const
virtual Value * getSDagStackGuard(const Module &M) const
Return the variable that's previously inserted by insertSSPDeclarations, if any, otherwise return nul...
unsigned MaxStoresPerMemcpy
Specify maximum number of store instructions per memcpy call.
Value * getSDagStackGuard(const Module &M) const override
Return the variable that's previously inserted by insertSSPDeclarations, if any, otherwise return nul...
const LLVMTargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
ValueT lookup(const_arg_type_t< KeyT > Val) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
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.
bool CC_AArch64_GHC(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
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...
static SDValue replaceZeroVectorStore(SelectionDAG &DAG, StoreSDNode &St)
Replace a splat of zeros to a vector store by scalar stores of WZR/XZR.
unsigned getPointerAddressSpace() const
Returns the address space of the pointer operand.
const MachinePointerInfo & getPointerInfo() const
bool isTargetILP32() const
SDValue getMemIntrinsicNode(unsigned Opcode, const SDLoc &dl, SDVTList VTList, ArrayRef< SDValue > Ops, EVT MemVT, MachinePointerInfo PtrInfo, unsigned Align=0, MachineMemOperand::Flags Flags=MachineMemOperand::MOLoad|MachineMemOperand::MOStore, uint64_t Size=0, const AAMDNodes &AAInfo=AAMDNodes())
Creates a MemIntrinsicNode that may produce a result and takes a list of operands.
bool isLegalAddImmediate(int64_t) const override
Return true if the specified immediate is legal add immediate, that is the target has add instruction...
3: 64-bit floating point type
CONCAT_VECTORS(VECTOR0, VECTOR1, ...) - Given a number of values of vector type with the same length ...
bool MaskedValueIsZero(SDValue Op, const APInt &Mask, unsigned Depth=0) const
Return true if 'Op & Mask' is known to be zero.
bool hasFnAttribute(Attribute::AttrKind Kind) const
Equivalent to hasAttribute(AttributeList::FunctionIndex, Kind) but may be faster. ...
bool EnableExtLdPromotion
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Special calling convention on Windows for calling the Control Guard Check ICall funtion.
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)
bool isAsynchronousEHPersonality(EHPersonality Pers)
Returns true if this personality function catches asynchronous exceptions.
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)
unsigned getVaListSizeInBits(const DataLayout &DL) const override
Returns the size of the platform's va_list object.
int CreateStackObject(uint64_t Size, Align Alignment, bool isSpillSlot, const AllocaInst *Alloca=nullptr, uint8_t ID=0)
Create a new statically sized stack object, returning a nonnegative identifier to represent it...
TypeSize getScalarSizeInBits() const
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.
EVT getOptimalMemOpType(uint64_t Size, unsigned DstAlign, unsigned SrcAlign, bool IsMemset, bool ZeroMemset, bool MemcpyStrSrc, const AttributeList &FuncAttributes) const override
Returns the target specific optimal type for load and store operations as a result of memset...
ArrayRef< int > getMask() const
Module * getParent()
Get the module that this global value is contained inside of...
LLVM Value Representation.
Constant * getPersonalityFn() const
Get the personality function associated with this function.
uint64_t getConstantOperandVal(unsigned Num) const
Helper method returns the integer value of a ConstantSDNode operand.
FMA - Perform a * b + c with no intermediate rounding step.
Integer reductions may have a result type larger than the vector element type.
SDValue getRegister(unsigned Reg, EVT VT)
unsigned getResNo() const
get the index which selects a specific result in the SDNode
Fast - This calling convention attempts to make calls as fast as possible (e.g.
SDValue getAnyExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT)
Convert Op, which must be of integer type, to the integer type VT, by either any-extending or truncat...
FMIN/FMAX nodes can have flags, for NaN/NoNaN variants.
virtual void finalizeLowering(MachineFunction &MF) const
Execute target specific actions to finalize target lowering.
const AArch64InstrInfo * getInstrInfo() const override
static void ReplaceBITCASTResults(SDNode *N, SmallVectorImpl< SDValue > &Results, SelectionDAG &DAG)
EVT changeTypeToInteger()
Return the type converted to an equivalently sized integer or vector with integer element type...
virtual void insertSSPDeclarations(Module &M) const
Inserts necessary declarations for SSP (stack protection) purpose.
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)
std::pair< SDValue, SDValue > makeLibCall(SelectionDAG &DAG, RTLIB::Libcall LC, EVT RetVT, ArrayRef< SDValue > Ops, MakeLibCallOptions CallOptions, const SDLoc &dl, SDValue Chain=SDValue()) const
Returns a pair of (return value, chain).
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.
SDValue getMaskedStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Base, SDValue Offset, SDValue Mask, EVT MemVT, MachineMemOperand *MMO, ISD::MemIndexedMode AM, bool IsTruncating=false, bool IsCompressing=false)
static bool isExtendedBUILD_VECTOR(SDNode *N, SelectionDAG &DAG, bool isSigned)
bool isUndef() const
Return true if the type of the node type undefined.
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)
unsigned getMaxSupportedInterleaveFactor() const override
Get the maximum supported factor for interleaved memory accesses.
void ReplaceAllUsesOfValueWith(SDValue From, SDValue To)
Replace any uses of From with To, leaving uses of other values produced by From.getNode() alone...
Primary interface to the complete machine description for the target machine.
static mvt_range fixedlen_vector_valuetypes()
Type * getElementType() const
static PredicateConstraint parsePredicateConstraint(StringRef Constraint)
int getVarArgsFPRIndex() const
bool hasOneUse() const
Return true if there is exactly one user of this value.
static MachinePointerInfo getStack(MachineFunction &MF, int64_t Offset, uint8_t ID=0)
Stack pointer relative access.
StringRef - Represent a constant reference to a string, i.e.
static SDValue LowerSVEIntReduction(SDNode *N, unsigned Opc, SelectionDAG &DAG)
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.
SDValue ReconstructShuffle(SDValue Op, SelectionDAG &DAG) const
APInt bitcastToAPInt() const
unsigned MaxStoresPerMemset
Specify maximum number of store instructions per memset call.
static uint8_t encodeAdvSIMDModImmType9(uint64_t Imm)
unsigned MaxStoresPerMemsetOptSize
Likewise for functions with the OptSize attribute.
static bool isConcatMask(ArrayRef< int > Mask, EVT VT, bool SplitLHS)
static bool areExtractShuffleVectors(Value *Op1, Value *Op2)
Check if both Op1 and Op2 are shufflevector extracts of either the lower or upper half of the vector ...
static bool isAdvSIMDModImmType11(uint64_t Imm)
KnownBits computeKnownBits(SDValue Op, unsigned Depth=0) const
Determine which bits of Op are known to be either zero or one and return them in Known.
static LLT vector(uint16_t NumElements, unsigned ScalarSizeInBits)
Get a low-level vector of some number of elements and element width.
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)
unsigned getNumOperands() const
MERGE_VALUES - This node takes multiple discrete operands and returns them all as its individual resu...
Register getReg() const
getReg - Returns the register number.
bool isStrictFPOpcode()
Test if this node is a strict floating point pseudo-op.
static bool isVolatile(Instruction *Inst)
const unsigned NeonBitsPerVector
SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override
Provide custom lowering hooks for some operations.
const SDValue & getOperand(unsigned i) const
static SDValue performGlobalAddressCombine(SDNode *N, SelectionDAG &DAG, const AArch64Subtarget *Subtarget, const TargetMachine &TM)
uint64_t getZExtValue() const
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.
bool isSimple() const
Test if the given EVT is simple (as opposed to being extended).
bool isUIntN(unsigned N, uint64_t x)
Checks if an unsigned integer fits into the given (dynamic) bit width.
void setNodeMemRefs(MachineSDNode *N, ArrayRef< MachineMemOperand *> NewMemRefs)
Mutate the specified machine node's memory references to the provided list.
const MachineOperand & getOperand(unsigned i) const
static SDValue emitConjunctionRec(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...
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
bool RetCC_AArch64_AAPCS(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
Perform various unary floating-point operations inspired by libm.
static uint8_t encodeAdvSIMDModImmType7(uint64_t Imm)
VectorType * getType() const
Overload to return most specific vector type.
virtual TargetLoweringBase::LegalizeTypeAction getPreferredVectorAction(MVT VT) const
Return the preferred vector type legalization action.
EVT getTypeToTransformTo(LLVMContext &Context, EVT VT) const
For types supported by the target, this is an identity function.
Value * getPointerOperand()
static SDValue getEstimate(const AArch64Subtarget *ST, unsigned Opcode, SDValue Operand, SelectionDAG &DAG, int &ExtraSteps)
const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
static SDValue performSRLCombine(SDNode *N, TargetLowering::DAGCombinerInfo &DCI)
static cl::opt< bool > EnableOptimizeLogicalImm("aarch64-enable-logical-imm", cl::Hidden, cl::desc("Enable AArch64 logical imm instruction " "optimization"), cl::init(true))
const SDValue & getBasePtr() const
STRICT_FP_TO_[US]INT - Convert a floating point value to a signed or unsigned integer.
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
LLVMContext * getContext() const
static SDValue tryAdvSIMDModImm16(unsigned NewOp, SDValue Op, SelectionDAG &DAG, const APInt &Bits, const SDValue *LHS=nullptr)
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)
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
Type * getElementType() const
bool PredictableSelectIsExpensive
Tells the code generator that select is more expensive than a branch if the branch is usually predict...
void softenSetCCOperands(SelectionDAG &DAG, EVT VT, SDValue &NewLHS, SDValue &NewRHS, ISD::CondCode &CCCode, const SDLoc &DL, const SDValue OldLHS, const SDValue OldRHS) const
Soften the operands of a comparison.
Wrapper class representing virtual and physical registers.
bool empty() const
empty - Check if the array is empty.
static bool canGuaranteeTCO(CallingConv::ID CC)
Return true if the calling convention is one that we can guarantee TCO for.
bool isArrayTy() const
True if this is an instance of ArrayType.
A wrapper class for inspecting calls to intrinsic functions.
void CommitTargetLoweringOpt(const TargetLoweringOpt &TLO)
void insertCopiesSplitCSR(MachineBasicBlock *Entry, const SmallVectorImpl< MachineBasicBlock *> &Exits) const override
Insert explicit copies in entry and exit blocks.
const char * getLibcallName(RTLIB::Libcall Call) const
Get the libcall routine name for the specified libcall.
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)
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...
MachineBasicBlock * emitPatchPoint(MachineInstr &MI, MachineBasicBlock *MBB) const
Replace/modify any TargetFrameIndex operands with a targte-dependent sequence of memory operands that...
size_type count(const T &V) const
count - Return 1 if the element is in the set, 0 otherwise.
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)