@@ -2474,35 +2474,6 @@ SDValue SelectionDAG::getShiftAmountOperand(EVT LHSTy, SDValue Op) {
24742474 return getZExtOrTrunc(Op, SDLoc(Op), ShTy);
24752475}
24762476
2477- SDValue SelectionDAG::getPartialReduceAdd(SDLoc DL, EVT ReducedTy, SDValue Op1,
2478- SDValue Op2) {
2479- EVT FullTy = Op2.getValueType();
2480-
2481- unsigned Stride = ReducedTy.getVectorMinNumElements();
2482- unsigned ScaleFactor = FullTy.getVectorMinNumElements() / Stride;
2483-
2484- // Collect all of the subvectors
2485- std::deque<SDValue> Subvectors = {Op1};
2486- for (unsigned I = 0; I < ScaleFactor; I++) {
2487- auto SourceIndex = getVectorIdxConstant(I * Stride, DL);
2488- Subvectors.push_back(
2489- getNode(ISD::EXTRACT_SUBVECTOR, DL, ReducedTy, {Op2, SourceIndex}));
2490- }
2491-
2492- // Flatten the subvector tree
2493- while (Subvectors.size() > 1) {
2494- Subvectors.push_back(
2495- getNode(ISD::ADD, DL, ReducedTy, {Subvectors[0], Subvectors[1]}));
2496- Subvectors.pop_front();
2497- Subvectors.pop_front();
2498- }
2499-
2500- assert(Subvectors.size() == 1 &&
2501- "There should only be one subvector after tree flattening");
2502-
2503- return Subvectors[0];
2504- }
2505-
25062477/// Given a store node \p StoreNode, return true if it is safe to fold that node
25072478/// into \p FPNode, which expands to a library call with output pointers.
25082479static bool canFoldStoreIntoLibCallOutputPointers(StoreSDNode *StoreNode,
@@ -7883,6 +7854,28 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
78837854
78847855 break;
78857856 }
7857+ case ISD::PARTIAL_REDUCE_UMLA:
7858+ case ISD::PARTIAL_REDUCE_SMLA: {
7859+ [[maybe_unused]] EVT AccVT = N1.getValueType();
7860+ [[maybe_unused]] EVT Input1VT = N2.getValueType();
7861+ [[maybe_unused]] EVT Input2VT = N3.getValueType();
7862+ assert(Input1VT.isVector() && Input1VT == Input2VT &&
7863+ "Expected the second and third operands of the PARTIAL_REDUCE_MLA "
7864+ "node to have the same type!");
7865+ assert(VT.isVector() && VT == AccVT &&
7866+ "Expected the first operand of the PARTIAL_REDUCE_MLA node to have "
7867+ "the same type as its result!");
7868+ assert(Input1VT.getVectorElementCount().hasKnownScalarFactor(
7869+ AccVT.getVectorElementCount()) &&
7870+ "Expected the element count of the second and third operands of the "
7871+ "PARTIAL_REDUCE_MLA node to be a positive integer multiple of the "
7872+ "element count of the first operand and the result!");
7873+ assert(N2.getScalarValueSizeInBits() <= N1.getScalarValueSizeInBits() &&
7874+ "Expected the second and third operands of the PARTIAL_REDUCE_MLA "
7875+ "node to have an element type which is the same as or smaller than "
7876+ "the element type of the first operand and result!");
7877+ break;
7878+ }
78867879 }
78877880
78887881 // Memoize node if it doesn't produce a glue result.
0 commit comments