[llvm] [AArch64] Use getNegative instead of manually sub with 0 (NFC) (PR #158511)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 14 13:50:04 PDT 2025
https://github.com/AZero13 created https://github.com/llvm/llvm-project/pull/158511
None
>From 77d56621af9cce83f633c54ed6915b3949ebfefb Mon Sep 17 00:00:00 2001
From: AZero13 <gfunni234 at gmail.com>
Date: Sun, 14 Sep 2025 16:49:23 -0400
Subject: [PATCH] [AArch64] Use getNegative instead of manually sub with 0
(NFC)
---
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index d7c90bcb9723d..fc683afa2364a 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -7312,8 +7312,8 @@ SDValue AArch64TargetLowering::LowerABS(SDValue Op, SelectionDAG &DAG) const {
return LowerToPredicatedOp(Op, DAG, AArch64ISD::ABS_MERGE_PASSTHRU);
SDLoc DL(Op);
- SDValue Neg = DAG.getNode(ISD::SUB, DL, VT, DAG.getConstant(0, DL, VT),
- Op.getOperand(0));
+ SDValue Neg = DAG.getNegative(Op.getOperand(0), DL, VT);
+
// Generate SUBS & CSEL.
SDValue Cmp = DAG.getNode(AArch64ISD::SUBS, DL, DAG.getVTList(VT, FlagsVT),
Op.getOperand(0), DAG.getConstant(0, DL, VT));
More information about the llvm-commits
mailing list