[llvm] 54f09be - [X86] LowerABS - use DAG::getNegative() helper. NFC.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 29 09:52:35 PDT 2024
Author: Simon Pilgrim
Date: 2024-04-29T17:44:38+01:00
New Revision: 54f09be90f5e8bcb9c25b1827d11ed0ac7f3b887
URL: https://github.com/llvm/llvm-project/commit/54f09be90f5e8bcb9c25b1827d11ed0ac7f3b887
DIFF: https://github.com/llvm/llvm-project/commit/54f09be90f5e8bcb9c25b1827d11ed0ac7f3b887.diff
LOG: [X86] LowerABS - use DAG::getNegative() helper. NFC.
Added:
Modified:
llvm/lib/Target/X86/X86ISelLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index ea876307f2aef3..00cecc2b573f01 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -28151,9 +28151,8 @@ static SDValue LowerABS(SDValue Op, const X86Subtarget &Subtarget,
// ABS(vXi64 X) --> VPBLENDVPD(X, 0-X, X).
if ((VT == MVT::v2i64 || VT == MVT::v4i64) && Subtarget.hasSSE41()) {
SDValue Src = Op.getOperand(0);
- SDValue Sub =
- DAG.getNode(ISD::SUB, DL, VT, DAG.getConstant(0, DL, VT), Src);
- return DAG.getNode(X86ISD::BLENDV, DL, VT, Src, Sub, Src);
+ SDValue Neg = DAG.getNegative(Src, DL, VT);
+ return DAG.getNode(X86ISD::BLENDV, DL, VT, Src, Neg, Src);
}
if (VT.is256BitVector() && !Subtarget.hasInt256()) {
More information about the llvm-commits
mailing list