Skip to content

Commit 3ad40d1

Browse files
authored
[AArch64] Use getNegative instead of manually sub with 0 (NFC) (#158511)
1 parent 53a18eb commit 3ad40d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7371,8 +7371,8 @@ SDValue AArch64TargetLowering::LowerABS(SDValue Op, SelectionDAG &DAG) const {
73717371
return LowerToPredicatedOp(Op, DAG, AArch64ISD::ABS_MERGE_PASSTHRU);
73727372

73737373
SDLoc DL(Op);
7374-
SDValue Neg = DAG.getNode(ISD::SUB, DL, VT, DAG.getConstant(0, DL, VT),
7375-
Op.getOperand(0));
7374+
SDValue Neg = DAG.getNegative(Op.getOperand(0), DL, VT);
7375+
73767376
// Generate SUBS & CSEL.
73777377
SDValue Cmp = DAG.getNode(AArch64ISD::SUBS, DL, DAG.getVTList(VT, FlagsVT),
73787378
Op.getOperand(0), DAG.getConstant(0, DL, VT));

0 commit comments

Comments
 (0)