@@ -937,8 +937,11 @@ void VectorLegalizer::Expand(SDNode *Node, SmallVectorImpl<SDValue> &Results) {
937937 ExpandUINT_TO_FLOAT (Node, Results);
938938 return ;
939939 case ISD::FNEG:
940- Results.push_back (ExpandFNEG (Node));
941- return ;
940+ if (SDValue Expanded = ExpandFNEG (Node)) {
941+ Results.push_back (Expanded);
942+ return ;
943+ }
944+ break ;
942945 case ISD::FSUB:
943946 ExpandFSUB (Node, Results);
944947 return ;
@@ -1777,16 +1780,16 @@ SDValue VectorLegalizer::ExpandFNEG(SDNode *Node) {
17771780 EVT IntVT = VT.changeVectorElementTypeToInteger ();
17781781
17791782 // FIXME: The FSUB check is here to force unrolling v1f64 vectors on AArch64.
1780- if (TLI.isOperationLegalOrCustom (ISD::XOR, IntVT) &&
1781- TLI.isOperationLegalOrCustom (ISD::FSUB, VT)) {
1782- SDLoc DL (Node );
1783- SDValue Cast = DAG. getNode (ISD::BITCAST, DL, IntVT, Node-> getOperand ( 0 ));
1784- SDValue SignMask = DAG. getConstant (
1785- APInt::getSignMask (IntVT. getScalarSizeInBits ()) , DL, IntVT);
1786- SDValue Xor = DAG.getNode (ISD::XOR, DL, IntVT, Cast, SignMask);
1787- return DAG. getNode (ISD::BITCAST , DL, VT, Xor );
1788- }
1789- return DAG.UnrollVectorOp (Node );
1783+ if (! TLI.isOperationLegalOrCustom (ISD::XOR, IntVT) ||
1784+ ! TLI.isOperationLegalOrCustom (ISD::FSUB, VT))
1785+ return SDValue ( );
1786+
1787+ SDLoc DL (Node);
1788+ SDValue Cast = DAG. getNode (ISD::BITCAST , DL, IntVT, Node-> getOperand ( 0 ) );
1789+ SDValue SignMask = DAG.getConstant (
1790+ APInt::getSignMask (IntVT. getScalarSizeInBits ()) , DL, IntVT );
1791+ SDValue Xor = DAG. getNode (ISD::XOR, DL, IntVT, Cast, SignMask);
1792+ return DAG.getNode (ISD::BITCAST, DL, VT, Xor );
17901793}
17911794
17921795void VectorLegalizer::ExpandFSUB (SDNode *Node,
0 commit comments