[clang] [WIP][Clang][bytecode] interp__builtin_elementwise_int_binop - allow RHS operand to be a scalar (PR #156017)

via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 29 05:34:51 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 origin/main HEAD --extensions cpp,c -- clang/lib/AST/ByteCode/InterpBuiltin.cpp clang/lib/AST/ExprConstant.cpp clang/test/CodeGen/X86/avx512vl-builtins.c clang/test/CodeGen/X86/xop-builtins.c
``````````

: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/clang/lib/AST/ByteCode/InterpBuiltin.cpp b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
index c4f4e1c2d..890ac19a7 100644
--- a/clang/lib/AST/ByteCode/InterpBuiltin.cpp
+++ b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
@@ -2579,11 +2579,9 @@ static bool interp__builtin_elementwise_int_binop(
     const Pointer &LHS = S.Stk.pop<Pointer>();
     const Pointer &Dst = S.Stk.peek<Pointer>();
 
-  for (unsigned I = 0; I != NumElems; ++I) {
+    for (unsigned I = 0; I != NumElems; ++I) {
       APSInt Elem1;
-      INT_TYPE_SWITCH_NO_BOOL(ElemT, {
-        Elem1 = LHS.elem<T>(I).toAPSInt();
-      });
+      INT_TYPE_SWITCH_NO_BOOL(ElemT, { Elem1 = LHS.elem<T>(I).toAPSInt(); });
 
       APSInt Result =
           APSInt(Fn(Elem1, RHS),

``````````

</details>


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


More information about the cfe-commits mailing list