[clang] [clang] Enable constexpr handling for __builtin_elementwise_fma (PR #152919)

via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 10 07:29:02 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 -- clang/lib/AST/ByteCode/InterpBuiltin.cpp clang/lib/AST/ExprConstant.cpp clang/test/Sema/constant-builtins-vector.cpp
``````````

</details>

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

``````````diff
diff --git a/clang/lib/AST/ByteCode/InterpBuiltin.cpp b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
index 00f634614..00ef10545 100644
--- a/clang/lib/AST/ByteCode/InterpBuiltin.cpp
+++ b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
@@ -2363,8 +2363,7 @@ static bool interp__builtin_elementwise_fma(InterpState &S, CodePtr OpPC,
   }
 
   // Vector type.
-  assert(Arg1Type->isVectorType() &&
-         Arg2Type->isVectorType() &&
+  assert(Arg1Type->isVectorType() && Arg2Type->isVectorType() &&
          Arg3Type->isVectorType());
 
   const VectorType *VecT = Arg1Type->castAs<VectorType>();
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index 79bb9daf7..a33a66f48 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -15937,9 +15937,8 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) {
   }
 
   case Builtin::BI__builtin_elementwise_fma: {
-    if(!E->getArg(0)->isPRValue() ||
-       !E->getArg(1)->isPRValue() ||
-       !E->getArg(2)->isPRValue()) {
+    if (!E->getArg(0)->isPRValue() || !E->getArg(1)->isPRValue() ||
+        !E->getArg(2)->isPRValue()) {
       return false;
     }
     APFloat SourceY(0.), SourceZ(0.);

``````````

</details>


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


More information about the cfe-commits mailing list