[llvm] [AArch664] Replace uaddlv with addv for popcount operation (PR #121934)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 8 08:11:58 PST 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 93220e7e06473a11bf48fee26bcea16cc527e5dc 2d9f5a39d13e0c418c8a54986b92ce01473a0002 --extensions cpp -- llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index 0db8a06d90..4b762d8a85 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -10713,8 +10713,7 @@ SDValue AArch64TargetLowering::LowerCTPOP_PARITY(SDValue Op,
                          DAG.getConstant(0, DL, MVT::i64));
     AddV = DAG.getNode(ISD::BITCAST, DL, VT, AddV);
     if (IsParity)
-      AddV = DAG.getNode(ISD::AND, DL, VT, AddV,
-                         DAG.getConstant(1, DL, VT));
+      AddV = DAG.getNode(ISD::AND, DL, VT, AddV, DAG.getConstant(1, DL, VT));
     return AddV;
   } else if (VT == MVT::i128) {
     Val = DAG.getNode(ISD::BITCAST, DL, MVT::v16i8, Val);
@@ -10723,8 +10722,7 @@ SDValue AArch64TargetLowering::LowerCTPOP_PARITY(SDValue Op,
     SDValue AddV = DAG.getNode(AArch64ISD::UADDV, DL, MVT::v16i8, CtPop);
     AddV = DAG.getNode(ISD::BITCAST, DL, VT, AddV);
     if (IsParity)
-      AddV = DAG.getNode(ISD::AND, DL, VT, AddV,
-                         DAG.getConstant(1, DL, VT));
+      AddV = DAG.getNode(ISD::AND, DL, VT, AddV, DAG.getConstant(1, DL, VT));
     return AddV;
   }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/121934


More information about the llvm-commits mailing list