[clang] [Clang] VectorExprEvaluator::VisitCallExpr / InterpretBuiltin - Allow shufps/pd shuffles intrinsics to be used in constexpr (PR #164078)

via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 21 10:49:35 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 c,cpp -- clang/lib/AST/ByteCode/InterpBuiltin.cpp clang/lib/AST/ExprConstant.cpp clang/test/CodeGen/X86/avx-builtins.c clang/test/CodeGen/X86/avx512f-builtins.c clang/test/CodeGen/X86/avx512vl-builtins.c clang/test/CodeGen/X86/sse-builtins.c clang/test/CodeGen/X86/sse2-builtins.c --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/clang/lib/AST/ByteCode/InterpBuiltin.cpp b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
index a9ebfed45..d5a03339f 100644
--- a/clang/lib/AST/ByteCode/InterpBuiltin.cpp
+++ b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
@@ -3309,18 +3309,16 @@ static bool interp__builtin_ia32_shuf(InterpState &S, CodePtr OpPC,
 
     for (unsigned i = 0; i != NumSelectableElems; ++i) {
       unsigned Index = (ShuffleMask >> BitIndex) & IndexMask;
-      TYPE_SWITCH(ElemT, {
-        Dst.elem<T>(DstIdx) = A.elem<T>(LaneOffset + Index);
-      });
+      TYPE_SWITCH(ElemT,
+                  { Dst.elem<T>(DstIdx) = A.elem<T>(LaneOffset + Index); });
       DstIdx++;
       BitIndex = (BitIndex + BitsPerElem) % MaskBits;
     }
 
     for (unsigned i = 0; i != NumSelectableElems; ++i) {
       unsigned Index = (ShuffleMask >> BitIndex) & IndexMask;
-      TYPE_SWITCH(ElemT, {
-        Dst.elem<T>(DstIdx) = B.elem<T>(LaneOffset + Index);
-      });
+      TYPE_SWITCH(ElemT,
+                  { Dst.elem<T>(DstIdx) = B.elem<T>(LaneOffset + Index); });
       DstIdx++;
       BitIndex = (BitIndex + BitsPerElem) % MaskBits;
     }

``````````

</details>


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


More information about the cfe-commits mailing list