@@ -185,7 +185,7 @@ class SelectionDAGLegalize {
185
185
// / All vector operands are promoted to a vector type with larger element
186
186
// / type, and the start value is promoted to a larger scalar type. Then the
187
187
// / result is truncated back to the original scalar type.
188
- void PromoteReduction (SDNode *Node, SmallVectorImpl<SDValue> &Results );
188
+ SDValue PromoteReduction (SDNode *Node);
189
189
190
190
SDValue ExpandPARITY (SDValue Op, const SDLoc &dl);
191
191
@@ -2991,8 +2991,7 @@ SDValue SelectionDAGLegalize::ExpandPARITY(SDValue Op, const SDLoc &dl) {
2991
2991
return DAG.getNode (ISD::AND, dl, VT, Result, DAG.getConstant (1 , dl, VT));
2992
2992
}
2993
2993
2994
- void SelectionDAGLegalize::PromoteReduction (SDNode *Node,
2995
- SmallVectorImpl<SDValue> &Results) {
2994
+ SDValue SelectionDAGLegalize::PromoteReduction (SDNode *Node) {
2996
2995
MVT VecVT = Node->getOperand (1 ).getSimpleValueType ();
2997
2996
MVT NewVecVT = TLI.getTypeToPromoteTo (Node->getOpcode (), VecVT);
2998
2997
MVT ScalarVT = Node->getSimpleValueType (0 );
@@ -3026,10 +3025,8 @@ void SelectionDAGLegalize::PromoteReduction(SDNode *Node,
3026
3025
Node->getFlags ());
3027
3026
3028
3027
assert (ScalarVT.isFloatingPoint () && " Only FP promotion is supported" );
3029
- Res = DAG.getNode (ISD::FP_ROUND, DL, ScalarVT, Res,
3030
- DAG.getIntPtrConstant (0 , DL, /* isTarget=*/ true ));
3031
-
3032
- Results.push_back (Res);
3028
+ return DAG.getNode (ISD::FP_ROUND, DL, ScalarVT, Res,
3029
+ DAG.getIntPtrConstant (0 , DL, /* isTarget=*/ true ));
3033
3030
}
3034
3031
3035
3032
bool SelectionDAGLegalize::ExpandNode (SDNode *Node) {
@@ -5680,7 +5677,7 @@ void SelectionDAGLegalize::PromoteNode(SDNode *Node) {
5680
5677
case ISD::VP_REDUCE_FMAX:
5681
5678
case ISD::VP_REDUCE_FMIN:
5682
5679
case ISD::VP_REDUCE_SEQ_FADD:
5683
- PromoteReduction (Node, Results );
5680
+ Results. push_back ( PromoteReduction (Node) );
5684
5681
break ;
5685
5682
}
5686
5683
0 commit comments