Skip to content

Commit ba8792b

Browse files
committed
[X86] visitFCOPYSIGN - pull out repeated SDLoc. NFC.
1 parent 77e3100 commit ba8792b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17492,10 +17492,10 @@ SDValue DAGCombiner::visitFCOPYSIGN(SDNode *N) {
1749217492
SDValue N0 = N->getOperand(0);
1749317493
SDValue N1 = N->getOperand(1);
1749417494
EVT VT = N->getValueType(0);
17495+
SDLoc DL(N);
1749517496

1749617497
// fold (fcopysign c1, c2) -> fcopysign(c1,c2)
17497-
if (SDValue C =
17498-
DAG.FoldConstantArithmetic(ISD::FCOPYSIGN, SDLoc(N), VT, {N0, N1}))
17498+
if (SDValue C = DAG.FoldConstantArithmetic(ISD::FCOPYSIGN, DL, VT, {N0, N1}))
1749917499
return C;
1750017500

1750117501
if (ConstantFPSDNode *N1C = isConstOrConstSplatFP(N->getOperand(1))) {
@@ -17504,10 +17504,10 @@ SDValue DAGCombiner::visitFCOPYSIGN(SDNode *N) {
1750417504
// copysign(x, c1) -> fneg(fabs(x)) iff isneg(c1)
1750517505
if (!V.isNegative()) {
1750617506
if (!LegalOperations || TLI.isOperationLegal(ISD::FABS, VT))
17507-
return DAG.getNode(ISD::FABS, SDLoc(N), VT, N0);
17507+
return DAG.getNode(ISD::FABS, DL, VT, N0);
1750817508
} else {
1750917509
if (!LegalOperations || TLI.isOperationLegal(ISD::FNEG, VT))
17510-
return DAG.getNode(ISD::FNEG, SDLoc(N), VT,
17510+
return DAG.getNode(ISD::FNEG, DL, VT,
1751117511
DAG.getNode(ISD::FABS, SDLoc(N0), VT, N0));
1751217512
}
1751317513
}
@@ -17517,20 +17517,20 @@ SDValue DAGCombiner::visitFCOPYSIGN(SDNode *N) {
1751717517
// copysign(copysign(x,z), y) -> copysign(x, y)
1751817518
if (N0.getOpcode() == ISD::FABS || N0.getOpcode() == ISD::FNEG ||
1751917519
N0.getOpcode() == ISD::FCOPYSIGN)
17520-
return DAG.getNode(ISD::FCOPYSIGN, SDLoc(N), VT, N0.getOperand(0), N1);
17520+
return DAG.getNode(ISD::FCOPYSIGN, DL, VT, N0.getOperand(0), N1);
1752117521

1752217522
// copysign(x, abs(y)) -> abs(x)
1752317523
if (N1.getOpcode() == ISD::FABS)
17524-
return DAG.getNode(ISD::FABS, SDLoc(N), VT, N0);
17524+
return DAG.getNode(ISD::FABS, DL, VT, N0);
1752517525

1752617526
// copysign(x, copysign(y,z)) -> copysign(x, z)
1752717527
if (N1.getOpcode() == ISD::FCOPYSIGN)
17528-
return DAG.getNode(ISD::FCOPYSIGN, SDLoc(N), VT, N0, N1.getOperand(1));
17528+
return DAG.getNode(ISD::FCOPYSIGN, DL, VT, N0, N1.getOperand(1));
1752917529

1753017530
// copysign(x, fp_extend(y)) -> copysign(x, y)
1753117531
// copysign(x, fp_round(y)) -> copysign(x, y)
1753217532
if (CanCombineFCOPYSIGN_EXTEND_ROUND(N))
17533-
return DAG.getNode(ISD::FCOPYSIGN, SDLoc(N), VT, N0, N1.getOperand(0));
17533+
return DAG.getNode(ISD::FCOPYSIGN, DL, VT, N0, N1.getOperand(0));
1753417534

1753517535
// We only take the sign bit from the sign operand.
1753617536
EVT SignVT = N1.getValueType();

0 commit comments

Comments
 (0)