[llvm] [NVPTX] add combiner rule for final packed op in reduction (PR #143943)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 13 18:10:20 PDT 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 HEAD~1 HEAD --extensions cpp -- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 075bfcc81..edbee99ab 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -1357,8 +1357,8 @@ SDValue DAGCombiner::foldReductionWithUndefLane(SDNode *N) {
   const EVT VectorVT = N->getValueType(0);
 
   // Only support 2-packed vectors for now.
-  if (!VectorVT.isVector() || VectorVT.isScalableVector()
-        || VectorVT.getVectorNumElements() != 2)
+  if (!VectorVT.isVector() || VectorVT.isScalableVector() ||
+      VectorVT.getVectorNumElements() != 2)
     return SDValue();
 
   // If the operation is already unsupported, we don't need to do this
@@ -1369,7 +1369,7 @@ SDValue DAGCombiner::foldReductionWithUndefLane(SDNode *N) {
   // If vector shuffle is supported on the target, this optimization may
   // increase register pressure.
   if (TLI.isOperationLegalOrCustomOrPromote(ISD::VECTOR_SHUFFLE, VectorVT))
-      return SDValue();
+    return SDValue();
 
   SDLoc DL(N);
 

``````````

</details>


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


More information about the llvm-commits mailing list