[llvm] [AArch64] Prefer SVE2 for fixed-length i64 [S|U][MIN|MAX] reductions (PR #181161)

via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 17 03:29:34 PST 2026


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 origin/main HEAD --extensions cpp -- llvm/lib/Target/AArch64/AArch64ISelLowering.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</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 79ed46739..2abc7007f 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -17360,15 +17360,16 @@ SDValue AArch64TargetLowering::LowerVECREDUCE(SDValue Op,
                       (Op.getOpcode() != ISD::VECREDUCE_ADD &&
                        SrcVT.getVectorElementType() == MVT::i64);
 
-  bool UsesSVEForFixedLengthVT =  useSVEForFixedLengthVectorVT(
-          SrcVT, OverrideNEON && Subtarget->useSVEForFixedLengthVectors());
+  bool UsesSVEForFixedLengthVT = useSVEForFixedLengthVectorVT(
+      SrcVT, OverrideNEON && Subtarget->useSVEForFixedLengthVectors());
 
   // Always lower try to lower v2i64 pairwise operations (as NEON does not
   // natively support reductions on these types). Try lowering any v2<ty> vector
   // to pairwise operations when using SVE for fixed-length VTs, as the pairwise
   // operations are likely to be cheaper than a full reduction.
   bool TryPairwiseOps = SrcVT == MVT::v2i64 || (UsesSVEForFixedLengthVT &&
-    SrcVT.getVectorElementCount() ==  ElementCount::getFixed(2));
+                                                SrcVT.getVectorElementCount() ==
+                                                    ElementCount::getFixed(2));
 
   // Attempt to lower v2<ty> reductions to SVE2 pairwise operations.
   auto PairwiseIID = getPairwiseOpForReduction(Op->getOpcode());

``````````

</details>


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


More information about the llvm-commits mailing list