[llvm] [WASM] Constant fold SIMD wasm intrinsics: any/alltrue (PR #148074)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 10 18:17:22 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/Analysis/ConstantFolding.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index f0c3fdaa4..9c1c2c6e6 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -2867,12 +2867,11 @@ static Constant *ConstantFoldScalarCall1(StringRef Name,
     case Intrinsic::wasm_alltrue:
       // Check each element individually
       unsigned E = cast<FixedVectorType>(Op->getType())->getNumElements();
-      for (unsigned I = 0; I != E; ++I) 
-        if (Constant *Elt = Op->getAggregateElement(I)) 
+      for (unsigned I = 0; I != E; ++I)
+        if (Constant *Elt = Op->getAggregateElement(I))
           if (Elt->isZeroValue())
             return ConstantInt::get(Ty, 0);
-        
-      
+
       return ConstantInt::get(Ty, 1);
     }
   }

``````````

</details>


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


More information about the llvm-commits mailing list