[libcxx-commits] [libcxx] [libc++] Run vector instructions during constant evaluation when Clang supports it (PR #160057)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Sep 22 02:58:34 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 h -- libcxx/include/__algorithm/mismatch.h libcxx/include/__algorithm/simd_utils.h
``````````

: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/libcxx/include/__algorithm/simd_utils.h b/libcxx/include/__algorithm/simd_utils.h
index 65317fe35..98de7a750 100644
--- a/libcxx/include/__algorithm/simd_utils.h
+++ b/libcxx/include/__algorithm/simd_utils.h
@@ -130,11 +130,11 @@ template <class _Tp, size_t _Np>
   using __mask_vec = __simd_vector<bool, _Np>;
 
 #  if _LIBCPP_HAS_CONSTEXPR_VECTORS
-#if defined(_LIBCPP_BIG_ENDIAN)
+#    if defined(_LIBCPP_BIG_ENDIAN)
   return __builtin_clzg(__builtin_convertvector(__vec, __mask_vec), static_cast<int>(_Np));
-#else
+#    else
   return __builtin_ctzg(__builtin_convertvector(__vec, __mask_vec), static_cast<int>(_Np));
-#endif
+#    endif
 #  else
 
   // This has MSan disabled du to https://llvm.org/PR85876

``````````

</details>


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


More information about the libcxx-commits mailing list