Lines Matching refs:getOperand

897     LHS = N.getOperand(0);  in isSetCCEquivalent()
898 RHS = N.getOperand(1); in isSetCCEquivalent()
899 CC = N.getOperand(2); in isSetCCEquivalent()
906 LHS = N.getOperand(1); in isSetCCEquivalent()
907 RHS = N.getOperand(2); in isSetCCEquivalent()
908 CC = N.getOperand(3); in isSetCCEquivalent()
913 !TLI.isConstTrueVal(N.getOperand(2).getNode()) || in isSetCCEquivalent()
914 !TLI.isConstFalseVal(N.getOperand(3).getNode())) in isSetCCEquivalent()
921 LHS = N.getOperand(0); in isSetCCEquivalent()
922 RHS = N.getOperand(1); in isSetCCEquivalent()
923 CC = N.getOperand(4); in isSetCCEquivalent()
996 (LD->getOperand(2).getOpcode() != ISD::TargetConstant || in canSplitIdx()
997 !cast<ConstantSDNode>(LD->getOperand(2))->isOpaque()); in canSplitIdx()
1016 auto *C1 = dyn_cast<ConstantSDNode>(N0.getOperand(1)); in reassociationCanBreakAddressingModePattern()
1065 if (DAG.isConstantIntBuildVectorOrConstantInt(N0.getOperand(1))) { in reassociateOpsCommutative()
1069 DAG.FoldConstantArithmetic(Opc, DL, VT, {N0.getOperand(1), N1})) in reassociateOpsCommutative()
1070 return DAG.getNode(Opc, DL, VT, N0.getOperand(0), OpNode); in reassociateOpsCommutative()
1076 SDValue OpNode = DAG.getNode(Opc, SDLoc(N0), VT, N0.getOperand(0), N1); in reassociateOpsCommutative()
1079 return DAG.getNode(Opc, DL, VT, OpNode, N0.getOperand(1)); in reassociateOpsCommutative()
1227 if (SDValue Op0 = SExtPromoteOperand(Op.getOperand(0), PVT)) in PromoteOperand()
1228 return DAG.getNode(ISD::AssertSext, DL, PVT, Op0, Op.getOperand(1)); in PromoteOperand()
1231 if (SDValue Op0 = ZExtPromoteOperand(Op.getOperand(0), PVT)) in PromoteOperand()
1232 return DAG.getNode(ISD::AssertZext, DL, PVT, Op0, Op.getOperand(1)); in PromoteOperand()
1303 SDValue N0 = Op.getOperand(0); in PromoteIntBinOp()
1307 SDValue N1 = Op.getOperand(1); in PromoteIntBinOp()
1371 SDValue N0 = Op.getOperand(0); in PromoteIntShiftOp()
1372 SDValue N1 = Op.getOperand(1); in PromoteIntShiftOp()
1388 ReplaceLoadWithPromotedLoad(Op.getOperand(0).getNode(), N0.getNode()); in PromoteIntShiftOp()
1420 return DAG.getNode(Op.getOpcode(), SDLoc(Op), VT, Op.getOperand(0)); in PromoteExtend()
1799 SDValue N0 = N->getOperand(0); in combine()
1800 SDValue N1 = N->getOperand(1); in combine()
1819 if (N->getOperand(0).getValueType() == MVT::Other) in getInputChainForNode()
1820 return N->getOperand(0); in getInputChainForNode()
1821 if (N->getOperand(NumOps-1).getValueType() == MVT::Other) in getInputChainForNode()
1822 return N->getOperand(NumOps-1); in getInputChainForNode()
1824 if (N->getOperand(i).getValueType() == MVT::Other) in getInputChainForNode()
1825 return N->getOperand(i); in getInputChainForNode()
1834 if (getInputChainForNode(N->getOperand(0).getNode()) == N->getOperand(1)) in visitTokenFactor()
1835 return N->getOperand(0); in visitTokenFactor()
1836 if (getInputChainForNode(N->getOperand(1).getNode()) == N->getOperand(0)) in visitTokenFactor()
1837 return N->getOperand(1); in visitTokenFactor()
1982 AddToWorklist(i, CurNode->getOperand(0).getNode(), CurOpNumber); in visitTokenFactor()
2031 Ops.push_back(N->getOperand(i)); in visitMERGE_VALUES()
2078 ConstantSDNode *Offset = dyn_cast<ConstantSDNode>(N->getOperand(1)); in canFoldInAddressingMode()
2087 ConstantSDNode *Offset = dyn_cast<ConstantSDNode>(N->getOperand(1)); in canFoldInAddressingMode()
2109 SDValue Sel = BO->getOperand(0); in foldBinOpIntoSelect()
2112 Sel = BO->getOperand(1); in foldBinOpIntoSelect()
2118 SDValue CT = Sel.getOperand(1); in foldBinOpIntoSelect()
2123 SDValue CF = Sel.getOperand(2); in foldBinOpIntoSelect()
2139 SDValue CBO = BO->getOperand(SelOpNo ^ 1); in foldBinOpIntoSelect()
2165 SDValue SelectOp = DAG.getSelect(DL, VT, Sel.getOperand(0), NewCT, NewCF); in foldBinOpIntoSelect()
2178 SDValue C = IsAdd ? N->getOperand(1) : N->getOperand(0); in foldAddSubBoolOfMaskedVal()
2179 SDValue Z = IsAdd ? N->getOperand(0) : N->getOperand(1); in foldAddSubBoolOfMaskedVal()
2185 if (Z.getOperand(0).getOpcode() != ISD::SETCC || in foldAddSubBoolOfMaskedVal()
2186 Z.getOperand(0).getValueType() != MVT::i1) in foldAddSubBoolOfMaskedVal()
2190 SDValue SetCC = Z.getOperand(0); in foldAddSubBoolOfMaskedVal()
2191 ISD::CondCode CC = cast<CondCodeSDNode>(SetCC->getOperand(2))->get(); in foldAddSubBoolOfMaskedVal()
2192 if (CC != ISD::SETEQ || !isNullConstant(SetCC.getOperand(1)) || in foldAddSubBoolOfMaskedVal()
2193 SetCC.getOperand(0).getOpcode() != ISD::AND || in foldAddSubBoolOfMaskedVal()
2194 !isOneConstant(SetCC.getOperand(0).getOperand(1))) in foldAddSubBoolOfMaskedVal()
2203 SDValue LowBit = DAG.getZExtOrTrunc(SetCC.getOperand(0), DL, VT); in foldAddSubBoolOfMaskedVal()
2218 SDValue ConstantOp = IsAdd ? N->getOperand(1) : N->getOperand(0); in foldAddSubOfSignBit()
2219 SDValue ShiftOp = IsAdd ? N->getOperand(0) : N->getOperand(1); in foldAddSubOfSignBit()
2225 SDValue Not = ShiftOp.getOperand(0); in foldAddSubOfSignBit()
2231 SDValue ShAmt = ShiftOp.getOperand(1); in foldAddSubOfSignBit()
2241 SDValue NewShift = DAG.getNode(ShOpcode, DL, VT, Not.getOperand(0), ShAmt); in foldAddSubOfSignBit()
2253 SDValue N0 = N->getOperand(0); in visitADDLike()
2254 SDValue N1 = N->getOperand(1); in visitADDLike()
2292 isConstantOrConstantVector(N0.getOperand(1), /* NoOpaque */ true)) { in visitADDLike()
2294 DAG.FoldConstantArithmetic(ISD::SUB, DL, VT, {N1, N0.getOperand(1)}); in visitADDLike()
2296 return DAG.getNode(ISD::ADD, DL, VT, N0.getOperand(0), Sub); in visitADDLike()
2301 isConstantOrConstantVector(N0.getOperand(0), /* NoOpaque */ true)) { in visitADDLike()
2303 DAG.FoldConstantArithmetic(ISD::ADD, DL, VT, {N1, N0.getOperand(0)}); in visitADDLike()
2305 return DAG.getNode(ISD::SUB, DL, VT, Add, N0.getOperand(1)); in visitADDLike()
2314 SDValue X = N0.getOperand(0); in visitADDLike()
2327 isConstantOrConstantVector(N0.getOperand(1), /* NoOpaque */ true) && in visitADDLike()
2328 DAG.haveNoCommonBitsSet(N0.getOperand(0), N0.getOperand(1))) { in visitADDLike()
2330 {N1, N0.getOperand(1)})) in visitADDLike()
2331 return DAG.getNode(ISD::ADD, DL, VT, N0.getOperand(0), Add0); in visitADDLike()
2347 isConstantOrConstantVector(N0.getOperand(1), /* NoOpaque */ true) && in visitADDLike()
2348 DAG.haveNoCommonBitsSet(N0.getOperand(0), N0.getOperand(1))) { in visitADDLike()
2350 DAG.getNode(ISD::ADD, DL, VT, N1, N0.getOperand(0)), in visitADDLike()
2351 N0.getOperand(1)); in visitADDLike()
2361 if (N0.getOpcode() == ISD::SUB && isNullOrNullSplat(N0.getOperand(0))) in visitADDLike()
2362 return DAG.getNode(ISD::SUB, DL, VT, N1, N0.getOperand(1)); in visitADDLike()
2365 if (N1.getOpcode() == ISD::SUB && isNullOrNullSplat(N1.getOperand(0))) in visitADDLike()
2366 return DAG.getNode(ISD::SUB, DL, VT, N0, N1.getOperand(1)); in visitADDLike()
2369 if (N1.getOpcode() == ISD::SUB && N0 == N1.getOperand(1)) in visitADDLike()
2370 return N1.getOperand(0); in visitADDLike()
2373 if (N0.getOpcode() == ISD::SUB && N1 == N0.getOperand(1)) in visitADDLike()
2374 return N0.getOperand(0); in visitADDLike()
2378 N0.getOperand(0) == N1.getOperand(1)) in visitADDLike()
2379 return DAG.getNode(ISD::SUB, DL, VT, N1.getOperand(0), in visitADDLike()
2380 N0.getOperand(1)); in visitADDLike()
2384 N0.getOperand(1) == N1.getOperand(0)) in visitADDLike()
2385 return DAG.getNode(ISD::SUB, DL, VT, N0.getOperand(0), in visitADDLike()
2386 N1.getOperand(1)); in visitADDLike()
2389 if (N1.getOpcode() == ISD::SUB && N1.getOperand(1).getOpcode() == ISD::ADD && in visitADDLike()
2390 N0 == N1.getOperand(1).getOperand(0)) in visitADDLike()
2391 return DAG.getNode(ISD::SUB, DL, VT, N1.getOperand(0), in visitADDLike()
2392 N1.getOperand(1).getOperand(1)); in visitADDLike()
2395 if (N1.getOpcode() == ISD::SUB && N1.getOperand(1).getOpcode() == ISD::ADD && in visitADDLike()
2396 N0 == N1.getOperand(1).getOperand(1)) in visitADDLike()
2397 return DAG.getNode(ISD::SUB, DL, VT, N1.getOperand(0), in visitADDLike()
2398 N1.getOperand(1).getOperand(0)); in visitADDLike()
2402 N1.getOperand(0).getOpcode() == ISD::SUB && in visitADDLike()
2403 N0 == N1.getOperand(0).getOperand(1)) in visitADDLike()
2404 return DAG.getNode(N1.getOpcode(), DL, VT, N1.getOperand(0).getOperand(0), in visitADDLike()
2405 N1.getOperand(1)); in visitADDLike()
2409 SDValue N00 = N0.getOperand(0); in visitADDLike()
2410 SDValue N01 = N0.getOperand(1); in visitADDLike()
2411 SDValue N10 = N1.getOperand(0); in visitADDLike()
2412 SDValue N11 = N1.getOperand(1); in visitADDLike()
2426 if (ISD::matchBinaryPredicate(N0.getOperand(1), N1, MatchUSUBSAT, in visitADDLike()
2428 return DAG.getNode(ISD::USUBSAT, DL, VT, N0.getOperand(0), in visitADDLike()
2429 N0.getOperand(1)); in visitADDLike()
2439 N0.getOperand(0)); in visitADDLike()
2445 if (isBitwiseNot(N0.getOperand(0))) { in visitADDLike()
2446 A = N0.getOperand(1); in visitADDLike()
2447 Xor = N0.getOperand(0); in visitADDLike()
2448 } else if (isBitwiseNot(N0.getOperand(1))) { in visitADDLike()
2449 A = N0.getOperand(0); in visitADDLike()
2450 Xor = N0.getOperand(1); in visitADDLike()
2454 return DAG.getNode(ISD::SUB, DL, VT, A, Xor.getOperand(0)); in visitADDLike()
2463 SDValue Not = DAG.getNode(ISD::XOR, DL, VT, N0.getOperand(0), in visitADDLike()
2465 return DAG.getNode(ISD::SUB, DL, VT, N0.getOperand(1), Not); in visitADDLike()
2472 SDValue Xor = DAG.getNode(ISD::XOR, DL, VT, N0.getOperand(1), N1); in visitADDLike()
2473 return DAG.getNode(ISD::ADD, DL, VT, Xor, N0.getOperand(0)); in visitADDLike()
2486 SDValue N0 = N->getOperand(0); in visitADD()
2487 SDValue N1 = N->getOperand(1); in visitADD()
2514 (N0.getOperand(1).getOpcode() == ISD::VSCALE) && in visitADD()
2516 const APInt &VS0 = N0.getOperand(1)->getConstantOperandAPInt(0); in visitADD()
2519 return DAG.getNode(ISD::ADD, DL, VT, N0.getOperand(0), VS); in visitADD()
2533 (N0.getOperand(1).getOpcode() == ISD::STEP_VECTOR) && in visitADD()
2535 const APInt &SV0 = N0.getOperand(1)->getConstantOperandAPInt(0); in visitADD()
2539 return DAG.getNode(ISD::ADD, DL, VT, N0.getOperand(0), SV); in visitADD()
2547 SDValue N0 = N->getOperand(0); in visitADDSAT()
2548 SDValue N1 = N->getOperand(1); in visitADDSAT()
2593 V = V.getOperand(0); in getAsCarry()
2597 if (V.getOpcode() == ISD::AND && isOneConstant(V.getOperand(1))) { in getAsCarry()
2599 V = V.getOperand(0); in getAsCarry()
2634 if (N1.getOpcode() != ISD::AND || !isOneOrOneSplat(N1->getOperand(1))) in foldAddSubMasked1()
2638 if (DAG.ComputeNumSignBits(N1.getOperand(0)) != VT.getScalarSizeInBits()) in foldAddSubMasked1()
2643 return DAG.getNode(IsAdd ? ISD::SUB : ISD::ADD, DL, VT, N0, N1.getOperand(0)); in foldAddSubMasked1()
2653 if (N1.getOpcode() == ISD::SHL && N1.getOperand(0).getOpcode() == ISD::SUB && in visitADDLikeCommutative()
2654 isNullOrNullSplat(N1.getOperand(0).getOperand(0))) in visitADDLikeCommutative()
2657 N1.getOperand(0).getOperand(1), in visitADDLikeCommutative()
2658 N1.getOperand(1))); in visitADDLikeCommutative()
2668 N0.getOpcode() == ISD::ADD && isOneOrOneSplat(N0.getOperand(1))) { in visitADDLikeCommutative()
2669 SDValue Not = DAG.getNode(ISD::XOR, DL, VT, N0.getOperand(0), in visitADDLikeCommutative()
2678 isConstantOrConstantVector(N0.getOperand(1), /*NoOpaques=*/true)) { in visitADDLikeCommutative()
2679 SDValue Add = DAG.getNode(ISD::ADD, DL, VT, N0.getOperand(0), N1); in visitADDLikeCommutative()
2680 return DAG.getNode(ISD::SUB, DL, VT, Add, N0.getOperand(1)); in visitADDLikeCommutative()
2685 isConstantOrConstantVector(N0.getOperand(0), /*NoOpaques=*/true)) { in visitADDLikeCommutative()
2686 SDValue Sub = DAG.getNode(ISD::SUB, DL, VT, N1, N0.getOperand(1)); in visitADDLikeCommutative()
2687 return DAG.getNode(ISD::ADD, DL, VT, Sub, N0.getOperand(0)); in visitADDLikeCommutative()
2694 N0.getOperand(0).getScalarValueSizeInBits() == 1 && in visitADDLikeCommutative()
2696 SDValue ZExt = DAG.getNode(ISD::ZERO_EXTEND, DL, VT, N0.getOperand(0)); in visitADDLikeCommutative()
2702 VTSDNode *TN = cast<VTSDNode>(N1.getOperand(1)); in visitADDLikeCommutative()
2704 SDValue ZExt = DAG.getNode(ISD::AND, DL, VT, N1.getOperand(0), in visitADDLikeCommutative()
2711 if (N1.getOpcode() == ISD::ADDCARRY && isNullConstant(N1.getOperand(1)) && in visitADDLikeCommutative()
2714 N0, N1.getOperand(0), N1.getOperand(2)); in visitADDLikeCommutative()
2727 SDValue N0 = N->getOperand(0); in visitADDC()
2728 SDValue N1 = N->getOperand(1); in visitADDC()
2772 ConstantSDNode *Const = isConstOrConstSplat(V.getOperand(1), false); in extractBooleanFlip()
2792 return V.getOperand(0); in extractBooleanFlip()
2799 SDValue N0 = N->getOperand(0); in visitADDO()
2800 SDValue N1 = N->getOperand(1); in visitADDO()
2830 DAG.getConstant(0, DL, VT), N0.getOperand(0)); in visitADDO()
2852 if (N1.getOpcode() == ISD::ADDCARRY && isNullConstant(N1.getOperand(1))) { in visitUADDOLike()
2853 SDValue Y = N1.getOperand(0); in visitUADDOLike()
2857 N1.getOperand(2)); in visitUADDOLike()
2870 SDValue N0 = N->getOperand(0); in visitADDE()
2871 SDValue N1 = N->getOperand(1); in visitADDE()
2872 SDValue CarryIn = N->getOperand(2); in visitADDE()
2889 SDValue N0 = N->getOperand(0); in visitADDCARRY()
2890 SDValue N1 = N->getOperand(1); in visitADDCARRY()
2891 SDValue CarryIn = N->getOperand(2); in visitADDCARRY()
2928 SDValue N0 = N->getOperand(0); in visitSADDO_CARRY()
2929 SDValue N1 = N->getOperand(1); in visitSADDO_CARRY()
2930 SDValue CarryIn = N->getOperand(2); in visitSADDO_CARRY()
2986 isNullConstant(Carry0.getOperand(1))) { in combineADDCARRYDiamond()
2987 Z = Carry0.getOperand(2); in combineADDCARRYDiamond()
2989 isOneConstant(Carry0.getOperand(1))) { in combineADDCARRYDiamond()
2991 Z = DAG.getConstant(1, SDLoc(Carry0.getOperand(1)), VT); in combineADDCARRYDiamond()
3014 if (Carry0.getOperand(0) == Carry1.getValue(0)) { in combineADDCARRYDiamond()
3015 return cancelDiamond(Carry1.getOperand(0), Carry1.getOperand(1)); in combineADDCARRYDiamond()
3025 if (Carry1.getOperand(0) == Carry0.getValue(0)) { in combineADDCARRYDiamond()
3026 return cancelDiamond(Carry0.getOperand(0), Carry1.getOperand(1)); in combineADDCARRYDiamond()
3029 if (Carry1.getOperand(1) == Carry0.getValue(0)) { in combineADDCARRYDiamond()
3030 return cancelDiamond(Carry1.getOperand(0), Carry0.getOperand(0)); in combineADDCARRYDiamond()
3076 if (Carry1.getOperand(0) != Carry0.getValue(0) && in combineCarryDiamond()
3077 Carry1.getOperand(1) != Carry0.getValue(0)) in combineCarryDiamond()
3079 if (Carry1.getOperand(0) != Carry0.getValue(0) && in combineCarryDiamond()
3080 Carry1.getOperand(1) != Carry0.getValue(0)) in combineCarryDiamond()
3085 Carry1.getOperand(0) == Carry0.getValue(0) ? 1 : 0; in combineCarryDiamond()
3088 SDValue CarryIn = Carry1.getOperand(CarryInOperandNum); in combineCarryDiamond()
3098 CarryIn = CarryIn.getOperand(0); in combineCarryDiamond()
3104 DAG.getNode(NewOp, DL, Carry1->getVTList(), Carry0.getOperand(0), in combineCarryDiamond()
3105 Carry0.getOperand(1), CarryIn); in combineCarryDiamond()
3133 N0.getOperand(0), NotC); in visitADDCARRYLike()
3147 N0.getOperand(0), N0.getOperand(1), CarryIn); in visitADDCARRYLike()
3201 SDValue Op0 = N->getOperand(0); in foldSubToUSubSat()
3202 SDValue Op1 = N->getOperand(1); in foldSubToUSubSat()
3207 SDValue MaxLHS = Op0.getOperand(0); in foldSubToUSubSat()
3208 SDValue MaxRHS = Op0.getOperand(1); in foldSubToUSubSat()
3216 SDValue MinLHS = Op1.getOperand(0); in foldSubToUSubSat()
3217 SDValue MinRHS = Op1.getOperand(1); in foldSubToUSubSat()
3226 Op1.getOperand(0).getOpcode() == ISD::UMIN && in foldSubToUSubSat()
3227 Op1.getOperand(0).hasOneUse()) { in foldSubToUSubSat()
3228 SDValue MinLHS = Op1.getOperand(0).getOperand(0); in foldSubToUSubSat()
3229 SDValue MinRHS = Op1.getOperand(0).getOperand(1); in foldSubToUSubSat()
3230 if (MinLHS.getOpcode() == ISD::ZERO_EXTEND && MinLHS.getOperand(0) == Op0) in foldSubToUSubSat()
3233 if (MinRHS.getOpcode() == ISD::ZERO_EXTEND && MinRHS.getOperand(0) == Op0) in foldSubToUSubSat()
3253 SDValue N0 = N->getOperand(0); in visitSUB()
3254 SDValue N1 = N->getOperand(1); in visitSUB()
3295 ConstantSDNode *ShiftAmt = isConstOrConstSplat(N1.getOperand(1)); in visitSUB()
3299 return DAG.getNode(NewSh, DL, VT, N1.getOperand(0), N1.getOperand(1)); in visitSUB()
3328 isNullConstant(N1S.getOperand(0))) { in visitSUB()
3330 return DAG.getSplatVector(VT, DL, N1S.getOperand(1)); in visitSUB()
3331 return DAG.getSplatBuildVector(VT, DL, N1S.getOperand(1)); in visitSUB()
3341 if (N1.getOpcode() == ISD::SUB && isNullOrNullSplat(N1.getOperand(0))) in visitSUB()
3342 return DAG.getNode(ISD::ADD, DL, VT, N0, N1.getOperand(1)); in visitSUB()
3345 if (N1.getOpcode() == ISD::SUB && N0 == N1.getOperand(0)) in visitSUB()
3346 return N1.getOperand(1); in visitSUB()
3349 if (N0.getOpcode() == ISD::ADD && N0.getOperand(0) == N1) in visitSUB()
3350 return N0.getOperand(1); in visitSUB()
3353 if (N0.getOpcode() == ISD::ADD && N0.getOperand(1) == N1) in visitSUB()
3354 return N0.getOperand(0); in visitSUB()
3359 isConstantOrConstantVector(N0.getOperand(1), /* NoOpaques */ true)) { in visitSUB()
3361 DAG.FoldConstantArithmetic(ISD::SUB, DL, VT, {N0.getOperand(1), N1}); in visitSUB()
3363 return DAG.getNode(ISD::ADD, DL, VT, N0.getOperand(0), NewC); in visitSUB()
3368 SDValue N11 = N1.getOperand(1); in visitSUB()
3373 return DAG.getNode(ISD::SUB, DL, VT, NewC, N1.getOperand(0)); in visitSUB()
3380 isConstantOrConstantVector(N0.getOperand(1), /* NoOpaques */ true)) { in visitSUB()
3382 DAG.FoldConstantArithmetic(ISD::ADD, DL, VT, {N0.getOperand(1), N1}); in visitSUB()
3384 return DAG.getNode(ISD::SUB, DL, VT, N0.getOperand(0), NewC); in visitSUB()
3390 isConstantOrConstantVector(N0.getOperand(0), /* NoOpaques */ true)) { in visitSUB()
3392 DAG.FoldConstantArithmetic(ISD::SUB, DL, VT, {N0.getOperand(0), N1}); in visitSUB()
3394 return DAG.getNode(ISD::SUB, DL, VT, NewC, N0.getOperand(1)); in visitSUB()
3399 (N0.getOperand(1).getOpcode() == ISD::SUB || in visitSUB()
3400 N0.getOperand(1).getOpcode() == ISD::ADD) && in visitSUB()
3401 N0.getOperand(1).getOperand(0) == N1) in visitSUB()
3402 return DAG.getNode(N0.getOperand(1).getOpcode(), DL, VT, N0.getOperand(0), in visitSUB()
3403 N0.getOperand(1).getOperand(1)); in visitSUB()
3406 if (N0.getOpcode() == ISD::ADD && N0.getOperand(1).getOpcode() == ISD::ADD && in visitSUB()
3407 N0.getOperand(1).getOperand(1) == N1) in visitSUB()
3408 return DAG.getNode(ISD::ADD, DL, VT, N0.getOperand(0), in visitSUB()
3409 N0.getOperand(1).getOperand(0)); in visitSUB()
3412 if (N0.getOpcode() == ISD::SUB && N0.getOperand(1).getOpcode() == ISD::SUB && in visitSUB()
3413 N0.getOperand(1).getOperand(1) == N1) in visitSUB()
3414 return DAG.getNode(ISD::SUB, DL, VT, N0.getOperand(0), in visitSUB()
3415 N0.getOperand(1).getOperand(0)); in visitSUB()
3420 DAG.getNode(ISD::SUB, DL, VT, N1.getOperand(1), in visitSUB()
3421 N1.getOperand(0))); in visitSUB()
3425 SDValue A = N1.getOperand(0); in visitSUB()
3426 SDValue B = N1.getOperand(1); in visitSUB()
3439 if (N1.getOperand(0).getOpcode() == ISD::SUB && in visitSUB()
3440 isNullOrNullSplat(N1.getOperand(0).getOperand(0))) { in visitSUB()
3442 N1.getOperand(0).getOperand(1), in visitSUB()
3443 N1.getOperand(1)); in visitSUB()
3446 if (N1.getOperand(1).getOpcode() == ISD::SUB && in visitSUB()
3447 isNullOrNullSplat(N1.getOperand(1).getOperand(0))) { in visitSUB()
3449 N1.getOperand(0), in visitSUB()
3450 N1.getOperand(1).getOperand(1)); in visitSUB()
3475 SDValue Xor = DAG.getNode(ISD::XOR, DL, VT, N0.getOperand(1), in visitSUB()
3477 return DAG.getNode(ISD::ADD, DL, VT, Xor, N0.getOperand(0)); in visitSUB()
3485 SDValue Add = DAG.getNode(ISD::ADD, DL, VT, N0, N1.getOperand(0)); in visitSUB()
3492 isConstantOrConstantVector(N0.getOperand(1), /*NoOpaques=*/true)) { in visitSUB()
3493 SDValue Sub = DAG.getNode(ISD::SUB, DL, VT, N0.getOperand(0), N1); in visitSUB()
3494 return DAG.getNode(ISD::ADD, DL, VT, Sub, N0.getOperand(1)); in visitSUB()
3498 isConstantOrConstantVector(N1.getOperand(1), /*NoOpaques=*/true)) { in visitSUB()
3499 SDValue Sub = DAG.getNode(ISD::SUB, DL, VT, N0, N1.getOperand(0)); in visitSUB()
3500 return DAG.getNode(ISD::SUB, DL, VT, Sub, N1.getOperand(1)); in visitSUB()
3505 isConstantOrConstantVector(N0.getOperand(1), /*NoOpaques=*/true)) { in visitSUB()
3506 SDValue Sub = DAG.getNode(ISD::SUB, DL, VT, N0.getOperand(0), N1); in visitSUB()
3507 return DAG.getNode(ISD::SUB, DL, VT, Sub, N0.getOperand(1)); in visitSUB()
3511 isConstantOrConstantVector(N0.getOperand(0), /*NoOpaques=*/true)) { in visitSUB()
3512 SDValue Add = DAG.getNode(ISD::ADD, DL, VT, N0.getOperand(1), N1); in visitSUB()
3513 return DAG.getNode(ISD::SUB, DL, VT, N0.getOperand(0), Add); in visitSUB()
3520 N1.getOperand(0).getScalarValueSizeInBits() == 1 && in visitSUB()
3523 SDValue SExt = DAG.getNode(ISD::SIGN_EXTEND, DL, VT, N1.getOperand(0)); in visitSUB()
3530 SDValue X0 = N0.getOperand(0), X1 = N0.getOperand(1); in visitSUB()
3531 SDValue S0 = N1.getOperand(0); in visitSUB()
3533 if (ConstantSDNode *C = isConstOrConstSplat(N1.getOperand(1))) in visitSUB()
3556 VTSDNode *TN = cast<VTSDNode>(N1.getOperand(1)); in visitSUB()
3558 SDValue ZExt = DAG.getNode(ISD::AND, DL, VT, N1.getOperand(0), in visitSUB()
3580 SDValue ShAmt = N1.getOperand(1); in visitSUB()
3584 SDValue SRA = DAG.getNode(ISD::SRA, DL, VT, N1.getOperand(0), ShAmt); in visitSUB()
3605 SDValue N0 = N->getOperand(0); in visitSUBSAT()
3606 SDValue N1 = N->getOperand(1); in visitSUBSAT()
3639 SDValue N0 = N->getOperand(0); in visitSUBC()
3640 SDValue N1 = N->getOperand(1); in visitSUBC()
3667 SDValue N0 = N->getOperand(0); in visitSUBO()
3668 SDValue N1 = N->getOperand(1); in visitSUBO()
3706 SDValue N0 = N->getOperand(0); in visitSUBE()
3707 SDValue N1 = N->getOperand(1); in visitSUBE()
3708 SDValue CarryIn = N->getOperand(2); in visitSUBE()
3718 SDValue N0 = N->getOperand(0); in visitSUBCARRY()
3719 SDValue N1 = N->getOperand(1); in visitSUBCARRY()
3720 SDValue CarryIn = N->getOperand(2); in visitSUBCARRY()
3733 SDValue N0 = N->getOperand(0); in visitSSUBO_CARRY()
3734 SDValue N1 = N->getOperand(1); in visitSSUBO_CARRY()
3735 SDValue CarryIn = N->getOperand(2); in visitSSUBO_CARRY()
3750 SDValue N0 = N->getOperand(0); in visitMULFIX()
3751 SDValue N1 = N->getOperand(1); in visitMULFIX()
3752 SDValue Scale = N->getOperand(2); in visitMULFIX()
3772 SDValue N0 = N->getOperand(0); in visitMUL()
3773 SDValue N1 = N->getOperand(1); in visitMUL()
3904 isConstantOrConstantVector(N0.getOperand(1), /* NoOpaques */ true)) { in visitMUL()
3905 SDValue C3 = DAG.getNode(ISD::SHL, SDLoc(N), VT, N1, N0.getOperand(1)); in visitMUL()
3907 return DAG.getNode(ISD::MUL, SDLoc(N), VT, N0.getOperand(0), C3); in visitMUL()
3917 isConstantOrConstantVector(N0.getOperand(1)) && in visitMUL()
3921 isConstantOrConstantVector(N1.getOperand(1)) && in visitMUL()
3927 SDValue Mul = DAG.getNode(ISD::MUL, SDLoc(N), VT, Sh.getOperand(0), Y); in visitMUL()
3928 return DAG.getNode(ISD::SHL, SDLoc(N), VT, Mul, Sh.getOperand(1)); in visitMUL()
3935 DAG.isConstantIntBuildVectorOrConstantInt(N0.getOperand(1)) && in visitMUL()
3939 N0.getOperand(0), N1), in visitMUL()
3941 N0.getOperand(1), N1)); in visitMUL()
3980 EVT LegalSVT = N1.getOperand(0).getValueType(); in visitMUL()
4052 SDValue Op0 = Node->getOperand(0); in useDivRem()
4053 SDValue Op1 = Node->getOperand(1); in useDivRem()
4066 User->getOperand(0) == Op0 && in useDivRem()
4067 User->getOperand(1) == Op1) { in useDivRem()
4089 SDValue N0 = N->getOperand(0); in simplifyDivRem()
4090 SDValue N1 = N->getOperand(1); in simplifyDivRem()
4135 SDValue N0 = N->getOperand(0); in visitSDIV()
4136 SDValue N1 = N->getOperand(1); in visitSDIV()
4280 SDValue N0 = N->getOperand(0); in visitUDIV()
4281 SDValue N1 = N->getOperand(1); in visitUDIV()
4352 SDValue N10 = N1.getOperand(0); in visitUDIVLike()
4358 EVT ADDVT = N1.getOperand(1).getValueType(); in visitUDIVLike()
4361 SDValue Add = DAG.getNode(ISD::ADD, DL, ADDVT, N1.getOperand(1), Trunc); in visitUDIVLike()
4380 SDValue N0 = N->getOperand(0); in visitREM()
4381 SDValue N1 = N->getOperand(1); in visitREM()
4418 DAG.isKnownToBeAPowerOfTwo(N1.getOperand(0))) { in visitREM()
4461 SDValue N0 = N->getOperand(0); in visitMULHS()
4462 SDValue N1 = N->getOperand(1); in visitMULHS()
4513 SDValue N0 = N->getOperand(0); in visitMULHU()
4514 SDValue N1 = N->getOperand(1); in visitMULHU()
4636 SDValue Lo = DAG.getNode(ISD::SIGN_EXTEND, DL, NewVT, N->getOperand(0)); in visitSMUL_LOHI()
4637 SDValue Hi = DAG.getNode(ISD::SIGN_EXTEND, DL, NewVT, N->getOperand(1)); in visitSMUL_LOHI()
4661 if (isNullConstant(N->getOperand(1))) { in visitUMUL_LOHI()
4667 if (isOneConstant(N->getOperand(1))) { in visitUMUL_LOHI()
4669 return CombineTo(N, N->getOperand(0), Zero); in visitUMUL_LOHI()
4679 SDValue Lo = DAG.getNode(ISD::ZERO_EXTEND, DL, NewVT, N->getOperand(0)); in visitUMUL_LOHI()
4680 SDValue Hi = DAG.getNode(ISD::ZERO_EXTEND, DL, NewVT, N->getOperand(1)); in visitUMUL_LOHI()
4697 SDValue N0 = N->getOperand(0); in visitMULO()
4698 SDValue N1 = N->getOperand(1); in visitMULO()
4767 SDValue N0 = N->getOperand(0); in visitIMINMAX()
4768 SDValue N1 = N->getOperand(1); in visitIMINMAX()
4813 SDValue N0 = N->getOperand(0), N1 = N->getOperand(1); in hoistLogicOpWithSameOpcodeHands()
4829 SDValue X = N0.getOperand(0); in hoistLogicOpWithSameOpcodeHands()
4830 SDValue Y = N1.getOperand(0); in hoistLogicOpWithSameOpcodeHands()
4883 N0.getOperand(1) == N1.getOperand(1)) { in hoistLogicOpWithSameOpcodeHands()
4888 return DAG.getNode(HandOpcode, DL, VT, Logic, N0.getOperand(1)); in hoistLogicOpWithSameOpcodeHands()
4946 SDValue ShOp = N0.getOperand(1); in hoistLogicOpWithSameOpcodeHands()
4951 if (N0.getOperand(1) == N1.getOperand(1) && ShOp.getNode()) { in hoistLogicOpWithSameOpcodeHands()
4953 N0.getOperand(0), N1.getOperand(0)); in hoistLogicOpWithSameOpcodeHands()
4959 ShOp = N0.getOperand(0); in hoistLogicOpWithSameOpcodeHands()
4964 if (N0.getOperand(0) == N1.getOperand(0) && ShOp.getNode()) { in hoistLogicOpWithSameOpcodeHands()
4965 SDValue Logic = DAG.getNode(LogicOpcode, DL, VT, N0.getOperand(1), in hoistLogicOpWithSameOpcodeHands()
4966 N1.getOperand(1)); in hoistLogicOpWithSameOpcodeHands()
5139 if (ConstantSDNode *ADDI = dyn_cast<ConstantSDNode>(N0.getOperand(1))) { in visitANDLike()
5140 if (ConstantSDNode *SRLI = dyn_cast<ConstantSDNode>(N1.getOperand(1))) { in visitANDLike()
5152 if (DAG.MaskedValueIsZero(N0.getOperand(1), Mask)) { in visitANDLike()
5158 N0.getOperand(0), DAG.getConstant(ADDC, DL, VT)); in visitANDLike()
5174 if (ConstantSDNode *CShift = dyn_cast<ConstantSDNode>(N0.getOperand(1))) { in visitANDLike()
5206 N0.getOperand(0)); in visitANDLike()
5393 cast<VTSDNode>(Op.getOperand(1))->getVT() : in SearchForAndLoads()
5394 Op.getOperand(0).getValueType(); in SearchForAndLoads()
5436 auto *Mask = dyn_cast<ConstantSDNode>(N->getOperand(1)); in BackwardsPropagateMask()
5444 if (isa<LoadSDNode>(N->getOperand(0))) in BackwardsPropagateMask()
5455 SDValue MaskOp = N->getOperand(1); in BackwardsPropagateMask()
5471 SDValue Op0 = LogicN->getOperand(0); in BackwardsPropagateMask()
5472 SDValue Op1 = LogicN->getOperand(1); in BackwardsPropagateMask()
5497 DAG.ReplaceAllUsesWith(N, N->getOperand(0).getNode()); in BackwardsPropagateMask()
5511 SDValue N0 = N->getOperand(0); in unfoldExtremeBitClearingToShifts()
5512 SDValue N1 = N->getOperand(1); in unfoldExtremeBitClearingToShifts()
5532 if (!isAllOnesConstant(M->getOperand(0))) in unfoldExtremeBitClearingToShifts()
5534 Y = M->getOperand(1); in unfoldExtremeBitClearingToShifts()
5571 SDValue Not = And->getOperand(0), And1 = And->getOperand(1); in combineShiftAnd1ToBitTest()
5573 Not = Not.getOperand(0); in combineShiftAnd1ToBitTest()
5580 SDValue Srl = Not.getOperand(0); in combineShiftAnd1ToBitTest()
5582 Srl = Srl.getOperand(0); in combineShiftAnd1ToBitTest()
5586 !isa<ConstantSDNode>(Srl.getOperand(1))) in combineShiftAnd1ToBitTest()
5600 SDValue X = DAG.getZExtOrTrunc(Srl.getOperand(0), DL, VT); in combineShiftAnd1ToBitTest()
5611 SDValue N0 = N->getOperand(0); in visitAND()
5612 SDValue N1 = N->getOperand(1); in visitAND()
5706 ISD::matchBinaryPredicate(N0.getOperand(1), N1, MatchSubset)) in visitAND()
5710 SDValue N0Op0 = N0.getOperand(0); in visitAND()
5735 N0.getValueSizeInBits() == N0.getOperand(0).getScalarValueSizeInBits() && in visitAND()
5736 N0.getOperand(0).getOpcode() == ISD::LOAD && in visitAND()
5737 N0.getOperand(0).getResNo() == 0) || in visitAND()
5740 N0 : N0.getOperand(0) ); in visitAND()
5859 N0.getOperand(0).getOpcode() == ISD::LOAD))) { in visitAND()
5862 ? cast<LoadSDNode>(N0.getOperand(0)) : cast<LoadSDNode>(N0); in visitAND()
5894 if (isNullOrNullSplat(N0.getOperand(0))) { in visitAND()
5895 SDValue SubRHS = N0.getOperand(1); in visitAND()
5897 SubRHS.getOperand(0).getScalarValueSizeInBits() == 1) in visitAND()
5900 SubRHS.getOperand(0).getScalarValueSizeInBits() == 1) in visitAND()
5901 return DAG.getNode(ISD::ZERO_EXTEND, SDLoc(N), VT, SubRHS.getOperand(0)); in visitAND()
5936 if (SDValue BSwap = MatchBSwapHWordLow(N0.getNode(), N0.getOperand(0), in visitAND()
5937 N0.getOperand(1), false)) in visitAND()
5963 LHS.getOperand(0).getValueType().getFixedSizeInBits())) in visitAND()
5971 return DAG.getNode(ISD::ZERO_EXTEND, SDLoc(N), VT, N0.getOperand(0)); in visitAND()
5991 if (N0.getOpcode() == ISD::AND && N0.getOperand(0).getOpcode() == ISD::SRL) in MatchBSwapHWordLow()
5993 if (N1.getOpcode() == ISD::AND && N1.getOperand(0).getOpcode() == ISD::SHL) in MatchBSwapHWordLow()
5998 ConstantSDNode *N01C = dyn_cast<ConstantSDNode>(N0.getOperand(1)); in MatchBSwapHWordLow()
6004 N0 = N0.getOperand(0); in MatchBSwapHWordLow()
6011 ConstantSDNode *N11C = dyn_cast<ConstantSDNode>(N1.getOperand(1)); in MatchBSwapHWordLow()
6014 N1 = N1.getOperand(0); in MatchBSwapHWordLow()
6025 ConstantSDNode *N01C = dyn_cast<ConstantSDNode>(N0.getOperand(1)); in MatchBSwapHWordLow()
6026 ConstantSDNode *N11C = dyn_cast<ConstantSDNode>(N1.getOperand(1)); in MatchBSwapHWordLow()
6033 SDValue N00 = N0->getOperand(0); in MatchBSwapHWordLow()
6037 ConstantSDNode *N001C = dyn_cast<ConstantSDNode>(N00.getOperand(1)); in MatchBSwapHWordLow()
6040 N00 = N00.getOperand(0); in MatchBSwapHWordLow()
6044 SDValue N10 = N1->getOperand(0); in MatchBSwapHWordLow()
6048 ConstantSDNode *N101C = dyn_cast<ConstantSDNode>(N10.getOperand(1)); in MatchBSwapHWordLow()
6054 N10 = N10.getOperand(0); in MatchBSwapHWordLow()
6103 SDValue N0 = N.getOperand(0); in isBSwapHWordElement()
6111 N1C = dyn_cast<ConstantSDNode>(N.getOperand(1)); in isBSwapHWordElement()
6113 N1C = dyn_cast<ConstantSDNode>(N0.getOperand(1)); in isBSwapHWordElement()
6142 ConstantSDNode *C = dyn_cast<ConstantSDNode>(N0.getOperand(1)); in isBSwapHWordElement()
6150 ConstantSDNode *C = dyn_cast<ConstantSDNode>(N0.getOperand(1)); in isBSwapHWordElement()
6159 ConstantSDNode *C = dyn_cast<ConstantSDNode>(N.getOperand(1)); in isBSwapHWordElement()
6167 ConstantSDNode *C = dyn_cast<ConstantSDNode>(N.getOperand(1)); in isBSwapHWordElement()
6175 Parts[MaskByteOffset] = N0.getOperand(0).getNode(); in isBSwapHWordElement()
6182 return isBSwapHWordElement(N.getOperand(0), Parts) && in isBSwapHWordPair()
6183 isBSwapHWordElement(N.getOperand(1), Parts); in isBSwapHWordPair()
6185 if (N.getOpcode() == ISD::SRL && N.getOperand(0).getOpcode() == ISD::BSWAP) { in isBSwapHWordPair()
6186 ConstantSDNode *C = isConstOrConstSplat(N.getOperand(1)); in isBSwapHWordPair()
6189 Parts[0] = Parts[1] = N.getOperand(0).getOperand(0).getNode(); in isBSwapHWordPair()
6212 ConstantSDNode *Mask0 = isConstOrConstSplat(N0.getOperand(1)); in matchBSwapHWordOrAndAnd()
6213 ConstantSDNode *Mask1 = isConstOrConstSplat(N1.getOperand(1)); in matchBSwapHWordOrAndAnd()
6219 SDValue Shift0 = N0.getOperand(0); in matchBSwapHWordOrAndAnd()
6220 SDValue Shift1 = N1.getOperand(0); in matchBSwapHWordOrAndAnd()
6223 ConstantSDNode *ShiftAmt0 = isConstOrConstSplat(Shift0.getOperand(1)); in matchBSwapHWordOrAndAnd()
6224 ConstantSDNode *ShiftAmt1 = isConstOrConstSplat(Shift1.getOperand(1)); in matchBSwapHWordOrAndAnd()
6229 if (Shift0.getOperand(0) != Shift1.getOperand(0)) in matchBSwapHWordOrAndAnd()
6233 SDValue BSwap = DAG.getNode(ISD::BSWAP, DL, VT, Shift0.getOperand(0)); in matchBSwapHWordOrAndAnd()
6278 SDValue N00 = N0.getOperand(0); in MatchBSwapHWord()
6279 SDValue N01 = N0.getOperand(1); in MatchBSwapHWord()
6326 getAsNonOpaqueConstant(N0.getOperand(1))) { in visitORLike()
6328 getAsNonOpaqueConstant(N1.getOperand(1))) { in visitORLike()
6334 if (DAG.MaskedValueIsZero(N0.getOperand(0), RHSMask&~LHSMask) && in visitORLike()
6335 DAG.MaskedValueIsZero(N1.getOperand(0), LHSMask&~RHSMask)) { in visitORLike()
6337 N0.getOperand(0), N1.getOperand(0)); in visitORLike()
6348 N0.getOperand(0) == N1.getOperand(0) && in visitORLike()
6352 N0.getOperand(1), N1.getOperand(1)); in visitORLike()
6353 return DAG.getNode(ISD::AND, DL, VT, N0.getOperand(0), X); in visitORLike()
6365 if (isBitwiseNot(N0.getOperand(1)) && N0.getOperand(1).getOperand(0) == N1) in visitORCommutative()
6366 return DAG.getNode(ISD::OR, SDLoc(N), VT, N0.getOperand(0), N1); in visitORCommutative()
6369 if (isBitwiseNot(N0.getOperand(0)) && N0.getOperand(0).getOperand(0) == N1) in visitORCommutative()
6370 return DAG.getNode(ISD::OR, SDLoc(N), VT, N0.getOperand(1), N1); in visitORCommutative()
6377 SDValue N0 = N->getOperand(0); in visitOR()
6378 SDValue N1 = N->getOperand(1); in visitOR()
6410 bool ZeroN00 = ISD::isBuildVectorAllZeros(N0.getOperand(0).getNode()); in visitOR()
6411 bool ZeroN01 = ISD::isBuildVectorAllZeros(N0.getOperand(1).getNode()); in visitOR()
6412 bool ZeroN10 = ISD::isBuildVectorAllZeros(N1.getOperand(0).getNode()); in visitOR()
6413 bool ZeroN11 = ISD::isBuildVectorAllZeros(N1.getOperand(1).getNode()); in visitOR()
6455 SDValue NewLHS = ZeroN00 ? N0.getOperand(1) : N0.getOperand(0); in visitOR()
6456 SDValue NewRHS = ZeroN10 ? N1.getOperand(1) : N1.getOperand(0); in visitOR()
6515 ISD::matchBinaryPredicate(N0.getOperand(1), N1, MatchIntersect, true)) { in visitOR()
6517 {N1, N0.getOperand(1)})) { in visitOR()
6518 SDValue IOR = DAG.getNode(ISD::OR, SDLoc(N0), VT, N0.getOperand(0), N1); in visitOR()
6556 DAG.isConstantIntBuildVectorOrConstantInt(Op.getOperand(1))) { in stripConstantMask()
6557 Mask = Op.getOperand(1); in stripConstantMask()
6558 return Op.getOperand(0); in stripConstantMask()
6609 SDValue OppShiftLHS = OppShift.getOperand(0); in extractShiftForRotate()
6613 ConstantSDNode *OppShiftCst = isConstOrConstSplat(OppShift.getOperand(1)); in extractShiftForRotate()
6619 ExtractFrom.getOperand(0) == ExtractFrom.getOperand(1) && in extractShiftForRotate()
6620 ExtractFrom.getOperand(0) == OppShiftLHS && in extractShiftForRotate()
6649 OppShiftLHS.getOperand(0) != ExtractFrom.getOperand(0) || in extractShiftForRotate()
6654 ConstantSDNode *OppLHSCst = isConstOrConstSplat(OppShiftLHS.getOperand(1)); in extractShiftForRotate()
6657 isConstOrConstSplat(ExtractFrom.getOperand(1)); in extractShiftForRotate()
6699 EVT ShiftVT = OppShift.getOperand(1).getValueType(); in extractShiftForRotate()
6755 if (ConstantSDNode *NegC = isConstOrConstSplat(Neg.getOperand(1))) { in matchRotateSub()
6756 KnownBits Known = DAG.computeKnownBits(Neg.getOperand(0)); in matchRotateSub()
6760 Neg = Neg.getOperand(0); in matchRotateSub()
6769 ConstantSDNode *NegC = isConstOrConstSplat(Neg.getOperand(0)); in matchRotateSub()
6772 SDValue NegOp1 = Neg.getOperand(1); in matchRotateSub()
6777 if (ConstantSDNode *PosC = isConstOrConstSplat(Pos.getOperand(1))) { in matchRotateSub()
6778 KnownBits Known = DAG.computeKnownBits(Pos.getOperand(0)); in matchRotateSub()
6782 Pos = Pos.getOperand(0); in matchRotateSub()
6800 (NegOp1.getOpcode() == ISD::TRUNCATE && Pos == NegOp1.getOperand(0))) in matchRotateSub()
6812 else if (Pos.getOpcode() == ISD::ADD && Pos.getOperand(0) == NegOp1) { in matchRotateSub()
6813 if (ConstantSDNode *PosC = isConstOrConstSplat(Pos.getOperand(1))) in matchRotateSub()
6887 ConstantSDNode *Cst = isConstOrConstSplat(Op.getOperand(1)); in MatchFunnelPosNeg()
6895 InnerPos == InnerNeg.getOperand(0) && in MatchFunnelPosNeg()
6897 return DAG.getNode(ISD::FSHL, DL, VT, N0, N1.getOperand(0), Pos); in MatchFunnelPosNeg()
6904 InnerNeg == InnerPos.getOperand(0) && in MatchFunnelPosNeg()
6906 return DAG.getNode(ISD::FSHR, DL, VT, N0.getOperand(0), N1, Neg); in MatchFunnelPosNeg()
6912 if (N0.getOpcode() == ISD::ADD && N0.getOperand(0) == N0.getOperand(1) && in MatchFunnelPosNeg()
6914 InnerNeg == InnerPos.getOperand(0) && in MatchFunnelPosNeg()
6916 return DAG.getNode(ISD::FSHR, DL, VT, N0.getOperand(0), N1, Neg); in MatchFunnelPosNeg()
6943 LHS.getOperand(0).getValueType() == RHS.getOperand(0).getValueType()) { in MatchRotate()
6945 if (SDValue Rot = MatchRotate(LHS.getOperand(0), RHS.getOperand(0), DL)) { in MatchRotate()
6991 bool IsRotate = LHSShift.getOperand(0) == RHSShift.getOperand(0); in MatchRotate()
7003 SDValue LHSShiftArg = LHSShift.getOperand(0); in MatchRotate()
7004 SDValue LHSShiftAmt = LHSShift.getOperand(1); in MatchRotate()
7005 SDValue RHSShiftArg = RHSShift.getOperand(0); in MatchRotate()
7006 SDValue RHSShiftAmt = RHSShift.getOperand(1); in MatchRotate()
7064 LExtOp0 = LHSShiftAmt.getOperand(0); in MatchRotate()
7065 RExtOp0 = RHSShiftAmt.getOperand(0); in MatchRotate()
7161 auto LHS = calculateByteProvider(Op->getOperand(0), Index, Depth + 1); in calculateByteProvider()
7164 auto RHS = calculateByteProvider(Op->getOperand(1), Index, Depth + 1); in calculateByteProvider()
7175 auto ShiftOp = dyn_cast<ConstantSDNode>(Op->getOperand(1)); in calculateByteProvider()
7186 : calculateByteProvider(Op->getOperand(0), Index - ByteShift, in calculateByteProvider()
7192 SDValue NarrowOp = Op->getOperand(0); in calculateByteProvider()
7205 return calculateByteProvider(Op->getOperand(0), ByteWidth - Index - 1, in calculateByteProvider()
7266 return stripTruncAndExt(Value.getOperand(0)); in stripTruncAndExt()
7351 SDValue WideVal = Trunc.getOperand(0); in mergeTruncStores()
7353 isa<ConstantSDNode>(WideVal.getOperand(1))) { in mergeTruncStores()
7365 WideVal = WideVal.getOperand(0); in mergeTruncStores()
7684 if (isAllOnesOrAllOnesSplat(N->getOperand(1))) in unfoldMaskedMerge()
7695 SDValue Xor = And.getOperand(XorIdx); in unfoldMaskedMerge()
7698 SDValue Xor0 = Xor.getOperand(0); in unfoldMaskedMerge()
7699 SDValue Xor1 = Xor.getOperand(1); in unfoldMaskedMerge()
7709 M = And.getOperand(XorIdx ? 0 : 1); in unfoldMaskedMerge()
7713 SDValue N0 = N->getOperand(0); in unfoldMaskedMerge()
7714 SDValue N1 = N->getOperand(1); in unfoldMaskedMerge()
7750 SDValue N0 = N->getOperand(0); in visitXOR()
7751 SDValue N1 = N->getOperand(1); in visitXOR()
7812 return DAG.getSelectCC(SDLoc(N0), LHS, RHS, N0.getOperand(2), in visitXOR()
7813 N0.getOperand(3), NotCC); in visitXOR()
7821 N0.getOperand(0), N0Opcode == ISD::STRICT_FSETCCS); in visitXOR()
7835 isSetCCEquivalent(N0.getOperand(0), LHS, RHS, CC)){ in visitXOR()
7836 SDValue V = N0.getOperand(0); in visitXOR()
7847 SDValue N00 = N0.getOperand(0), N01 = N0.getOperand(1); in visitXOR()
7859 SDValue N00 = N0.getOperand(0), N01 = N0.getOperand(1); in visitXOR()
7873 isNullConstant(N0.getOperand(0))) { in visitXOR()
7874 return DAG.getNode(ISD::ADD, DL, VT, N0.getOperand(1), in visitXOR()
7880 isAllOnesOrAllOnesSplat(N0.getOperand(1))) { in visitXOR()
7882 N0.getOperand(0)); in visitXOR()
7886 if (N0Opcode == ISD::AND && N0.hasOneUse() && N0->getOperand(1) == N1) { in visitXOR()
7887 SDValue X = N0.getOperand(0); in visitXOR()
7895 ConstantSDNode *ShiftC = isConstOrConstSplat(N0.getOperand(1)); in visitXOR()
7908 SDValue Not = DAG.getNOT(DL, N0.getOperand(0), VT); in visitXOR()
7909 return DAG.getNode(N0Opcode, DL, VT, Not, N0.getOperand(1)); in visitXOR()
7920 SDValue A0 = A.getOperand(0), A1 = A.getOperand(1); in visitXOR()
7921 SDValue S0 = S.getOperand(0); in visitXOR()
7923 if (ConstantSDNode *C = isConstOrConstSplat(S.getOperand(1))) in visitXOR()
7952 isAllOnesConstant(N1) && isOneConstant(N0.getOperand(0))) { in visitXOR()
7954 N0.getOperand(1)); in visitXOR()
7982 SDValue LogicOp = Shift->getOperand(0); in combineShiftOfShiftedLogic()
7993 SDValue C1 = Shift->getOperand(1); in combineShiftOfShiftedLogic()
8002 ConstantSDNode *ShiftCNode = isConstOrConstSplat(V.getOperand(1)); in combineShiftOfShiftedLogic()
8007 ShiftOp = V.getOperand(0); in combineShiftOfShiftedLogic()
8025 if (matchFirstShift(LogicOp.getOperand(0), X, C0Val)) in combineShiftOfShiftedLogic()
8026 Y = LogicOp.getOperand(1); in combineShiftOfShiftedLogic()
8027 else if (matchFirstShift(LogicOp.getOperand(1), X, C0Val)) in combineShiftOfShiftedLogic()
8028 Y = LogicOp.getOperand(0); in combineShiftOfShiftedLogic()
8035 EVT ShiftAmtVT = Shift->getOperand(1).getValueType(); in combineShiftOfShiftedLogic()
8049 assert(isConstOrConstSplat(N->getOperand(1)) && "Expected constant operand"); in visitShiftByConstant()
8052 if (isBitwiseNot(N->getOperand(0))) in visitShiftByConstant()
8056 SDValue LHS = N->getOperand(0); in visitShiftByConstant()
8086 ConstantSDNode *BinOpCst = getAsNonOpaqueConstant(LHS.getOperand(1)); in visitShiftByConstant()
8093 SDValue BinOpLHSVal = LHS.getOperand(0); in visitShiftByConstant()
8097 isa<ConstantSDNode>(BinOpLHSVal.getOperand(1)); in visitShiftByConstant()
8110 SDValue NewRHS = DAG.getNode(N->getOpcode(), DL, VT, LHS.getOperand(1), in visitShiftByConstant()
8111 N->getOperand(1)); in visitShiftByConstant()
8114 SDValue NewShift = DAG.getNode(N->getOpcode(), DL, VT, LHS.getOperand(0), in visitShiftByConstant()
8115 N->getOperand(1)); in visitShiftByConstant()
8121 assert(N->getOperand(0).getOpcode() == ISD::AND); in distributeTruncateThroughAnd()
8125 if (N->hasOneUse() && N->getOperand(0).hasOneUse() && in distributeTruncateThroughAnd()
8127 SDValue N01 = N->getOperand(0).getOperand(1); in distributeTruncateThroughAnd()
8130 SDValue N00 = N->getOperand(0).getOperand(0); in distributeTruncateThroughAnd()
8144 SDValue N0 = N->getOperand(0); in visitRotate()
8145 SDValue N1 = N->getOperand(1); in visitRotate()
8186 N1.getOperand(0).getOpcode() == ISD::AND) { in visitRotate()
8195 SDNode *C2 = DAG.isConstantIntBuildVectorOrConstantInt(N0.getOperand(1)); in visitRotate()
8201 CombineOp, dl, ShiftVT, {N1, N0.getOperand(1)})) { in visitRotate()
8205 return DAG.getNode(N->getOpcode(), dl, VT, N0->getOperand(0), in visitRotate()
8214 SDValue N0 = N->getOperand(0); in visitSHL()
8215 SDValue N1 = N->getOperand(1); in visitSHL()
8233 SDValue N00 = N0->getOperand(0); in visitSHL()
8234 SDValue N01 = N0->getOperand(1); in visitSHL()
8238 TLI.getBooleanContents(N00.getOperand(0).getValueType()) == in visitSHL()
8264 N1.getOperand(0).getOpcode() == ISD::AND) { in visitSHL()
8281 if (ISD::matchBinaryPredicate(N1, N0.getOperand(1), MatchOutOfRange)) in visitSHL()
8291 if (ISD::matchBinaryPredicate(N1, N0.getOperand(1), MatchInRange)) { in visitSHL()
8293 SDValue Sum = DAG.getNode(ISD::ADD, DL, ShiftVT, N1, N0.getOperand(1)); in visitSHL()
8294 return DAG.getNode(ISD::SHL, DL, VT, N0.getOperand(0), Sum); in visitSHL()
8306 N0.getOperand(0).getOpcode() == ISD::SHL) { in visitSHL()
8307 SDValue N0Op0 = N0.getOperand(0); in visitSHL()
8308 SDValue InnerShiftAmt = N0Op0.getOperand(1); in visitSHL()
8337 SDValue Ext = DAG.getNode(N0.getOpcode(), DL, VT, N0Op0.getOperand(0)); in visitSHL()
8348 N0.getOperand(0).getOpcode() == ISD::SRL) { in visitSHL()
8349 SDValue N0Op0 = N0.getOperand(0); in visitSHL()
8350 SDValue InnerShiftAmt = N0Op0.getOperand(1); in visitSHL()
8362 EVT InnerShiftAmtVT = N0Op0.getOperand(1).getValueType(); in visitSHL()
8375 if (ConstantSDNode *N0C1 = isConstOrConstSplat(N0.getOperand(1))) { in visitSHL()
8380 return DAG.getNode(ISD::SHL, DL, VT, N0.getOperand(0), in visitSHL()
8382 return DAG.getNode(N0.getOpcode(), DL, VT, N0.getOperand(0), in visitSHL()
8395 if (ConstantSDNode *N0C1 = isConstOrConstSplat(N0.getOperand(1))) { in visitSHL()
8404 Shift = DAG.getNode(ISD::SHL, DL, VT, N0.getOperand(0), in visitSHL()
8409 Shift = DAG.getNode(ISD::SRL, DL, VT, N0.getOperand(0), in visitSHL()
8420 if (N0.getOpcode() == ISD::SRA && N1 == N0.getOperand(1) && in visitSHL()
8425 return DAG.getNode(ISD::AND, DL, VT, N0.getOperand(0), HiBitsMask); in visitSHL()
8435 isConstantOrConstantVector(N0.getOperand(1), /* No Opaques */ true) && in visitSHL()
8437 SDValue Shl0 = DAG.getNode(ISD::SHL, SDLoc(N0), VT, N0.getOperand(0), N1); in visitSHL()
8438 SDValue Shl1 = DAG.getNode(ISD::SHL, SDLoc(N1), VT, N0.getOperand(1), N1); in visitSHL()
8447 isConstantOrConstantVector(N0.getOperand(1), /* No Opaques */ true)) { in visitSHL()
8448 SDValue Shl = DAG.getNode(ISD::SHL, SDLoc(N1), VT, N0.getOperand(1), N1); in visitSHL()
8450 return DAG.getNode(ISD::MUL, SDLoc(N), VT, N0.getOperand(0), Shl); in visitSHL()
8459 if (ConstantSDNode *NC1 = isConstOrConstSplat(N->getOperand(1))) { in visitSHL()
8490 ConstantSDNode *ShiftAmtSrc = isConstOrConstSplat(N->getOperand(1)); in combineShiftToMULH()
8497 SDValue ShiftOperand = N->getOperand(0); in combineShiftToMULH()
8502 SDValue LeftOp = ShiftOperand.getOperand(0); in combineShiftToMULH()
8503 SDValue RightOp = ShiftOperand.getOperand(1); in combineShiftToMULH()
8517 EVT NarrowVT = LeftOp.getOperand(0).getValueType(); in combineShiftToMULH()
8519 if (NarrowVT != RightOp.getOperand(0).getValueType()) in combineShiftToMULH()
8543 SDValue Result = DAG.getNode(MulhOpcode, DL, NarrowVT, LeftOp.getOperand(0), in combineShiftToMULH()
8544 RightOp.getOperand(0)); in combineShiftToMULH()
8550 SDValue N0 = N->getOperand(0); in visitSRA()
8551 SDValue N1 = N->getOperand(1); in visitSRA()
8580 if (N1C && N0.getOpcode() == ISD::SHL && N1 == N0.getOperand(1)) { in visitSRA()
8590 N0.getOperand(0), DAG.getValueType(ExtVT)); in visitSRA()
8593 if (DAG.ComputeNumSignBits(N0.getOperand(0)) > N1C->getZExtValue()) in visitSRA()
8594 return N0.getOperand(0); in visitSRA()
8615 if (ISD::matchBinaryPredicate(N1, N0.getOperand(1), SumOfShifts)) { in visitSRA()
8626 return DAG.getNode(ISD::SRA, DL, VT, N0.getOperand(0), ShiftValue); in visitSRA()
8637 const ConstantSDNode *N01C = isConstOrConstSplat(N0.getOperand(1)); in visitSRA()
8659 getShiftAmountTy(N0.getOperand(0).getValueType())); in visitSRA()
8661 N0.getOperand(0), Amt); in visitSRA()
8674 N0.getOperand(0).getOpcode() == ISD::SHL && in visitSRA()
8675 N0.getOperand(0).getOperand(1) == N1 && N0.getOperand(0).hasOneUse()) { in visitSRA()
8676 if (ConstantSDNode *AddC = isConstOrConstSplat(N0.getOperand(1))) { in visitSRA()
8677 SDValue Shl = N0.getOperand(0); in visitSRA()
8693 SDValue Trunc = DAG.getZExtOrTrunc(Shl.getOperand(0), DL, TruncVT); in visitSRA()
8704 N1.getOperand(0).getOpcode() == ISD::AND) { in visitSRA()
8714 (N0.getOperand(0).getOpcode() == ISD::SRL || in visitSRA()
8715 N0.getOperand(0).getOpcode() == ISD::SRA) && in visitSRA()
8716 N0.getOperand(0).hasOneUse() && in visitSRA()
8717 N0.getOperand(0).getOperand(1).hasOneUse() && N1C) { in visitSRA()
8718 SDValue N0Op0 = N0.getOperand(0); in visitSRA()
8719 if (ConstantSDNode *LargeShift = isConstOrConstSplat(N0Op0.getOperand(1))) { in visitSRA()
8727 DAG.getNode(ISD::SRA, DL, LargeVT, N0Op0.getOperand(0), Amt); in visitSRA()
8754 SDValue N0 = N->getOperand(0); in visitSRL()
8755 SDValue N1 = N->getOperand(1); in visitSRL()
8790 if (ISD::matchBinaryPredicate(N1, N0.getOperand(1), MatchOutOfRange)) in visitSRL()
8800 if (ISD::matchBinaryPredicate(N1, N0.getOperand(1), MatchInRange)) { in visitSRL()
8803 SDValue Sum = DAG.getNode(ISD::ADD, DL, ShiftVT, N1, N0.getOperand(1)); in visitSRL()
8804 return DAG.getNode(ISD::SRL, DL, VT, N0.getOperand(0), Sum); in visitSRL()
8809 N0.getOperand(0).getOpcode() == ISD::SRL) { in visitSRL()
8810 SDValue InnerShift = N0.getOperand(0); in visitSRL()
8812 if (auto *N001C = isConstOrConstSplat(InnerShift.getOperand(1))) { in visitSRL()
8816 EVT ShiftAmtVT = InnerShift.getOperand(1).getValueType(); in visitSRL()
8826 InnerShift.getOperand(0), NewShiftAmt); in visitSRL()
8836 InnerShift.getOperand(0), NewShiftAmt); in visitSRL()
8848 if (N0.getOpcode() == ISD::SHL && N0.getOperand(1) == N1 && in visitSRL()
8854 return DAG.getNode(ISD::AND, DL, VT, N0.getOperand(0), Mask); in visitSRL()
8861 EVT SmallVT = N0.getOperand(0).getValueType(); in visitSRL()
8870 N0.getOperand(0), in visitSRL()
8886 return DAG.getNode(ISD::SRL, SDLoc(N), VT, N0.getOperand(0), N1); in visitSRL()
8892 KnownBits Known = DAG.computeKnownBits(N0.getOperand(0)); in visitSRL()
8910 SDValue Op = N0.getOperand(0); in visitSRL()
8928 N1.getOperand(0).getOpcode() == ISD::AND) { in visitSRL()
8985 SDValue N0 = N->getOperand(0); in visitFunnelShift()
8986 SDValue N1 = N->getOperand(1); in visitFunnelShift()
8987 SDValue N2 = N->getOperand(2); in visitFunnelShift()
9102 SDValue AbsOp1 = N->getOperand(0); in combineABSToABD()
9108 Op0 = AbsOp1.getOperand(0); in combineABSToABD()
9109 Op1 = AbsOp1.getOperand(1); in combineABSToABD()
9117 EVT VT1 = Op0.getOperand(0).getValueType(); in combineABSToABD()
9118 EVT VT2 = Op1.getOperand(0).getValueType(); in combineABSToABD()
9124 Op0 = Op0.getOperand(0); in combineABSToABD()
9125 Op1 = Op1.getOperand(0); in combineABSToABD()
9132 SDValue N0 = N->getOperand(0); in visitABS()
9152 SDValue N0 = N->getOperand(0); in visitBSWAP()
9160 return N0->getOperand(0); in visitBSWAP()
9165 SDValue N0 = N->getOperand(0); in visitBITREVERSE()
9173 return N0.getOperand(0); in visitBITREVERSE()
9178 SDValue N0 = N->getOperand(0); in visitCTLZ()
9195 SDValue N0 = N->getOperand(0); in visitCTLZ_ZERO_UNDEF()
9205 SDValue N0 = N->getOperand(0); in visitCTTZ()
9222 SDValue N0 = N->getOperand(0); in visitCTTZ_ZERO_UNDEF()
9232 SDValue N0 = N->getOperand(0); in visitCTPOP()
9305 SDValue Cond = N->getOperand(0); in foldSelectOfConstantsUsingSra()
9306 SDValue C1 = N->getOperand(1); in foldSelectOfConstantsUsingSra()
9307 SDValue C2 = N->getOperand(2); in foldSelectOfConstantsUsingSra()
9313 VT != Cond.getOperand(0).getValueType()) in foldSelectOfConstantsUsingSra()
9318 SDValue X = Cond.getOperand(0); in foldSelectOfConstantsUsingSra()
9319 SDValue CondC = Cond.getOperand(1); in foldSelectOfConstantsUsingSra()
9320 ISD::CondCode CC = cast<CondCodeSDNode>(Cond.getOperand(2))->get(); in foldSelectOfConstantsUsingSra()
9340 SDValue Cond = N->getOperand(0); in foldSelectOfConstants()
9341 SDValue N1 = N->getOperand(1); in foldSelectOfConstants()
9342 SDValue N2 = N->getOperand(2); in foldSelectOfConstants()
9450 SDValue Cond = N->getOperand(0); in foldBoolSelectToLogic()
9451 SDValue T = N->getOperand(1), F = N->getOperand(2); in foldBoolSelectToLogic()
9482 SDValue N0 = N->getOperand(0); in visitSELECT()
9483 SDValue N1 = N->getOperand(1); in visitSELECT()
9484 SDValue N2 = N->getOperand(2); in visitSELECT()
9517 SDValue Cond0 = N0->getOperand(0); in visitSELECT()
9518 SDValue Cond1 = N0->getOperand(1); in visitSELECT()
9530 SDValue Cond0 = N0->getOperand(0); in visitSELECT()
9531 SDValue Cond1 = N0->getOperand(1); in visitSELECT()
9544 SDValue N1_0 = N1->getOperand(0); in visitSELECT()
9545 SDValue N1_1 = N1->getOperand(1); in visitSELECT()
9546 SDValue N1_2 = N1->getOperand(2); in visitSELECT()
9563 SDValue N2_0 = N2->getOperand(0); in visitSELECT()
9564 SDValue N2_1 = N2->getOperand(1); in visitSELECT()
9565 SDValue N2_2 = N2->getOperand(2); in visitSELECT()
9590 SDValue Cond0 = N0.getOperand(0), Cond1 = N0.getOperand(1); in visitSELECT()
9591 ISD::CondCode CC = cast<CondCodeSDNode>(N0.getOperand(2))->get(); in visitSELECT()
9609 N2.getOpcode() == ISD::ADD && Cond0 == N2.getOperand(0)) { in visitSELECT()
9610 auto *C = dyn_cast<ConstantSDNode>(N2.getOperand(1)); in visitSELECT()
9626 SDValue UAO = DAG.getNode(ISD::UADDO, DL, VTs, Cond0, N2.getOperand(1)); in visitSELECT()
9638 N2, N0.getOperand(2)); in visitSELECT()
9658 SDValue Cond = N->getOperand(0); in ConvertSelectToConcatVector()
9659 SDValue LHS = N->getOperand(1); in ConvertSelectToConcatVector()
9660 SDValue RHS = N->getOperand(2); in ConvertSelectToConcatVector()
9679 if (Cond->getOperand(i)->isUndef()) in ConvertSelectToConcatVector()
9683 BottomHalf = cast<ConstantSDNode>(Cond.getOperand(i)); in ConvertSelectToConcatVector()
9684 else if (Cond->getOperand(i).getNode() != BottomHalf) in ConvertSelectToConcatVector()
9691 if (Cond->getOperand(i)->isUndef()) in ConvertSelectToConcatVector()
9695 TopHalf = cast<ConstantSDNode>(Cond.getOperand(i)); in ConvertSelectToConcatVector()
9696 else if (Cond->getOperand(i).getNode() != TopHalf) in ConvertSelectToConcatVector()
9705 BottomHalf->isNullValue() ? RHS->getOperand(0) : LHS->getOperand(0), in ConvertSelectToConcatVector()
9706 TopHalf->isNullValue() ? RHS->getOperand(1) : LHS->getOperand(1)); in ConvertSelectToConcatVector()
9714 SDValue LHS = Index.getOperand(0); in refineUniformBase()
9720 Index = Index.getOperand(1); in refineUniformBase()
9730 SDValue Op = Index.getOperand(0); in refineIndexType()
9739 SDValue Op = Index.getOperand(0); in refineIndexType()
9868 SDValue Cond = N->getOperand(0); in foldVSelectOfConstants()
9869 SDValue N1 = N->getOperand(1); in foldVSelectOfConstants()
9870 SDValue N2 = N->getOperand(2); in foldVSelectOfConstants()
9885 SDValue N1Elt = N1.getOperand(i); in foldVSelectOfConstants()
9886 SDValue N2Elt = N2.getOperand(i); in foldVSelectOfConstants()
9931 SDValue N0 = N->getOperand(0); in visitVSELECT()
9932 SDValue N1 = N->getOperand(1); in visitVSELECT()
9933 SDValue N2 = N->getOperand(2); in visitVSELECT()
9953 SDValue LHS = N0.getOperand(0), RHS = N0.getOperand(1); in visitVSELECT()
9954 ISD::CondCode CC = cast<CondCodeSDNode>(N0.getOperand(2))->get(); in visitVSELECT()
9960 N1 == LHS && N2.getOpcode() == ISD::SUB && N1 == N2.getOperand(1)) in visitVSELECT()
9961 isAbs = ISD::isBuildVectorAllZeros(N2.getOperand(0).getNode()); in visitVSELECT()
9963 N2 == LHS && N1.getOpcode() == ISD::SUB && N2 == N1.getOperand(1)) in visitVSELECT()
9964 isAbs = ISD::isBuildVectorAllZeros(N1.getOperand(0).getNode()); in visitVSELECT()
10036 SDValue OpLHS = Other.getOperand(0), OpRHS = Other.getOperand(1); in visitVSELECT()
10083 SDValue OpLHS = Other.getOperand(0), OpRHS = Other.getOperand(1); in visitVSELECT()
10086 LHS.getOpcode() == ISD::ZERO_EXTEND && LHS.getOperand(0) == OpLHS && in visitVSELECT()
10087 OpRHS.getOpcode() == ISD::TRUNCATE && OpRHS.getOperand(0) == RHS) { in visitVSELECT()
10175 SDValue N0 = N->getOperand(0); in visitSELECT_CC()
10176 SDValue N1 = N->getOperand(1); in visitSELECT_CC()
10177 SDValue N2 = N->getOperand(2); in visitSELECT_CC()
10178 SDValue N3 = N->getOperand(3); in visitSELECT_CC()
10179 SDValue N4 = N->getOperand(4); in visitSELECT_CC()
10203 ISD::SELECT_CC, SDLoc(N), N2.getValueType(), SCC.getOperand(0), in visitSELECT_CC()
10204 SCC.getOperand(1), N2, N3, SCC.getOperand(2)); in visitSELECT_CC()
10225 ISD::CondCode Cond = cast<CondCodeSDNode>(N->getOperand(2))->get(); in visitSETCC()
10243 SDValue N0 = N->getOperand(0), N1 = N->getOperand(1); in visitSETCC()
10263 N0 = N0->getOperand(0); in visitSETCC()
10270 N1 = N1->getOperand(0); in visitSETCC()
10279 SDValue Combined = SimplifySetCC(VT, N->getOperand(0), N->getOperand(1), Cond, in visitSETCC()
10302 SDValue LHS = N->getOperand(0); in visitSETCCCARRY()
10303 SDValue RHS = N->getOperand(1); in visitSETCCCARRY()
10304 SDValue Carry = N->getOperand(2); in visitSETCCCARRY()
10305 SDValue Cond = N->getOperand(3); in visitSETCCCARRY()
10351 SDValue N0 = N->getOperand(0); in tryToFoldExtendSelectLoad()
10363 SDValue Op1 = N0->getOperand(1); in tryToFoldExtendSelectLoad()
10364 SDValue Op2 = N0->getOperand(2); in tryToFoldExtendSelectLoad()
10382 return DAG.getSelect(DL, VT, N0->getOperand(0), Ext1, Ext2); in tryToFoldExtendSelectLoad()
10394 SDValue N0 = N->getOperand(0); in tryToFoldExtendOfConstant()
10413 SDValue Op1 = N0->getOperand(1); in tryToFoldExtendOfConstant()
10414 SDValue Op2 = N0->getOperand(2); in tryToFoldExtendOfConstant()
10429 return DAG.getSelect(DL, VT, N0->getOperand(0), in tryToFoldExtendOfConstant()
10455 SDValue Op = N0.getOperand(i); in tryToFoldExtendOfConstant()
10494 ISD::CondCode CC = cast<CondCodeSDNode>(User->getOperand(2))->get(); in ExtendUsesToFormExtLoad()
10500 SDValue UseOp = User->getOperand(i); in ExtendUsesToFormExtLoad()
10547 SDValue SOp = SetCC->getOperand(j); in ExtendSetCCUses()
10554 Ops.push_back(SetCC->getOperand(2)); in ExtendSetCCUses()
10561 SDValue N0 = N->getOperand(0); in CombineExtLoad()
10663 EVT OrigVT = N->getOperand(0).getValueType(); in CombineZExtLogicopShiftLoad()
10668 SDValue N0 = N->getOperand(0); in CombineZExtLogicopShiftLoad()
10671 N0.getOperand(1).getOpcode() != ISD::Constant || in CombineZExtLogicopShiftLoad()
10676 SDValue N1 = N0->getOperand(0); in CombineZExtLogicopShiftLoad()
10678 N1.getOperand(1).getOpcode() != ISD::Constant || in CombineZExtLogicopShiftLoad()
10683 if (!isa<LoadSDNode>(N1.getOperand(0))) in CombineZExtLogicopShiftLoad()
10685 LoadSDNode *Load = cast<LoadSDNode>(N1.getOperand(0)); in CombineZExtLogicopShiftLoad()
10701 if (!ExtendUsesToFormExtLoad(VT, N1.getNode(), N1.getOperand(0), in CombineZExtLogicopShiftLoad()
10712 N1.getOperand(1)); in CombineZExtLogicopShiftLoad()
10719 ExtendSetCCUses(SetCCs, N1.getOperand(0), ExtLoad, ISD::ZERO_EXTEND); in CombineZExtLogicopShiftLoad()
10753 SDValue VSel = Cast->getOperand(0); in matchVSelectOpSizesWithSetCC()
10755 VSel.getOperand(0).getOpcode() != ISD::SETCC) in matchVSelectOpSizesWithSetCC()
10759 SDValue SetCC = VSel.getOperand(0); in matchVSelectOpSizesWithSetCC()
10760 EVT SetCCVT = getSetCCResultType(SetCC.getOperand(0).getValueType()); in matchVSelectOpSizesWithSetCC()
10765 SDValue A = VSel.getOperand(1); in matchVSelectOpSizesWithSetCC()
10766 SDValue B = VSel.getOperand(2); in matchVSelectOpSizesWithSetCC()
10771 CastA = DAG.getNode(CastOpcode, DL, VT, A, Cast->getOperand(1)); in matchVSelectOpSizesWithSetCC()
10772 CastB = DAG.getNode(CastOpcode, DL, VT, B, Cast->getOperand(1)); in matchVSelectOpSizesWithSetCC()
10886 SDValue SetCC = N->getOperand(0); in foldExtendedSignBitTest()
10891 SDValue X = SetCC.getOperand(0); in foldExtendedSignBitTest()
10892 SDValue Ones = SetCC.getOperand(1); in foldExtendedSignBitTest()
10893 ISD::CondCode CC = cast<CondCodeSDNode>(SetCC.getOperand(2))->get(); in foldExtendedSignBitTest()
10918 SDValue N0 = N->getOperand(0); in foldSextSetcc()
10922 SDValue N00 = N0.getOperand(0); in foldSextSetcc()
10923 SDValue N01 = N0.getOperand(1); in foldSextSetcc()
10924 ISD::CondCode CC = cast<CondCodeSDNode>(N0.getOperand(2))->get(); in foldSextSetcc()
11040 SDValue N0 = N->getOperand(0); in visitSIGN_EXTEND()
11050 return DAG.getNode(ISD::SIGN_EXTEND, DL, VT, N0.getOperand(0)); in visitSIGN_EXTEND()
11056 SDNode *oye = N0.getOperand(0).getNode(); in visitSIGN_EXTEND()
11067 SDValue Op = N0.getOperand(0); in visitSIGN_EXTEND()
11127 isa<LoadSDNode>(N0.getOperand(0)) && in visitSIGN_EXTEND()
11128 N0.getOperand(1).getOpcode() == ISD::Constant && in visitSIGN_EXTEND()
11130 LoadSDNode *LN00 = cast<LoadSDNode>(N0.getOperand(0)); in visitSIGN_EXTEND()
11135 bool DoXform = ExtendUsesToFormExtLoad(VT, N0.getNode(), N0.getOperand(0), in visitSIGN_EXTEND()
11145 ExtendSetCCUses(SetCCs, N0.getOperand(0), ExtLoad, ISD::SIGN_EXTEND); in visitSIGN_EXTEND()
11184 isNullOrNullSplat(N0.getOperand(0)) && in visitSIGN_EXTEND()
11185 N0.getOperand(1).getOpcode() == ISD::ZERO_EXTEND && in visitSIGN_EXTEND()
11187 SDValue Zext = DAG.getZExtOrTrunc(N0.getOperand(1).getOperand(0), DL, VT); in visitSIGN_EXTEND()
11193 isAllOnesOrAllOnesSplat(N0.getOperand(1)) && in visitSIGN_EXTEND()
11194 N0.getOperand(0).getOpcode() == ISD::ZERO_EXTEND && in visitSIGN_EXTEND()
11196 SDValue Zext = DAG.getZExtOrTrunc(N0.getOperand(0).getOperand(0), DL, VT); in visitSIGN_EXTEND()
11219 SDValue Zext = DAG.getNode(ISD::ZERO_EXTEND, DL, VT, N0.getOperand(0)); in visitSIGN_EXTEND()
11236 Op = N->getOperand(0); in isTruncateOf()
11243 cast<CondCodeSDNode>(N.getOperand(2))->get() != ISD::SETNE) in isTruncateOf()
11246 SDValue Op0 = N->getOperand(0); in isTruncateOf()
11247 SDValue Op1 = N->getOperand(1); in isTruncateOf()
11269 SDValue CtPop = Extend->getOperand(0); in widenCtPop()
11281 SDValue NewZext = DAG.getZExtOrTrunc(CtPop.getOperand(0), DL, VT); in widenCtPop()
11286 SDValue N0 = N->getOperand(0); in visitZERO_EXTEND()
11296 N0.getOperand(0)); in visitZERO_EXTEND()
11320 SDNode *oye = N0.getOperand(0).getNode(); in visitZERO_EXTEND()
11329 EVT SrcVT = N0.getOperand(0).getValueType(); in visitZERO_EXTEND()
11337 SDValue Op = N0.getOperand(0); in visitZERO_EXTEND()
11348 SDValue Op = DAG.getAnyExtOrTrunc(N0.getOperand(0), SDLoc(N), VT); in visitZERO_EXTEND()
11361 N0.getOperand(0).getOpcode() == ISD::TRUNCATE && in visitZERO_EXTEND()
11362 N0.getOperand(1).getOpcode() == ISD::Constant && in visitZERO_EXTEND()
11363 (!TLI.isTruncateFree(N0.getOperand(0).getOperand(0).getValueType(), in visitZERO_EXTEND()
11366 SDValue X = N0.getOperand(0).getOperand(0); in visitZERO_EXTEND()
11396 isa<LoadSDNode>(N0.getOperand(0)) && in visitZERO_EXTEND()
11397 N0.getOperand(1).getOpcode() == ISD::Constant && in visitZERO_EXTEND()
11399 LoadSDNode *LN00 = cast<LoadSDNode>(N0.getOperand(0)); in visitZERO_EXTEND()
11407 auto *AndC = cast<ConstantSDNode>(N0.getOperand(1)); in visitZERO_EXTEND()
11415 DoXform = ExtendUsesToFormExtLoad(VT, N0.getNode(), N0.getOperand(0), in visitZERO_EXTEND()
11426 ExtendSetCCUses(SetCCs, N0.getOperand(0), ExtLoad, ISD::ZERO_EXTEND); in visitZERO_EXTEND()
11465 EVT N00VT = N0.getOperand(0).getValueType(); in visitZERO_EXTEND()
11477 SDValue VSetCC = DAG.getNode(ISD::SETCC, DL, VT, N0.getOperand(0), in visitZERO_EXTEND()
11478 N0.getOperand(1), N0.getOperand(2)); in visitZERO_EXTEND()
11487 DAG.getNode(ISD::SETCC, DL, MatchingVectorType, N0.getOperand(0), in visitZERO_EXTEND()
11488 N0.getOperand(1), N0.getOperand(2)); in visitZERO_EXTEND()
11496 EVT N00VT = N0.getOperand(0).getValueType(); in visitZERO_EXTEND()
11498 DL, N0.getOperand(0), N0.getOperand(1), in visitZERO_EXTEND()
11501 cast<CondCodeSDNode>(N0.getOperand(2))->get(), true)) in visitZERO_EXTEND()
11507 isa<ConstantSDNode>(N0.getOperand(1)) && in visitZERO_EXTEND()
11508 N0.getOperand(0).getOpcode() == ISD::ZERO_EXTEND && in visitZERO_EXTEND()
11510 SDValue ShAmt = N0.getOperand(1); in visitZERO_EXTEND()
11512 SDValue InnerZExt = N0.getOperand(0); in visitZERO_EXTEND()
11516 InnerZExt.getOperand(0).getValueSizeInBits(); in visitZERO_EXTEND()
11528 DAG.getNode(ISD::ZERO_EXTEND, DL, VT, N0.getOperand(0)), in visitZERO_EXTEND()
11545 SDValue N0 = N->getOperand(0); in visitANY_EXTEND()
11557 return DAG.getNode(N0.getOpcode(), SDLoc(N), VT, N0.getOperand(0)); in visitANY_EXTEND()
11563 SDNode *oye = N0.getOperand(0).getNode(); in visitANY_EXTEND()
11575 return DAG.getAnyExtOrTrunc(N0.getOperand(0), SDLoc(N), VT); in visitANY_EXTEND()
11580 N0.getOperand(0).getOpcode() == ISD::TRUNCATE && in visitANY_EXTEND()
11581 N0.getOperand(1).getOpcode() == ISD::Constant && in visitANY_EXTEND()
11582 !TLI.isTruncateFree(N0.getOperand(0).getOperand(0).getValueType(), in visitANY_EXTEND()
11585 SDValue X = N0.getOperand(0).getOperand(0); in visitANY_EXTEND()
11656 EVT N00VT = N0.getOperand(0).getValueType(); in visitANY_EXTEND()
11666 return DAG.getSetCC(SDLoc(N), VT, N0.getOperand(0), in visitANY_EXTEND()
11667 N0.getOperand(1), in visitANY_EXTEND()
11668 cast<CondCodeSDNode>(N0.getOperand(2))->get()); in visitANY_EXTEND()
11675 DAG.getSetCC(SDLoc(N), MatchingVectorType, N0.getOperand(0), in visitANY_EXTEND()
11676 N0.getOperand(1), in visitANY_EXTEND()
11677 cast<CondCodeSDNode>(N0.getOperand(2))->get()); in visitANY_EXTEND()
11684 DL, N0.getOperand(0), N0.getOperand(1), DAG.getConstant(1, DL, VT), in visitANY_EXTEND()
11686 cast<CondCodeSDNode>(N0.getOperand(2))->get(), true)) in visitANY_EXTEND()
11701 SDValue N0 = N->getOperand(0); in visitAssertExt()
11702 SDValue N1 = N->getOperand(1); in visitAssertExt()
11707 AssertVT == cast<VTSDNode>(N0.getOperand(1))->getVT()) in visitAssertExt()
11711 N0.getOperand(0).getOpcode() == Opcode) { in visitAssertExt()
11717 SDValue BigA = N0.getOperand(0); in visitAssertExt()
11718 EVT BigA_AssertVT = cast<VTSDNode>(BigA.getOperand(1))->getVT(); in visitAssertExt()
11727 BigA.getOperand(0), MinAssertVTVal); in visitAssertExt()
11735 N0.getOperand(0).getOpcode() == ISD::AssertSext && in visitAssertExt()
11737 SDValue BigA = N0.getOperand(0); in visitAssertExt()
11738 EVT BigA_AssertVT = cast<VTSDNode>(BigA.getOperand(1))->getVT(); in visitAssertExt()
11746 BigA.getOperand(0), N1); in visitAssertExt()
11758 SDValue N0 = N->getOperand(0); in visitAssertAlign()
11763 return DAG.getAssertAlign(DL, N0.getOperand(0), in visitAssertAlign()
11775 SDValue LHS = N0.getOperand(0); in visitAssertAlign()
11776 SDValue RHS = N0.getOperand(1); in visitAssertAlign()
11803 SDValue N0 = N->getOperand(0); in ReduceLoadWidth()
11817 ExtVT = cast<VTSDNode>(N->getOperand(1))->getVT(); in ReduceLoadWidth()
11825 auto *LN0 = dyn_cast<LoadSDNode>(N0.getOperand(0)); in ReduceLoadWidth()
11826 auto *N01 = dyn_cast<ConstantSDNode>(N0.getOperand(1)); in ReduceLoadWidth()
11839 auto AndC = dyn_cast<ConstantSDNode>(N->getOperand(1)); in ReduceLoadWidth()
11861 if (auto *ConstShift = dyn_cast<ConstantSDNode>(SRL.getOperand(1))) { in ReduceLoadWidth()
11866 N0 = N0.getOperand(0); in ReduceLoadWidth()
11892 isa<ConstantSDNode>(Mask->getOperand(1))) { in ReduceLoadWidth()
11911 if (ConstantSDNode *N01 = dyn_cast<ConstantSDNode>(N0.getOperand(1))) { in ReduceLoadWidth()
11913 N0 = N0.getOperand(0); in ReduceLoadWidth()
12002 SDValue N0 = N->getOperand(0); in visitSIGN_EXTEND_INREG()
12003 SDValue N1 = N->getOperand(1); in visitSIGN_EXTEND_INREG()
12023 ExtVT.bitsLT(cast<VTSDNode>(N0.getOperand(1))->getVT())) in visitSIGN_EXTEND_INREG()
12024 return DAG.getNode(ISD::SIGN_EXTEND_INREG, SDLoc(N), VT, N0.getOperand(0), in visitSIGN_EXTEND_INREG()
12032 SDValue N00 = N0.getOperand(0); in visitSIGN_EXTEND_INREG()
12046 SDValue N00 = N0.getOperand(0); in visitSIGN_EXTEND_INREG()
12064 SDValue N00 = N0.getOperand(0); in visitSIGN_EXTEND_INREG()
12088 if (auto *ShAmt = dyn_cast<ConstantSDNode>(N0.getOperand(1))) in visitSIGN_EXTEND_INREG()
12092 unsigned InSignBits = DAG.ComputeNumSignBits(N0.getOperand(0)); in visitSIGN_EXTEND_INREG()
12094 return DAG.getNode(ISD::SRA, SDLoc(N), VT, N0.getOperand(0), in visitSIGN_EXTEND_INREG()
12095 N0.getOperand(1)); in visitSIGN_EXTEND_INREG()
12173 if (SDValue BSwap = MatchBSwapHWordLow(N0.getNode(), N0.getOperand(0), in visitSIGN_EXTEND_INREG()
12174 N0.getOperand(1), false)) in visitSIGN_EXTEND_INREG()
12182 SDValue N0 = N->getOperand(0); in visitEXTEND_VECTOR_INREG()
12199 SDValue N0 = N->getOperand(0); in visitTRUNCATE()
12210 return DAG.getNode(ISD::TRUNCATE, SDLoc(N), VT, N0.getOperand(0)); in visitTRUNCATE()
12224 if (N0.getOperand(0).getValueType().bitsLT(VT)) in visitTRUNCATE()
12225 return DAG.getNode(N0.getOpcode(), SDLoc(N), VT, N0.getOperand(0)); in visitTRUNCATE()
12227 if (N0.getOperand(0).getValueType().bitsGT(VT)) in visitTRUNCATE()
12228 return DAG.getNode(ISD::TRUNCATE, SDLoc(N), VT, N0.getOperand(0)); in visitTRUNCATE()
12231 return N0.getOperand(0); in visitTRUNCATE()
12250 EVT VecTy = N0.getOperand(0).getValueType(); in visitTRUNCATE()
12261 SDValue EltNo = N0->getOperand(1); in visitTRUNCATE()
12268 DAG.getBitcast(NVT, N0.getOperand(0)), in visitTRUNCATE()
12278 SDValue Cond = N0.getOperand(0); in visitTRUNCATE()
12279 SDValue TruncOp0 = DAG.getNode(ISD::TRUNCATE, SL, VT, N0.getOperand(1)); in visitTRUNCATE()
12280 SDValue TruncOp1 = DAG.getNode(ISD::TRUNCATE, SL, VT, N0.getOperand(2)); in visitTRUNCATE()
12289 SDValue Amt = N0.getOperand(1); in visitTRUNCATE()
12296 SDValue Trunc = DAG.getNode(ISD::TRUNCATE, SL, VT, N0.getOperand(0)); in visitTRUNCATE()
12329 N0.getOperand(0).getOpcode() == ISD::BUILD_VECTOR && in visitTRUNCATE()
12330 N0.getOperand(0).hasOneUse()) { in visitTRUNCATE()
12331 SDValue BuildVect = N0.getOperand(0); in visitTRUNCATE()
12347 Opnds.push_back(BuildVect.getOperand(i)); in visitTRUNCATE()
12395 SDValue X = N0.getOperand(i); in visitTRUNCATE()
12434 SDValue VecSrc = N0.getOperand(0); in visitTRUNCATE()
12460 auto X = DAG.getNode(ISD::TRUNCATE, SL, VT, N0.getOperand(0)); in visitTRUNCATE()
12461 auto Y = DAG.getNode(ISD::TRUNCATE, SL, VT, N0.getOperand(1)); in visitTRUNCATE()
12463 return DAG.getNode(N0.getOpcode(), SL, VTs, X, Y, N0.getOperand(2)); in visitTRUNCATE()
12471 SDValue N00 = N0.getOperand(0); in visitTRUNCATE()
12475 if (N00.getOperand(0)->getValueType(0).getVectorElementType() == in visitTRUNCATE()
12477 return DAG.getNode(ISD::EXTRACT_SUBVECTOR, SDLoc(N0->getOperand(0)), VT, in visitTRUNCATE()
12478 N00.getOperand(0), N0.getOperand(1)); in visitTRUNCATE()
12497 (isConstantOrConstantVector(N0.getOperand(0), true) || in visitTRUNCATE()
12498 isConstantOrConstantVector(N0.getOperand(1), true))) { in visitTRUNCATE()
12504 SDValue NarrowL = DAG.getNode(ISD::TRUNCATE, DL, VT, N0.getOperand(0)); in visitTRUNCATE()
12505 SDValue NarrowR = DAG.getNode(ISD::TRUNCATE, DL, VT, N0.getOperand(1)); in visitTRUNCATE()
12515 N0.getOperand(0).getOpcode() == ISD::ZERO_EXTEND && in visitTRUNCATE()
12516 N0.getOperand(0).getOperand(0).getScalarValueSizeInBits() <= in visitTRUNCATE()
12519 return getTruncatedUSUBSAT(VT, SrcVT, N0.getOperand(0), N0.getOperand(1), in visitTRUNCATE()
12529 SDValue Elt = N->getOperand(i); in getBuildPairElt()
12532 return Elt.getOperand(Elt.getResNo()).getNode(); in getBuildPairElt()
12585 SDValue N0 = N->getOperand(0); in foldBitcastedFPLogic()
12613 SDValue LogicOp0 = N0.getOperand(0); in foldBitcastedFPLogic()
12614 ConstantSDNode *LogicOp1 = isConstOrConstSplat(N0.getOperand(1), true); in foldBitcastedFPLogic()
12617 LogicOp0.getOperand(0).getValueType() == VT) { in foldBitcastedFPLogic()
12618 SDValue FPOp = DAG.getNode(FPOpcode, SDLoc(N), VT, LogicOp0.getOperand(0)); in foldBitcastedFPLogic()
12629 SDValue N0 = N->getOperand(0); in visitBITCAST()
12668 return DAG.getBitcast(VT, N0.getOperand(0)); in visitBITCAST()
12715 SDValue NewConv = DAG.getBitcast(VT, N0.getOperand(0)); in visitBITCAST()
12763 isa<ConstantFPSDNode>(N0.getOperand(0)) && in visitBITCAST()
12765 unsigned OrigXWidth = N0.getOperand(1).getValueSizeInBits(); in visitBITCAST()
12768 SDValue X = DAG.getBitcast(IntXVT, N0.getOperand(1)); in visitBITCAST()
12791 SDValue Cst = DAG.getBitcast(VT, N0.getOperand(0)); in visitBITCAST()
12793 SDValue X = DAG.getBitcast(VT, N0.getOperand(1)); in visitBITCAST()
12816 SDValue Cst = DAG.getBitcast(VT, N0.getOperand(0)); in visitBITCAST()
12844 Op.getOperand(0).getValueType() == VT) in visitBITCAST()
12845 return SDValue(Op.getOperand(0)); in visitBITCAST()
12855 SDValue SV0 = PeekThroughBitcast(N0->getOperand(0)); in visitBITCAST()
12856 SDValue SV1 = PeekThroughBitcast(N0->getOperand(1)); in visitBITCAST()
12882 SDValue N0 = N->getOperand(0); in visitFREEZE()
12957 SDValue Op = BV->getOperand(i+ (isLE ? (NumInputsPerOutput-j-1) : j)); in ConstantFoldBITCASTofBUILD_VECTOR()
13007 SDValue N0 = N->getOperand(0); in visitFADDForFMACombine()
13008 SDValue N1 = N->getOperand(1); in visitFADDForFMACombine()
13057 return DAG.getNode(PreferredFusedOpcode, SL, VT, N0.getOperand(0), in visitFADDForFMACombine()
13058 N0.getOperand(1), N1); in visitFADDForFMACombine()
13064 return DAG.getNode(PreferredFusedOpcode, SL, VT, N1.getOperand(0), in visitFADDForFMACombine()
13065 N1.getOperand(1), N0); in visitFADDForFMACombine()
13073 N0.getOperand(2).getOpcode() == ISD::FMUL && N0.hasOneUse() && in visitFADDForFMACombine()
13074 N0.getOperand(2).hasOneUse()) { in visitFADDForFMACombine()
13078 N1.getOperand(2).getOpcode() == ISD::FMUL && N1.hasOneUse() && in visitFADDForFMACombine()
13079 N1.getOperand(2).hasOneUse()) { in visitFADDForFMACombine()
13084 SDValue A = FMA.getOperand(0); in visitFADDForFMACombine()
13085 SDValue B = FMA.getOperand(1); in visitFADDForFMACombine()
13086 SDValue C = FMA.getOperand(2).getOperand(0); in visitFADDForFMACombine()
13087 SDValue D = FMA.getOperand(2).getOperand(1); in visitFADDForFMACombine()
13096 SDValue N00 = N0.getOperand(0); in visitFADDForFMACombine()
13101 DAG.getNode(ISD::FP_EXTEND, SL, VT, N00.getOperand(0)), in visitFADDForFMACombine()
13102 DAG.getNode(ISD::FP_EXTEND, SL, VT, N00.getOperand(1)), in visitFADDForFMACombine()
13110 SDValue N10 = N1.getOperand(0); in visitFADDForFMACombine()
13115 DAG.getNode(ISD::FP_EXTEND, SL, VT, N10.getOperand(0)), in visitFADDForFMACombine()
13116 DAG.getNode(ISD::FP_EXTEND, SL, VT, N10.getOperand(1)), in visitFADDForFMACombine()
13134 SDValue N02 = N0.getOperand(2); in visitFADDForFMACombine()
13136 SDValue N020 = N02.getOperand(0); in visitFADDForFMACombine()
13140 return FoldFAddFMAFPExtFMul(N0.getOperand(0), N0.getOperand(1), in visitFADDForFMACombine()
13141 N020.getOperand(0), N020.getOperand(1), in visitFADDForFMACombine()
13162 SDValue N00 = N0.getOperand(0); in visitFADDForFMACombine()
13164 SDValue N002 = N00.getOperand(2); in visitFADDForFMACombine()
13168 return FoldFAddFPExtFMAFMul(N00.getOperand(0), N00.getOperand(1), in visitFADDForFMACombine()
13169 N002.getOperand(0), N002.getOperand(1), in visitFADDForFMACombine()
13178 SDValue N12 = N1.getOperand(2); in visitFADDForFMACombine()
13180 SDValue N120 = N12.getOperand(0); in visitFADDForFMACombine()
13184 return FoldFAddFMAFPExtFMul(N1.getOperand(0), N1.getOperand(1), in visitFADDForFMACombine()
13185 N120.getOperand(0), N120.getOperand(1), in visitFADDForFMACombine()
13197 SDValue N10 = N1.getOperand(0); in visitFADDForFMACombine()
13199 SDValue N102 = N10.getOperand(2); in visitFADDForFMACombine()
13203 return FoldFAddFPExtFMAFMul(N10.getOperand(0), N10.getOperand(1), in visitFADDForFMACombine()
13204 N102.getOperand(0), N102.getOperand(1), in visitFADDForFMACombine()
13216 SDValue N0 = N->getOperand(0); in visitFSUBForFMACombine()
13217 SDValue N1 = N->getOperand(1); in visitFSUBForFMACombine()
13261 return DAG.getNode(PreferredFusedOpcode, SL, VT, XY.getOperand(0), in visitFSUBForFMACombine()
13262 XY.getOperand(1), DAG.getNode(ISD::FNEG, SL, VT, Z)); in visitFSUBForFMACombine()
13272 DAG.getNode(ISD::FNEG, SL, VT, YZ.getOperand(0)), in visitFSUBForFMACombine()
13273 YZ.getOperand(1), X); in visitFSUBForFMACombine()
13298 if (N0.getOpcode() == ISD::FNEG && isContractableFMUL(N0.getOperand(0)) && in visitFSUBForFMACombine()
13299 (Aggressive || (N0->hasOneUse() && N0.getOperand(0).hasOneUse()))) { in visitFSUBForFMACombine()
13300 SDValue N00 = N0.getOperand(0).getOperand(0); in visitFSUBForFMACombine()
13301 SDValue N01 = N0.getOperand(0).getOperand(1); in visitFSUBForFMACombine()
13312 SDValue N00 = N0.getOperand(0); in visitFSUBForFMACombine()
13317 DAG.getNode(ISD::FP_EXTEND, SL, VT, N00.getOperand(0)), in visitFSUBForFMACombine()
13318 DAG.getNode(ISD::FP_EXTEND, SL, VT, N00.getOperand(1)), in visitFSUBForFMACombine()
13327 SDValue N10 = N1.getOperand(0); in visitFSUBForFMACombine()
13334 DAG.getNode(ISD::FP_EXTEND, SL, VT, N10.getOperand(0))), in visitFSUBForFMACombine()
13335 DAG.getNode(ISD::FP_EXTEND, SL, VT, N10.getOperand(1)), N0); in visitFSUBForFMACombine()
13346 SDValue N00 = N0.getOperand(0); in visitFSUBForFMACombine()
13348 SDValue N000 = N00.getOperand(0); in visitFSUBForFMACombine()
13355 DAG.getNode(ISD::FP_EXTEND, SL, VT, N000.getOperand(0)), in visitFSUBForFMACombine()
13356 DAG.getNode(ISD::FP_EXTEND, SL, VT, N000.getOperand(1)), in visitFSUBForFMACombine()
13369 SDValue N00 = N0.getOperand(0); in visitFSUBForFMACombine()
13371 SDValue N000 = N00.getOperand(0); in visitFSUBForFMACombine()
13378 DAG.getNode(ISD::FP_EXTEND, SL, VT, N000.getOperand(0)), in visitFSUBForFMACombine()
13379 DAG.getNode(ISD::FP_EXTEND, SL, VT, N000.getOperand(1)), in visitFSUBForFMACombine()
13400 isContractableAndReassociableFMUL(N0.getOperand(2)) && in visitFSUBForFMACombine()
13401 N0->hasOneUse() && N0.getOperand(2)->hasOneUse()) { in visitFSUBForFMACombine()
13402 return DAG.getNode(PreferredFusedOpcode, SL, VT, N0.getOperand(0), in visitFSUBForFMACombine()
13403 N0.getOperand(1), in visitFSUBForFMACombine()
13405 N0.getOperand(2).getOperand(0), in visitFSUBForFMACombine()
13406 N0.getOperand(2).getOperand(1), in visitFSUBForFMACombine()
13413 isContractableAndReassociableFMUL(N1.getOperand(2)) && in visitFSUBForFMACombine()
13415 SDValue N20 = N1.getOperand(2).getOperand(0); in visitFSUBForFMACombine()
13416 SDValue N21 = N1.getOperand(2).getOperand(1); in visitFSUBForFMACombine()
13419 DAG.getNode(ISD::FNEG, SL, VT, N1.getOperand(0)), N1.getOperand(1), in visitFSUBForFMACombine()
13428 SDValue N02 = N0.getOperand(2); in visitFSUBForFMACombine()
13430 SDValue N020 = N02.getOperand(0); in visitFSUBForFMACombine()
13435 PreferredFusedOpcode, SL, VT, N0.getOperand(0), N0.getOperand(1), in visitFSUBForFMACombine()
13438 DAG.getNode(ISD::FP_EXTEND, SL, VT, N020.getOperand(0)), in visitFSUBForFMACombine()
13439 DAG.getNode(ISD::FP_EXTEND, SL, VT, N020.getOperand(1)), in visitFSUBForFMACombine()
13452 SDValue N00 = N0.getOperand(0); in visitFSUBForFMACombine()
13454 SDValue N002 = N00.getOperand(2); in visitFSUBForFMACombine()
13460 DAG.getNode(ISD::FP_EXTEND, SL, VT, N00.getOperand(0)), in visitFSUBForFMACombine()
13461 DAG.getNode(ISD::FP_EXTEND, SL, VT, N00.getOperand(1)), in visitFSUBForFMACombine()
13464 DAG.getNode(ISD::FP_EXTEND, SL, VT, N002.getOperand(0)), in visitFSUBForFMACombine()
13465 DAG.getNode(ISD::FP_EXTEND, SL, VT, N002.getOperand(1)), in visitFSUBForFMACombine()
13474 N1.getOperand(2).getOpcode() == ISD::FP_EXTEND && in visitFSUBForFMACombine()
13476 SDValue N120 = N1.getOperand(2).getOperand(0); in visitFSUBForFMACombine()
13480 SDValue N1200 = N120.getOperand(0); in visitFSUBForFMACombine()
13481 SDValue N1201 = N120.getOperand(1); in visitFSUBForFMACombine()
13484 DAG.getNode(ISD::FNEG, SL, VT, N1.getOperand(0)), N1.getOperand(1), in visitFSUBForFMACombine()
13499 N1.getOperand(0).getOpcode() == PreferredFusedOpcode) { in visitFSUBForFMACombine()
13500 SDValue CvtSrc = N1.getOperand(0); in visitFSUBForFMACombine()
13501 SDValue N100 = CvtSrc.getOperand(0); in visitFSUBForFMACombine()
13502 SDValue N101 = CvtSrc.getOperand(1); in visitFSUBForFMACombine()
13503 SDValue N102 = CvtSrc.getOperand(2); in visitFSUBForFMACombine()
13507 SDValue N1020 = N102.getOperand(0); in visitFSUBForFMACombine()
13508 SDValue N1021 = N102.getOperand(1); in visitFSUBForFMACombine()
13529 SDValue N0 = N->getOperand(0); in visitFMULForFMADistributiveCombine()
13530 SDValue N1 = N->getOperand(1); in visitFMULForFMADistributiveCombine()
13566 if (auto *C = isConstOrConstSplatFP(X.getOperand(1), true)) { in visitFMULForFMADistributiveCombine()
13568 return DAG.getNode(PreferredFusedOpcode, SL, VT, X.getOperand(0), Y, in visitFMULForFMADistributiveCombine()
13571 return DAG.getNode(PreferredFusedOpcode, SL, VT, X.getOperand(0), Y, in visitFMULForFMADistributiveCombine()
13589 if (auto *C0 = isConstOrConstSplatFP(X.getOperand(0), true)) { in visitFMULForFMADistributiveCombine()
13592 DAG.getNode(ISD::FNEG, SL, VT, X.getOperand(1)), Y, in visitFMULForFMADistributiveCombine()
13596 DAG.getNode(ISD::FNEG, SL, VT, X.getOperand(1)), Y, in visitFMULForFMADistributiveCombine()
13599 if (auto *C1 = isConstOrConstSplatFP(X.getOperand(1), true)) { in visitFMULForFMADistributiveCombine()
13601 return DAG.getNode(PreferredFusedOpcode, SL, VT, X.getOperand(0), Y, in visitFMULForFMADistributiveCombine()
13604 return DAG.getNode(PreferredFusedOpcode, SL, VT, X.getOperand(0), Y, in visitFMULForFMADistributiveCombine()
13620 SDValue N0 = N->getOperand(0); in visitFADD()
13621 SDValue N1 = N->getOperand(1); in visitFADD()
13670 auto *C = isConstOrConstSplatFP(FMul.getOperand(1), true); in visitFADD()
13676 SDValue B = N0.getOperand(0); in visitFADD()
13682 SDValue B = N1.getOperand(0); in visitFADD()
13694 if (N0.getOpcode() == ISD::FNEG && N0.getOperand(0) == N1) in visitFADD()
13698 if (N1.getOpcode() == ISD::FNEG && N1.getOperand(0) == N0) in visitFADD()
13710 DAG.isConstantFPBuildVectorOrConstantFP(N0.getOperand(1))) { in visitFADD()
13711 SDValue NewC = DAG.getNode(ISD::FADD, DL, VT, N0.getOperand(1), N1); in visitFADD()
13712 return DAG.getNode(ISD::FADD, DL, VT, N0.getOperand(0), NewC); in visitFADD()
13720 bool CFP00 = DAG.isConstantFPBuildVectorOrConstantFP(N0.getOperand(0)); in visitFADD()
13721 bool CFP01 = DAG.isConstantFPBuildVectorOrConstantFP(N0.getOperand(1)); in visitFADD()
13724 if (CFP01 && !CFP00 && N0.getOperand(0) == N1) { in visitFADD()
13725 SDValue NewCFP = DAG.getNode(ISD::FADD, DL, VT, N0.getOperand(1), in visitFADD()
13732 N1.getOperand(0) == N1.getOperand(1) && in visitFADD()
13733 N0.getOperand(0) == N1.getOperand(0)) { in visitFADD()
13734 SDValue NewCFP = DAG.getNode(ISD::FADD, DL, VT, N0.getOperand(1), in visitFADD()
13736 return DAG.getNode(ISD::FMUL, DL, VT, N0.getOperand(0), NewCFP); in visitFADD()
13741 bool CFP10 = DAG.isConstantFPBuildVectorOrConstantFP(N1.getOperand(0)); in visitFADD()
13742 bool CFP11 = DAG.isConstantFPBuildVectorOrConstantFP(N1.getOperand(1)); in visitFADD()
13745 if (CFP11 && !CFP10 && N1.getOperand(0) == N0) { in visitFADD()
13746 SDValue NewCFP = DAG.getNode(ISD::FADD, DL, VT, N1.getOperand(1), in visitFADD()
13753 N0.getOperand(0) == N0.getOperand(1) && in visitFADD()
13754 N1.getOperand(0) == N0.getOperand(0)) { in visitFADD()
13755 SDValue NewCFP = DAG.getNode(ISD::FADD, DL, VT, N1.getOperand(1), in visitFADD()
13757 return DAG.getNode(ISD::FMUL, DL, VT, N1.getOperand(0), NewCFP); in visitFADD()
13762 bool CFP00 = DAG.isConstantFPBuildVectorOrConstantFP(N0.getOperand(0)); in visitFADD()
13764 if (!CFP00 && N0.getOperand(0) == N0.getOperand(1) && in visitFADD()
13765 (N0.getOperand(0) == N1)) { in visitFADD()
13772 bool CFP10 = DAG.isConstantFPBuildVectorOrConstantFP(N1.getOperand(0)); in visitFADD()
13774 if (!CFP10 && N1.getOperand(0) == N1.getOperand(1) && in visitFADD()
13775 N1.getOperand(0) == N0) { in visitFADD()
13783 N0.getOperand(0) == N0.getOperand(1) && in visitFADD()
13784 N1.getOperand(0) == N1.getOperand(1) && in visitFADD()
13785 N0.getOperand(0) == N1.getOperand(0)) { in visitFADD()
13786 return DAG.getNode(ISD::FMUL, DL, VT, N0.getOperand(0), in visitFADD()
13801 SDValue Chain = N->getOperand(0); in visitSTRICT_FADD()
13802 SDValue N0 = N->getOperand(1); in visitSTRICT_FADD()
13803 SDValue N1 = N->getOperand(2); in visitSTRICT_FADD()
13828 SDValue N0 = N->getOperand(0); in visitFSUB()
13829 SDValue N1 = N->getOperand(1); in visitFSUB()
13890 if (N0 == N1->getOperand(0)) in visitFSUB()
13891 return DAG.getNode(ISD::FNEG, DL, VT, N1->getOperand(1)); in visitFSUB()
13893 if (N0 == N1->getOperand(1)) in visitFSUB()
13894 return DAG.getNode(ISD::FNEG, DL, VT, N1->getOperand(0)); in visitFSUB()
13912 SDValue N0 = N->getOperand(0); in visitFMUL()
13913 SDValue N1 = N->getOperand(1); in visitFMUL()
13948 SDValue N00 = N0.getOperand(0); in visitFMUL()
13949 SDValue N01 = N0.getOperand(1); in visitFMUL()
13962 N0.getOperand(0) == N0.getOperand(1)) { in visitFMUL()
13965 return DAG.getNode(ISD::FMUL, DL, VT, N0.getOperand(0), MulConsts); in visitFMUL()
14001 SDValue Cond = Select.getOperand(0); in visitFMUL()
14002 auto TrueOpnd = dyn_cast<ConstantFPSDNode>(Select.getOperand(1)); in visitFMUL()
14003 auto FalseOpnd = dyn_cast<ConstantFPSDNode>(Select.getOperand(2)); in visitFMUL()
14006 Cond.getOpcode() == ISD::SETCC && Cond.getOperand(0) == X && in visitFMUL()
14007 isa<ConstantFPSDNode>(Cond.getOperand(1)) && in visitFMUL()
14008 cast<ConstantFPSDNode>(Cond.getOperand(1))->isExactlyValue(0.0)) { in visitFMUL()
14009 ISD::CondCode CC = cast<CondCodeSDNode>(Cond.getOperand(2))->get(); in visitFMUL()
14048 SDValue N0 = N->getOperand(0); in visitFMA()
14049 SDValue N1 = N->getOperand(1); in visitFMA()
14050 SDValue N2 = N->getOperand(2); in visitFMA()
14102 if (N2.getOpcode() == ISD::FMUL && N0 == N2.getOperand(0) && in visitFMA()
14104 DAG.isConstantFPBuildVectorOrConstantFP(N2.getOperand(1))) { in visitFMA()
14106 DAG.getNode(ISD::FADD, DL, VT, N1, N2.getOperand(1))); in visitFMA()
14112 DAG.isConstantFPBuildVectorOrConstantFP(N0.getOperand(1))) { in visitFMA()
14113 return DAG.getNode(ISD::FMA, DL, VT, N0.getOperand(0), in visitFMA()
14114 DAG.getNode(ISD::FMUL, DL, VT, N1, N0.getOperand(1)), in visitFMA()
14136 return DAG.getNode(ISD::FMA, DL, VT, N0.getOperand(0), in visitFMA()
14150 if (N1CFP && N2.getOpcode() == ISD::FNEG && N2.getOperand(0) == N0) { in visitFMA()
14183 SDValue N0 = N->getOperand(0), N1 = N->getOperand(1); in combineRepeatedFPDivisors()
14206 if (U->getOpcode() == ISD::FDIV && U->getOperand(1) == N1) { in combineRepeatedFPDivisors()
14208 if (U->getOperand(1).getOpcode() == ISD::FSQRT && in combineRepeatedFPDivisors()
14209 U->getOperand(0) == U->getOperand(1).getOperand(0) && in combineRepeatedFPDivisors()
14232 SDValue Dividend = U->getOperand(0); in combineRepeatedFPDivisors()
14247 SDValue N0 = N->getOperand(0); in visitFDIV()
14248 SDValue N1 = N->getOperand(1); in visitFDIV()
14298 if (SDValue RV = buildRsqrtEstimate(N1.getOperand(0), Flags)) in visitFDIV()
14301 N1.getOperand(0).getOpcode() == ISD::FSQRT) { in visitFDIV()
14303 buildRsqrtEstimate(N1.getOperand(0).getOperand(0), Flags)) { in visitFDIV()
14309 N1.getOperand(0).getOpcode() == ISD::FSQRT) { in visitFDIV()
14311 buildRsqrtEstimate(N1.getOperand(0).getOperand(0), Flags)) { in visitFDIV()
14312 RV = DAG.getNode(ISD::FP_ROUND, SDLoc(N1), VT, RV, N1.getOperand(1)); in visitFDIV()
14320 if (N1.getOperand(0).getOpcode() == ISD::FSQRT) { in visitFDIV()
14321 Sqrt = N1.getOperand(0); in visitFDIV()
14322 Y = N1.getOperand(1); in visitFDIV()
14323 } else if (N1.getOperand(1).getOpcode() == ISD::FSQRT) { in visitFDIV()
14324 Sqrt = N1.getOperand(1); in visitFDIV()
14325 Y = N1.getOperand(0); in visitFDIV()
14334 A = Y.getOperand(0); in visitFDIV()
14335 else if (Y == Sqrt.getOperand(0)) in visitFDIV()
14342 DAG.getNode(ISD::FMUL, DL, VT, AA, Sqrt.getOperand(0)); in visitFDIV()
14353 if (SDValue Rsqrt = buildRsqrtEstimate(Sqrt.getOperand(0), Flags)) { in visitFDIV()
14370 if (N1.getOpcode() == ISD::FSQRT && N0 == N1.getOperand(0)) in visitFDIV()
14391 SDValue N0 = N->getOperand(0); in visitFREM()
14392 SDValue N1 = N->getOperand(1); in visitFREM()
14422 SDValue N0 = N->getOperand(0); in visitFSQRT()
14437 SDValue N1 = N->getOperand(1); in CanCombineFCOPYSIGN_EXTEND_ROUND()
14441 EVT N1Op0VT = N1->getOperand(0).getValueType(); in CanCombineFCOPYSIGN_EXTEND_ROUND()
14464 SDValue N0 = N->getOperand(0); in visitFCOPYSIGN()
14465 SDValue N1 = N->getOperand(1); in visitFCOPYSIGN()
14473 if (ConstantFPSDNode *N1C = isConstOrConstSplatFP(N->getOperand(1))) { in visitFCOPYSIGN()
14492 return DAG.getNode(ISD::FCOPYSIGN, SDLoc(N), VT, N0.getOperand(0), N1); in visitFCOPYSIGN()
14500 return DAG.getNode(ISD::FCOPYSIGN, SDLoc(N), VT, N0, N1.getOperand(1)); in visitFCOPYSIGN()
14505 return DAG.getNode(ISD::FCOPYSIGN, SDLoc(N), VT, N0, N1.getOperand(0)); in visitFCOPYSIGN()
14511 ConstantFPSDNode *ExponentC = isConstOrConstSplatFP(N->getOperand(1)); in visitFPOW()
14541 return DAG.getNode(ISD::FCBRT, SDLoc(N), VT, N->getOperand(0)); in visitFPOW()
14576 SDValue Sqrt = DAG.getNode(ISD::FSQRT, DL, VT, N->getOperand(0)); in visitFPOW()
14610 SDValue N0 = N->getOperand(0); in foldFPToIntToFP()
14612 N0.getOperand(0).getValueType() == VT) in foldFPToIntToFP()
14613 return DAG.getNode(ISD::FTRUNC, SDLoc(N), VT, N0.getOperand(0)); in foldFPToIntToFP()
14616 N0.getOperand(0).getValueType() == VT) in foldFPToIntToFP()
14617 return DAG.getNode(ISD::FTRUNC, SDLoc(N), VT, N0.getOperand(0)); in foldFPToIntToFP()
14623 SDValue N0 = N->getOperand(0); in visitSINT_TO_FP()
14660 N0.getOperand(0).getOpcode() == ISD::SETCC && !VT.isVector() && in visitSINT_TO_FP()
14663 return DAG.getSelect(DL, VT, N0.getOperand(0), in visitSINT_TO_FP()
14675 SDValue N0 = N->getOperand(0); in visitUINT_TO_FP()
14715 SDValue N0 = N->getOperand(0); in FoldIntToFPToInt()
14721 SDValue Src = N0.getOperand(0); in FoldIntToFPToInt()
14756 SDValue N0 = N->getOperand(0); in visitFP_TO_SINT()
14771 SDValue N0 = N->getOperand(0); in visitFP_TO_UINT()
14786 SDValue N0 = N->getOperand(0); in visitFP_ROUND()
14787 SDValue N1 = N->getOperand(1); in visitFP_ROUND()
14796 if (N0.getOpcode() == ISD::FP_EXTEND && VT == N0.getOperand(0).getValueType()) in visitFP_ROUND()
14797 return N0.getOperand(0); in visitFP_ROUND()
14811 if (N0.getOperand(0).getValueType() == MVT::f80 && VT == MVT::f16) in visitFP_ROUND()
14821 return DAG.getNode(ISD::FP_ROUND, DL, VT, N0.getOperand(0), in visitFP_ROUND()
14829 N0.getOperand(0), N1); in visitFP_ROUND()
14832 Tmp, N0.getOperand(1)); in visitFP_ROUND()
14842 SDValue N0 = N->getOperand(0); in visitFP_EXTEND()
14857 return DAG.getNode(ISD::FP16_TO_FP, SDLoc(N), VT, N0.getOperand(0)); in visitFP_EXTEND()
14863 SDValue In = N0.getOperand(0); in visitFP_EXTEND()
14867 In, N0.getOperand(1)); in visitFP_EXTEND()
14895 SDValue N0 = N->getOperand(0); in visitFCEIL()
14906 SDValue N0 = N->getOperand(0); in visitFTRUNC()
14930 SDValue N0 = N->getOperand(0); in visitFFLOOR()
14941 SDValue N0 = N->getOperand(0); in visitFNEG()
14960 return DAG.getNode(ISD::FSUB, SDLoc(N), VT, N0.getOperand(1), in visitFNEG()
14961 N0.getOperand(0)); in visitFNEG()
14972 SDValue N0 = N->getOperand(0); in visitFMinMax()
14973 SDValue N1 = N->getOperand(1); in visitFMinMax()
15002 return PropagatesNaN ? N->getOperand(1) : N->getOperand(0); in visitFMinMax()
15012 return N->getOperand(1); in visitFMinMax()
15019 return N->getOperand(0); in visitFMinMax()
15043 SDValue N0 = N->getOperand(0); in visitFABS()
15052 return N->getOperand(0); in visitFABS()
15057 return DAG.getNode(ISD::FABS, SDLoc(N), VT, N0.getOperand(0)); in visitFABS()
15066 SDValue Chain = N->getOperand(0); in visitBRCOND()
15067 SDValue N1 = N->getOperand(1); in visitBRCOND()
15068 SDValue N2 = N->getOperand(2); in visitBRCOND()
15074 N1->getOperand(0), N2); in visitBRCOND()
15087 N1.getOperand(0).getValueType())) { in visitBRCOND()
15089 Chain, N1.getOperand(2), in visitBRCOND()
15090 N1.getOperand(0), N1.getOperand(1), N2); in visitBRCOND()
15108 (N.getOperand(0).hasOneUse() && in rebuildSetCC()
15109 N.getOperand(0).getOpcode() == ISD::SRL))) { in rebuildSetCC()
15112 N = N.getOperand(0); in rebuildSetCC()
15131 SDValue Op0 = N.getOperand(0); in rebuildSetCC()
15132 SDValue Op1 = N.getOperand(1); in rebuildSetCC()
15135 SDValue AndOp1 = Op0.getOperand(1); in rebuildSetCC()
15176 SDValue Op0 = N->getOperand(0); in rebuildSetCC()
15177 SDValue Op1 = N->getOperand(1); in rebuildSetCC()
15185 Op0 = N->getOperand(0); in rebuildSetCC()
15186 Op1 = N->getOperand(1); in rebuildSetCC()
15205 CondCodeSDNode *CC = cast<CondCodeSDNode>(N->getOperand(1)); in visitBR_CC()
15206 SDValue CondLHS = N->getOperand(2), CondRHS = N->getOperand(3); in visitBR_CC()
15223 N->getOperand(0), Simp.getOperand(2), in visitBR_CC()
15224 Simp.getOperand(0), Simp.getOperand(1), in visitBR_CC()
15225 N->getOperand(4)); in visitBR_CC()
15370 SDValue Op1 = Use.getUser()->getOperand((UI.getOperandNo() + 1) & 1); in CombineToPreIndexedLoadStore()
15442 if (OtherUses[i]->getOperand(OffsetIdx).getNode() == BasePtr.getNode()) in CombineToPreIndexedLoadStore()
15444 assert(OtherUses[i]->getOperand(!OffsetIdx).getNode() == in CombineToPreIndexedLoadStore()
15458 auto *CN = cast<ConstantSDNode>(OtherUses[i]->getOperand(OffsetIdx)); in CombineToPreIndexedLoadStore()
15636 SDValue BP = LD->getOperand(1); in SplitIndexingFromLoad()
15637 SDValue Inc = LD->getOperand(2); in SplitIndexingFromLoad()
15714 SDValue Chain = LD->getOperand(0); in ForwardStoreValueToDirectLoad()
16004 if (!TLI.isTruncateFree(LS.Inst->getOperand(0).getValueType(), in addSliceGain()
16233 TLI.getRegClassFor(Use->getOperand(0).getValueType().getSimpleVT(), in canMergeExpensiveCrossRegisterBankCopy()
16234 Use->getOperand(0)->isDivergent()); in canMergeExpensiveCrossRegisterBankCopy()
16443 isa<ConstantSDNode>(User->getOperand(1))) { in SliceUpLoad()
16494 SliceInst = SliceInst.getOperand(0); in SliceUpLoad()
16516 !isa<ConstantSDNode>(V->getOperand(1)) || in CheckForMaskedLoad()
16517 !ISD::isNormalLoad(V->getOperand(0).getNode())) in CheckForMaskedLoad()
16521 LoadSDNode *LD = cast<LoadSDNode>(V->getOperand(0)); in CheckForMaskedLoad()
16533 uint64_t NotMask = ~cast<ConstantSDNode>(V->getOperand(1))->getSExtValue(); in CheckForMaskedLoad()
16664 MaskedLoad = CheckForMaskedLoad(Value.getOperand(0), Ptr, Chain); in ReduceLoadOpStoreWidth()
16667 Value.getOperand(1), ST,this)) in ReduceLoadOpStoreWidth()
16671 MaskedLoad = CheckForMaskedLoad(Value.getOperand(1), Ptr, Chain); in ReduceLoadOpStoreWidth()
16674 Value.getOperand(0), ST,this)) in ReduceLoadOpStoreWidth()
16682 Value.getOperand(1).getOpcode() != ISD::Constant) in ReduceLoadOpStoreWidth()
16685 SDValue N0 = Value.getOperand(0); in ReduceLoadOpStoreWidth()
16695 SDValue N1 = Value.getOperand(1); in ReduceLoadOpStoreWidth()
16852 SDNode *MulVar = AddNode.getOperand(0).getNode(); in isMulAddWithConstProfitable()
16855 if (Use->getOperand(0) == ConstNode) in isMulAddWithConstProfitable()
16856 OtherOp = Use->getOperand(1).getNode(); in isMulAddWithConstProfitable()
16858 OtherOp = Use->getOperand(0).getNode(); in isMulAddWithConstProfitable()
16887 DAG.isConstantIntBuildVectorOrConstantInt(OtherOp->getOperand(1)) && in isMulAddWithConstProfitable()
16888 OtherOp->getOperand(0).getNode() == MulVar) in isMulAddWithConstProfitable()
16994 SDValue Vec = Val.getOperand(0); in mergeStoresOfConstantsOrVecElts()
16995 SDValue Idx = Val.getOperand(1); in mergeStoresOfConstantsOrVecElts()
17277 Worklist.push_back(N->getOperand(j).getNode()); in checkMergeStoreCandidatesForDependencies()
17794 SDValue Val = StoreNodes[i].MemNode->getOperand(1); in tryStoreMergeOfLoads()
18010 EVT SVT = Value.getOperand(0).getValueType(); in visitSTORE()
18021 return DAG.getStore(Chain, SDLoc(N), Value.getOperand(0), Ptr, in visitSTORE()
18151 TLI.canCombineTruncStore(Value.getOperand(0).getValueType(), in visitSTORE()
18153 return DAG.getTruncStore(Chain, SDLoc(N), Value.getOperand(0), in visitSTORE()
18199 const BaseIndexOffset LifetimeEndBase(N->getOperand(1), SDValue(), in visitLIFETIME_END()
18203 SmallVector<SDValue, 8> Chains = {N->getOperand(0)}; in visitLIFETIME_END()
18211 Chains.push_back(Chain.getOperand(--Nops)); in visitLIFETIME_END()
18218 Chains.push_back(Chain.getOperand(0)); in visitLIFETIME_END()
18292 SDValue Op1 = Val.getOperand(0); in splitMergedValStore()
18293 SDValue Op2 = Val.getOperand(1); in splitMergedValStore()
18301 Hi = Op1.getOperand(0); in splitMergedValStore()
18307 ConstantSDNode *ShAmt = dyn_cast<ConstantSDNode>(Op1.getOperand(1)); in splitMergedValStore()
18314 !Lo.getOperand(0).getValueType().isScalarInteger() || in splitMergedValStore()
18315 Lo.getOperand(0).getValueSizeInBits() > HalfValBitSize || in splitMergedValStore()
18317 !Hi.getOperand(0).getValueType().isScalarInteger() || in splitMergedValStore()
18318 Hi.getOperand(0).getValueSizeInBits() > HalfValBitSize) in splitMergedValStore()
18323 EVT LowTy = (Lo.getOperand(0).getOpcode() == ISD::BITCAST) in splitMergedValStore()
18324 ? Lo.getOperand(0).getValueType() in splitMergedValStore()
18326 EVT HighTy = (Hi.getOperand(0).getOpcode() == ISD::BITCAST) in splitMergedValStore()
18327 ? Hi.getOperand(0).getValueType() in splitMergedValStore()
18338 Lo = DAG.getNode(ISD::ZERO_EXTEND, DL, VT, Lo.getOperand(0)); in splitMergedValStore()
18339 Hi = DAG.getNode(ISD::ZERO_EXTEND, DL, VT, Hi.getOperand(0)); in splitMergedValStore()
18358 SDValue InsertVal = N->getOperand(1); in combineInsertEltToShuffle()
18359 SDValue Vec = N->getOperand(0); in combineInsertEltToShuffle()
18367 isa<ConstantSDNode>(InsertVal.getOperand(1))) { in combineInsertEltToShuffle()
18371 SDValue X = Vec.getOperand(0); in combineInsertEltToShuffle()
18372 SDValue Y = Vec.getOperand(1); in combineInsertEltToShuffle()
18377 SDValue InsertVal0 = InsertVal.getOperand(0); in combineInsertEltToShuffle()
18401 int Step = ArgVal.getOperand(0).getValueType().getVectorNumElements(); in combineInsertEltToShuffle()
18416 auto *ExtrIndex = cast<ConstantSDNode>(InsertVal.getOperand(1)); in combineInsertEltToShuffle()
18435 !InsertVal.getOperand(0).getValueType().isVector()) in combineInsertEltToShuffle()
18438 SDValue SubVec = InsertVal.getOperand(0); in combineInsertEltToShuffle()
18439 SDValue DestVec = N->getOperand(0); in combineInsertEltToShuffle()
18486 SDValue InVec = N->getOperand(0); in visitINSERT_VECTOR_ELT()
18487 SDValue InVal = N->getOperand(1); in visitINSERT_VECTOR_ELT()
18488 SDValue EltNo = N->getOperand(2); in visitINSERT_VECTOR_ELT()
18502 InVec == InVal.getOperand(0) && EltNo == InVal.getOperand(1)) in visitINSERT_VECTOR_ELT()
18537 && isa<ConstantSDNode>(InVec.getOperand(2))) { in visitINSERT_VECTOR_ELT()
18542 InVec.getOperand(0), InVal, EltNo); in visitINSERT_VECTOR_ELT()
18545 VT, NewOp, InVec.getOperand(1), InVec.getOperand(2)); in visitINSERT_VECTOR_ELT()
18672 SDValue Vec = ExtElt->getOperand(0); in scalarizeExtractedBinop()
18673 SDValue Index = ExtElt->getOperand(1); in scalarizeExtractedBinop()
18686 SDValue Op0 = Vec.getOperand(0); in scalarizeExtractedBinop()
18687 SDValue Op1 = Vec.getOperand(1); in scalarizeExtractedBinop()
18703 SDValue VecOp = N->getOperand(0); in visitEXTRACT_VECTOR_ELT()
18704 SDValue Index = N->getOperand(1); in visitEXTRACT_VECTOR_ELT()
18716 Index == VecOp.getOperand(2)) { in visitEXTRACT_VECTOR_ELT()
18717 SDValue Elt = VecOp.getOperand(1); in visitEXTRACT_VECTOR_ELT()
18730 SDValue InOp = VecOp.getOperand(0); in visitEXTRACT_VECTOR_ELT()
18754 SDValue Elt = VecOp.getOperand(IndexVal); in visitEXTRACT_VECTOR_ELT()
18784 SDValue BCSrc = VecOp.getOperand(0); in visitEXTRACT_VECTOR_ELT()
18792 SDValue X = BCSrc.getOperand(0); in visitEXTRACT_VECTOR_ELT()
18831 SVInVec = VecOp.getOperand(0); in visitEXTRACT_VECTOR_ELT()
18833 SVInVec = VecOp.getOperand(1); in visitEXTRACT_VECTOR_ELT()
18838 SDValue InOp = SVInVec.getOperand(OrigElt); in visitEXTRACT_VECTOR_ELT()
18863 Use->getOperand(0) == VecOp && in visitEXTRACT_VECTOR_ELT()
18864 isa<ConstantSDNode>(Use->getOperand(1)); in visitEXTRACT_VECTOR_ELT()
18868 auto *CstElt = cast<ConstantSDNode>(Use->getOperand(1)); in visitEXTRACT_VECTOR_ELT()
18903 EVT BCVT = VecOp.getOperand(0).getValueType(); in visitEXTRACT_VECTOR_ELT()
18908 VecOp = VecOp.getOperand(0); in visitEXTRACT_VECTOR_ELT()
18934 VecOp.getOperand(0).getValueType() == ExtVT && in visitEXTRACT_VECTOR_ELT()
18935 ISD::isNormalLoad(VecOp.getOperand(0).getNode())) { in visitEXTRACT_VECTOR_ELT()
18940 LN0 = cast<LoadSDNode>(VecOp.getOperand(0)); in visitEXTRACT_VECTOR_ELT()
18958 VecOp = (Idx < (int)NumElts) ? VecOp.getOperand(0) : VecOp.getOperand(1); in visitEXTRACT_VECTOR_ELT()
18965 VecOp = VecOp.getOperand(0); in visitEXTRACT_VECTOR_ELT()
18976 VecOp.getOperand(0).getValueType().getVectorElementType()))) { in visitEXTRACT_VECTOR_ELT()
18986 EVT ConcatVT = VecOp.getOperand(0).getValueType(); in visitEXTRACT_VECTOR_ELT()
18991 SDValue ConcatOp = VecOp.getOperand(Elt / ConcatNumElts); in visitEXTRACT_VECTOR_ELT()
19034 SDValue In = N->getOperand(i); in reduceBuildVecExtToExtBuildVec()
19048 EVT InTy = In.getOperand(0).getValueType(); in reduceBuildVecExtToExtBuildVec()
19093 SDValue Cast = N->getOperand(i); in reduceBuildVecExtToExtBuildVec()
19101 In = Cast->getOperand(0); in reduceBuildVecExtToExtBuildVec()
19153 return Op.getOperand(0); in reduceBuildVecTruncToBitCast()
19160 SDValue In = PeekThroughBitcast(N->getOperand(i)); in reduceBuildVecTruncToBitCast()
19167 In = PeekThroughBitcast(In.getOperand(0)); in reduceBuildVecTruncToBitCast()
19178 SDValue part = PeekThroughBitcast(In.getOperand(0)); in reduceBuildVecTruncToBitCast()
19187 SDValue ShiftAmtVal = In.getOperand(1); in reduceBuildVecTruncToBitCast()
19302 unsigned ExtIndex = N->getOperand(i).getConstantOperandVal(1); in createBuildVecShuffle()
19333 SDValue Op = BV->getOperand(i); in reduceBuildVecToShuffleWithZero()
19352 SDValue Zext = BV->getOperand(ZextElt); in reduceBuildVecToShuffleWithZero()
19354 Zext.getOperand(0).getOpcode() != ISD::EXTRACT_VECTOR_ELT || in reduceBuildVecToShuffleWithZero()
19355 !isa<ConstantSDNode>(Zext.getOperand(0).getOperand(1)) || in reduceBuildVecToShuffleWithZero()
19361 SDValue Extract = Zext.getOperand(0); in reduceBuildVecToShuffleWithZero()
19365 Extract.getOperand(0).getValueSizeInBits() != VT.getSizeInBits()) in reduceBuildVecToShuffleWithZero()
19392 EVT VecVT = Extract.getOperand(0).getValueType(); in reduceBuildVecToShuffleWithZero()
19395 SDValue Shuf = TLI.buildLegalVectorShuffle(VecVT, DL, Extract.getOperand(0), in reduceBuildVecToShuffleWithZero()
19443 SDValue Op = N->getOperand(i); in reduceBuildVecToShuffle()
19460 !isa<ConstantSDNode>(Op.getOperand(1))) in reduceBuildVecToShuffle()
19462 SDValue ExtractedFromVec = Op.getOperand(0); in reduceBuildVecToShuffle()
19507 unsigned Index = N->getOperand(i).getConstantOperandVal(1); in reduceBuildVecToShuffle()
19660 SDValue Op0 = N->getOperand(0); in convertBuildVecZextToZext()
19665 Op.getOperand(0).getOpcode() == ISD::EXTRACT_VECTOR_ELT && in convertBuildVecZextToZext()
19666 Op0.getOperand(0).getOperand(0) == Op.getOperand(0).getOperand(0)) in convertBuildVecZextToZext()
19667 if (auto *C = dyn_cast<ConstantSDNode>(Op.getOperand(0).getOperand(1))) in convertBuildVecZextToZext()
19679 SDValue In = Op0.getOperand(0).getOperand(0); in convertBuildVecZextToZext()
19689 if ((Offset + i) != checkElem(N->getOperand(i))) in convertBuildVecZextToZext()
19695 Op0.getOperand(0).getOperand(1)); in convertBuildVecZextToZext()
19735 SDValue Op0 = N->getOperand(0); in visitBUILD_VECTOR()
19738 (Op0.getOperand(0) == Op.getOperand(0))) in visitBUILD_VECTOR()
19739 if (auto CNode = dyn_cast<ConstantSDNode>(Op.getOperand(1))) in visitBUILD_VECTOR()
19746 if (Offset + i != checkElem(N->getOperand(i))) { in visitBUILD_VECTOR()
19753 (Op0.getOperand(0).getValueType() == N->getValueType(0))) in visitBUILD_VECTOR()
19754 return Op0.getOperand(0); in visitBUILD_VECTOR()
19759 Op0.getOperand(0), Op0.getOperand(1)); in visitBUILD_VECTOR()
19787 EVT OpVT = N->getOperand(0).getValueType(); in combineConcatVectorOfScalars()
19805 !Op.getOperand(0).getValueType().isVector()) in combineConcatVectorOfScalars()
19806 Ops.push_back(Op.getOperand(0)); in combineConcatVectorOfScalars()
19852 EVT OpVT = N->getOperand(0).getValueType(); in combineConcatVectorOfExtracts()
19877 SDValue ExtVec = Op.getOperand(0); in combineConcatVectorOfExtracts()
19925 unsigned CastOpcode = N->getOperand(0).getOpcode(); in combineConcatVectorOfCasts()
19942 EVT SrcVT = N->getOperand(0).getOperand(0).getValueType(); in combineConcatVectorOfCasts()
19951 Op.getOperand(0).getValueType() != SrcVT) in combineConcatVectorOfCasts()
19953 SrcOps.push_back(Op.getOperand(0)); in combineConcatVectorOfCasts()
19990 return N->getOperand(0); in visitCONCAT_VECTORS()
20000 SDValue In = N->getOperand(0); in visitCONCAT_VECTORS()
20019 if (SVT == Scalar.getOperand(0).getValueType()) in visitCONCAT_VECTORS()
20020 Scalar = Scalar.getOperand(0); in visitCONCAT_VECTORS()
20030 TLI.isTypeLegal(Scalar->getOperand(0).getValueType())) in visitCONCAT_VECTORS()
20031 Scalar = Scalar->getOperand(0); in visitCONCAT_VECTORS()
20073 EVT OpSVT = Op.getOperand(0).getValueType(); in visitCONCAT_VECTORS()
20094 DAG.getNode(ISD::TRUNCATE, SDLoc(N), MinVT, Op.getOperand(i))); in visitCONCAT_VECTORS()
20124 N->getOperand(0).getValueType().getVectorMinNumElements(); in visitCONCAT_VECTORS()
20127 SDValue Op = N->getOperand(i); in visitCONCAT_VECTORS()
20138 if (Op.getOperand(0) != SingleSource) in visitCONCAT_VECTORS()
20141 SingleSource = Op.getOperand(0); in visitCONCAT_VECTORS()
20166 V.getOperand(1).getValueType() == SubVT && V.getOperand(2) == Index) { in getSubVectorSrc()
20167 return V.getOperand(1); in getSubVectorSrc()
20171 V.getOperand(0).getValueType() == SubVT && in getSubVectorSrc()
20174 return V.getOperand(SubIdx); in getSubVectorSrc()
20183 SDValue BinOp = Extract->getOperand(0); in narrowInsertExtractVectorBinOp()
20189 SDValue Bop0 = BinOp.getOperand(0), Bop1 = BinOp.getOperand(1); in narrowInsertExtractVectorBinOp()
20193 SDValue Index = Extract->getOperand(1); in narrowInsertExtractVectorBinOp()
20225 auto *ExtractIndexC = dyn_cast<ConstantSDNode>(Extract->getOperand(1)); in narrowExtractedVectorBinOp()
20232 SDValue BinOp = peekThroughBitcasts(Extract->getOperand(0)); in narrowExtractedVectorBinOp()
20241 auto *C = isConstOrConstSplatFP(BinOp.getOperand(0), /*AllowUndefs*/ true); in narrowExtractedVectorBinOp()
20285 BinOp.hasOneUse() && Extract->getOperand(0)->hasOneUse()) { in narrowExtractedVectorBinOp()
20290 BinOp.getOperand(0), NewExtIndex); in narrowExtractedVectorBinOp()
20292 BinOp.getOperand(1), NewExtIndex); in narrowExtractedVectorBinOp()
20315 return V.getOperand(ConcatOpNum); in narrowExtractedVectorBinOp()
20318 SDValue SubVecL = GetSubVector(peekThroughBitcasts(BinOp.getOperand(0))); in narrowExtractedVectorBinOp()
20319 SDValue SubVecR = GetSubVector(peekThroughBitcasts(BinOp.getOperand(1))); in narrowExtractedVectorBinOp()
20331 BinOp.getOperand(0), IndexC); in narrowExtractedVectorBinOp()
20335 BinOp.getOperand(1), IndexC); in narrowExtractedVectorBinOp()
20352 auto *Ld = dyn_cast<LoadSDNode>(Extract->getOperand(0)); in narrowExtractedVectorLoad()
20353 auto *ExtIdx = dyn_cast<ConstantSDNode>(Extract->getOperand(1)); in narrowExtractedVectorLoad()
20405 SDValue V = N->getOperand(0); in visitEXTRACT_SUBVECTOR()
20419 if (TLI.isExtractSubvectorCheap(NVT, V.getOperand(0).getValueType(), in visitEXTRACT_SUBVECTOR()
20422 return DAG.getNode(ISD::EXTRACT_SUBVECTOR, SDLoc(N), NVT, V.getOperand(0), in visitEXTRACT_SUBVECTOR()
20423 V.getOperand(1)); in visitEXTRACT_SUBVECTOR()
20430 V.getOperand(0).getValueType().isVector() && in visitEXTRACT_SUBVECTOR()
20432 SDValue SrcOp = V.getOperand(0); in visitEXTRACT_SUBVECTOR()
20445 V.getOperand(0), NewIndex); in visitEXTRACT_SUBVECTOR()
20464 V.getOperand(0), NewIndex); in visitEXTRACT_SUBVECTOR()
20472 V.getOperand(0), NewIndex); in visitEXTRACT_SUBVECTOR()
20482 EVT ConcatSrcVT = V.getOperand(0).getValueType(); in visitEXTRACT_SUBVECTOR()
20495 return V.getOperand(ConcatOpIdx); in visitEXTRACT_SUBVECTOR()
20511 V.getOperand(ConcatOpIdx), NewIndexC); in visitEXTRACT_SUBVECTOR()
20536 SDValue Src = V->getOperand(IdxVal); in visitEXTRACT_SUBVECTOR()
20553 EVT SmallVT = V.getOperand(1).getValueType(); in visitEXTRACT_SUBVECTOR()
20568 return DAG.getBitcast(NVT, V.getOperand(1)); in visitEXTRACT_SUBVECTOR()
20572 DAG.getBitcast(N->getOperand(0).getValueType(), V.getOperand(0)), in visitEXTRACT_SUBVECTOR()
20573 N->getOperand(1)); in visitEXTRACT_SUBVECTOR()
20591 SDValue N0 = Shuf->getOperand(0), N1 = Shuf->getOperand(1); in foldShuffleOfConcatUndefs()
20594 !N0.getOperand(1).isUndef() || !N1.getOperand(1).isUndef()) in foldShuffleOfConcatUndefs()
20628 SDValue X = N0.getOperand(0), Y = N1.getOperand(0); in foldShuffleOfConcatUndefs()
20641 SDValue N0 = N->getOperand(0); in partitionShuffleOfConcats()
20642 SDValue N1 = N->getOperand(1); in partitionShuffleOfConcats()
20647 EVT ConcatVT = N0.getOperand(0).getValueType(); in partitionShuffleOfConcats()
20659 N0 = DAG.getVectorShuffle(ConcatVT, SDLoc(N), N0.getOperand(0), in partitionShuffleOfConcats()
20660 N0.getOperand(1), in partitionShuffleOfConcats()
20692 Ops.push_back(N0.getOperand(OpIdx)); in partitionShuffleOfConcats()
20694 Ops.push_back(N1.getOperand(OpIdx - N0.getNumOperands())); in partitionShuffleOfConcats()
20721 SDValue N0 = SVN->getOperand(0); in combineShuffleOfScalars()
20722 SDValue N1 = SVN->getOperand(1); in combineShuffleOfScalars()
20758 Op = S.getOperand(Idx); in combineShuffleOfScalars()
20760 SDValue Op0 = S.getOperand(0); in combineShuffleOfScalars()
20811 SDValue N0 = SVN->getOperand(0); in combineShuffleToVectorExtend()
20863 SDValue N0 = peekThroughBitcasts(SVN->getOperand(0)); in combineTruncationShuffle()
20871 SDValue N00 = N0.getOperand(0); in combineTruncationShuffle()
20917 if (!Shuf->getOperand(1).isUndef()) in combineShuffleOfSplatVal()
20919 auto *Splat = dyn_cast<ShuffleVectorSDNode>(Shuf->getOperand(0)); in combineShuffleOfSplatVal()
20952 return Shuf->getOperand(0); in combineShuffleOfSplatVal()
20961 Splat->getOperand(0), Splat->getOperand(1), in combineShuffleOfSplatVal()
20969 if (!OuterShuf->getOperand(1).isUndef()) in formSplatFromShuffles()
20971 auto *InnerShuf = dyn_cast<ShuffleVectorSDNode>(OuterShuf->getOperand(0)); in formSplatFromShuffles()
20972 if (!InnerShuf || !InnerShuf->getOperand(1).isUndef()) in formSplatFromShuffles()
21012 return DAG.getVectorShuffle(VT, SDLoc(OuterShuf), InnerShuf->getOperand(0), in formSplatFromShuffles()
21013 InnerShuf->getOperand(1), CombinedMask); in formSplatFromShuffles()
21050 SDValue Op0 = Shuf->getOperand(0); in replaceShuffleOfInsert()
21051 SDValue Op1 = Shuf->getOperand(1); in replaceShuffleOfInsert()
21074 auto *InsIndexC = dyn_cast<ConstantSDNode>(Op0.getOperand(2)); in replaceShuffleOfInsert()
21090 Op1, Op0.getOperand(1), NewInsIndex); in replaceShuffleOfInsert()
21099 auto *Shuf0 = dyn_cast<ShuffleVectorSDNode>(Shuf->getOperand(0)); in simplifyShuffleOfShuffle()
21100 if (!Shuf0 || !Shuf->getOperand(1).isUndef()) in simplifyShuffleOfShuffle()
21118 return Shuf->getOperand(0); in simplifyShuffleOfShuffle()
21125 SDValue N0 = N->getOperand(0); in visitVECTOR_SHUFFLE()
21126 SDValue N1 = N->getOperand(1); in visitVECTOR_SHUFFLE()
21185 SDValue L = N0.getOperand(0), R = N0.getOperand(1); in visitVECTOR_SHUFFLE()
21203 SDValue ConvInput = V->getOperand(0); in visitVECTOR_SHUFFLE()
21215 if (!V->getOperand(i).isUndef()) { in visitVECTOR_SHUFFLE()
21216 Base = V->getOperand(i); in visitVECTOR_SHUFFLE()
21224 if (V->getOperand(i) != Base) { in visitVECTOR_SHUFFLE()
21234 SDValue Splatted = V->getOperand(SplatIndex); in visitVECTOR_SHUFFLE()
21267 N0.getOperand(0).getValueType() == N1.getOperand(0).getValueType()))) { in visitVECTOR_SHUFFLE()
21277 N0.getOperand(0) == N0.getOperand(1)) { in visitVECTOR_SHUFFLE()
21289 SDValue UndefVec = DAG.getUNDEF(N0.getOperand(0).getValueType()); in visitVECTOR_SHUFFLE()
21291 N0.getOperand(0), UndefVec); in visitVECTOR_SHUFFLE()
21338 SDValue SV0 = BC0->getOperand(0); in visitVECTOR_SHUFFLE()
21339 SDValue SV1 = BC0->getOperand(1); in visitVECTOR_SHUFFLE()
21395 CurrentVec = (Idx < (int)NumElts) ? OtherSVN->getOperand(0) in visitVECTOR_SHUFFLE()
21396 : OtherSVN->getOperand(1); in visitVECTOR_SHUFFLE()
21435 ? CurrentSVN->getOperand(0) in visitVECTOR_SHUFFLE()
21436 : CurrentSVN->getOperand(1); in visitVECTOR_SHUFFLE()
21483 assert(N1->getOperand(0).getValueType() == VT && in visitVECTOR_SHUFFLE()
21486 SDValue SV0 = N1->getOperand(0); in visitVECTOR_SHUFFLE()
21487 SDValue SV1 = N1->getOperand(1); in visitVECTOR_SHUFFLE()
21512 if (N->getOperand(i).getOpcode() == ISD::VECTOR_SHUFFLE && in visitVECTOR_SHUFFLE()
21513 N->isOnlyUserOf(N->getOperand(i).getNode())) { in visitVECTOR_SHUFFLE()
21516 auto *OtherSV = cast<ShuffleVectorSDNode>(N->getOperand(i)); in visitVECTOR_SHUFFLE()
21517 assert(OtherSV->getOperand(0).getValueType() == VT && in visitVECTOR_SHUFFLE()
21522 if (MergeInnerShuffle(i != 0, SVN, OtherSV, N->getOperand(1 - i), TLI, in visitVECTOR_SHUFFLE()
21544 SDValue Op00 = N0.getOperand(0); in visitVECTOR_SHUFFLE()
21545 SDValue Op01 = N0.getOperand(1); in visitVECTOR_SHUFFLE()
21546 SDValue Op10 = N1.isUndef() ? N1 : N1.getOperand(0); in visitVECTOR_SHUFFLE()
21547 SDValue Op11 = N1.isUndef() ? N1 : N1.getOperand(1); in visitVECTOR_SHUFFLE()
21620 SDValue InVal = N->getOperand(0); in visitSCALAR_TO_VECTOR()
21627 InVal->getOperand(0).getValueType().isFixedLengthVector()) { in visitSCALAR_TO_VECTOR()
21628 SDValue InVec = InVal->getOperand(0); in visitSCALAR_TO_VECTOR()
21629 SDValue EltNo = InVal->getOperand(1); in visitSCALAR_TO_VECTOR()
21673 SDValue N0 = N->getOperand(0); in visitINSERT_SUBVECTOR()
21674 SDValue N1 = N->getOperand(1); in visitINSERT_SUBVECTOR()
21675 SDValue N2 = N->getOperand(2); in visitINSERT_SUBVECTOR()
21685 N1.getOperand(1) == N2 && N1.getOperand(0).getValueType() == VT) in visitINSERT_SUBVECTOR()
21686 return N1.getOperand(0); in visitINSERT_SUBVECTOR()
21693 N1.getOperand(0).getOpcode() == ISD::EXTRACT_SUBVECTOR && in visitINSERT_SUBVECTOR()
21694 N1.getOperand(0).getOperand(1) == N2 && in visitINSERT_SUBVECTOR()
21695 N1.getOperand(0).getOperand(0).getValueType().getVectorElementCount() == in visitINSERT_SUBVECTOR()
21697 N1.getOperand(0).getOperand(0).getValueType().getSizeInBits() == in visitINSERT_SUBVECTOR()
21699 return DAG.getBitcast(VT, N1.getOperand(0).getOperand(0)); in visitINSERT_SUBVECTOR()
21707 SDValue CN0 = N0.getOperand(0); in visitINSERT_SUBVECTOR()
21708 SDValue CN1 = N1.getOperand(0); in visitINSERT_SUBVECTOR()
21724 N0.getOperand(1).getValueType() == N1.getValueType() && in visitINSERT_SUBVECTOR()
21725 N0.getOperand(2) == N2) in visitINSERT_SUBVECTOR()
21726 return DAG.getNode(ISD::INSERT_SUBVECTOR, SDLoc(N), VT, N0.getOperand(0), in visitINSERT_SUBVECTOR()
21733 N1.getOperand(0).isUndef() && isNullConstant(N1.getOperand(2))) in visitINSERT_SUBVECTOR()
21735 N1.getOperand(1), N2); in visitINSERT_SUBVECTOR()
21779 N1.getValueType() == N0.getOperand(1).getValueType()) { in visitINSERT_SUBVECTOR()
21784 N0.getOperand(0), N1, N2); in visitINSERT_SUBVECTOR()
21787 VT, NewOp, N0.getOperand(1), N0.getOperand(2)); in visitINSERT_SUBVECTOR()
21794 N0.getOperand(0).getValueType() == N1.getValueType() && in visitINSERT_SUBVECTOR()
21795 N0.getOperand(0).getValueType().isScalableVector() == in visitINSERT_SUBVECTOR()
21811 SDValue N0 = N->getOperand(0); in visitFP_TO_FP16()
21815 return N0->getOperand(0); in visitFP_TO_FP16()
21821 SDValue N0 = N->getOperand(0); in visitFP16_TO_FP()
21825 ConstantSDNode *AndConst = getAsNonOpaqueConstant(N0.getOperand(1)); in visitFP16_TO_FP()
21828 N0.getOperand(0)); in visitFP16_TO_FP()
21836 SDValue N0 = N->getOperand(0); in visitVECREDUCE()
21873 SDValue LHS = N->getOperand(0); in XformToShuffleWithZero()
21874 SDValue RHS = peekThroughBitcasts(N->getOperand(1)); in XformToShuffleWithZero()
21899 SDValue Elt = RHS.getOperand(EltIdx); in XformToShuffleWithZero()
21957 SDValue N0 = N->getOperand(0); in scalarizeBinOpOfSplats()
21958 SDValue N1 = N->getOperand(1); in scalarizeBinOpOfSplats()
22005 SDValue LHS = N->getOperand(0); in SimplifyVBinOp()
22006 SDValue RHS = N->getOperand(1); in SimplifyVBinOp()
22030 LHS.getOperand(1).isUndef() && RHS.getOperand(1).isUndef() && in SimplifyVBinOp()
22033 SDValue NewBinOp = DAG.getNode(Opcode, DL, VT, LHS.getOperand(0), in SimplifyVBinOp()
22034 RHS.getOperand(0), Flags); in SimplifyVBinOp()
22035 SDValue UndefV = LHS.getOperand(1); in SimplifyVBinOp()
22046 Shuf0->hasOneUse() && Shuf0->getOperand(1).isUndef() && in SimplifyVBinOp()
22047 Shuf0->getOperand(0).getOpcode() != ISD::INSERT_VECTOR_ELT) { in SimplifyVBinOp()
22050 SDValue X = Shuf0->getOperand(0); in SimplifyVBinOp()
22056 Shuf1->hasOneUse() && Shuf1->getOperand(1).isUndef() && in SimplifyVBinOp()
22057 Shuf1->getOperand(0).getOpcode() != ISD::INSERT_VECTOR_ELT) { in SimplifyVBinOp()
22060 SDValue X = Shuf1->getOperand(0); in SimplifyVBinOp()
22071 if (LHS.getOpcode() == ISD::INSERT_SUBVECTOR && LHS.getOperand(0).isUndef() && in SimplifyVBinOp()
22072 RHS.getOpcode() == ISD::INSERT_SUBVECTOR && RHS.getOperand(0).isUndef() && in SimplifyVBinOp()
22073 LHS.getOperand(2) == RHS.getOperand(2) && in SimplifyVBinOp()
22075 SDValue X = LHS.getOperand(1); in SimplifyVBinOp()
22076 SDValue Y = RHS.getOperand(1); in SimplifyVBinOp()
22077 SDValue Z = LHS.getOperand(2); in SimplifyVBinOp()
22107 EVT NarrowVT = LHS.getOperand(0).getValueType(); in SimplifyVBinOp()
22108 if (NarrowVT == RHS.getOperand(0).getValueType() && in SimplifyVBinOp()
22115 ConcatOps.push_back(DAG.getNode(Opcode, DL, NarrowVT, LHS.getOperand(i), in SimplifyVBinOp()
22116 RHS.getOperand(i))); in SimplifyVBinOp()
22133 SDValue SCC = SimplifySelectCC(DL, N0.getOperand(0), N0.getOperand(1), N1, N2, in SimplifySelect()
22134 cast<CondCodeSDNode>(N0.getOperand(2))->get()); in SimplifySelect()
22146 SCC.getOperand(0), SCC.getOperand(1), in SimplifySelect()
22147 SCC.getOperand(4), Flags); in SimplifySelect()
22150 SCC.getOperand(2), SCC.getOperand(3)); in SimplifySelect()
22178 CC = cast<CondCodeSDNode>(TheSelect->getOperand(4))->get(); in SimplifySelectOps()
22179 CmpLHS = TheSelect->getOperand(0); in SimplifySelectOps()
22180 Zero = isConstOrConstSplatFP(TheSelect->getOperand(1)); in SimplifySelectOps()
22183 SDValue Cmp = TheSelect->getOperand(0); in SimplifySelectOps()
22185 CC = cast<CondCodeSDNode>(Cmp.getOperand(2))->get(); in SimplifySelectOps()
22186 CmpLHS = Cmp.getOperand(0); in SimplifySelectOps()
22187 Zero = isConstOrConstSplatFP(Cmp.getOperand(1)); in SimplifySelectOps()
22191 Sqrt.getOperand(0) == CmpLHS && (CC == ISD::SETOLT || in SimplifySelectOps()
22200 if (TheSelect->getOperand(0).getValueType().isVector()) return false; in SimplifySelectOps()
22217 if (LHS.getOperand(0) != RHS.getOperand(0) || in SimplifySelectOps()
22276 SDNode *CondNode = TheSelect->getOperand(0).getNode(); in SimplifySelectOps()
22287 TheSelect->getOperand(0), LLD->getBasePtr(), in SimplifySelectOps()
22296 SDNode *CondLHS = TheSelect->getOperand(0).getNode(); in SimplifySelectOps()
22297 SDNode *CondRHS = TheSelect->getOperand(1).getNode(); in SimplifySelectOps()
22309 TheSelect->getOperand(0), in SimplifySelectOps()
22310 TheSelect->getOperand(1), in SimplifySelectOps()
22312 TheSelect->getOperand(4)); in SimplifySelectOps()
22427 SDValue N0 = N->getOperand(0); in foldSelectOfBinops()
22428 SDValue N1 = N->getOperand(1); in foldSelectOfBinops()
22429 SDValue N2 = N->getOperand(2); in foldSelectOfBinops()
22442 if (N1.getOperand(1) == N2.getOperand(1)) { in foldSelectOfBinops()
22444 DAG.getSelect(DL, VT, N0, N1.getOperand(0), N2.getOperand(0)); in foldSelectOfBinops()
22445 SDValue NewBinOp = DAG.getNode(BinOpc, DL, VT, NewSel, N1.getOperand(1)); in foldSelectOfBinops()
22454 if (N1.getOperand(0) == N2.getOperand(0) && in foldSelectOfBinops()
22455 VT == N1.getOperand(1).getValueType() && in foldSelectOfBinops()
22456 VT == N2.getOperand(1).getValueType()) { in foldSelectOfBinops()
22458 DAG.getSelect(DL, VT, N0, N1.getOperand(1), N2.getOperand(1)); in foldSelectOfBinops()
22459 SDValue NewBinOp = DAG.getNode(BinOpc, DL, VT, N1.getOperand(0), NewSel); in foldSelectOfBinops()
22471 SDValue N0 = N->getOperand(0); in foldSignChangeInBitcast()
22479 SDValue Int = N0.getOperand(0); in foldSignChangeInBitcast()
22606 SDValue AndLHS = N0->getOperand(0); in SimplifySelectCC()
22607 auto *ConstAndRHS = dyn_cast<ConstantSDNode>(N0->getOperand(1)); in SimplifySelectCC()
22699 N0 == Count.getOperand(0) && in SimplifySelectCC()
22706 N0 == Count.getOperand(0) && in SimplifySelectCC()
22748 ConstantSDNode *C = isConstOrConstSplat(N->getOperand(1)); in BuildSDIVPow2()
23028 return {false /*isVolatile*/, /*isAtomic*/ false, LN->getOperand(1), in isAlias()
23162 C = C.getOperand(0); in GatherAllAliases()
23171 C = C.getOperand(0); in GatherAllAliases()
23180 C = C.getOperand(0); in GatherAllAliases()
23222 Chains.push_back(Chain.getOperand(--n)); in GatherAllAliases()
23365 S, BetterChain, S->getOperand(1), S->getOperand(2), S->getOperand(3))); in parallelizeChainedStores()
23387 return ST->getOperand(0) != NewChain; in parallelizeChainedStores()