[libcxx-commits] [libcxx] 66558d7 - [libc++] Fix <__algorithm/find.h> when using -flax-vector-conversions=none (#161362)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Oct 2 01:05:31 PDT 2025


Author: Nikolas Klauser
Date: 2025-10-02T10:05:26+02:00
New Revision: 66558d70dc11fd04ce908ac94424ed7c6bd9e35b

URL: https://github.com/llvm/llvm-project/commit/66558d70dc11fd04ce908ac94424ed7c6bd9e35b
DIFF: https://github.com/llvm/llvm-project/commit/66558d70dc11fd04ce908ac94424ed7c6bd9e35b.diff

LOG: [libc++] Fix <__algorithm/find.h> when using -flax-vector-conversions=none (#161362)

Added: 
    

Modified: 
    libcxx/include/__algorithm/find.h
    libcxx/test/std/experimental/simd/simd.class/simd_unary.pass.cpp
    libcxx/utils/libcxx/test/params.py

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__algorithm/find.h b/libcxx/include/__algorithm/find.h
index 5f32ae8fc9524..72e201a3c693b 100644
--- a/libcxx/include/__algorithm/find.h
+++ b/libcxx/include/__algorithm/find.h
@@ -69,7 +69,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __find_vectorized(_Tp* __first, _Tp* __last,
 
     auto __orig_first = __first;
 
-    auto __values = static_cast<__simd_vector<_Up, __vec_size>>(__value); // broadcast the value
+    auto __values = static_cast<__simd_vector<_Tp, __vec_size>>(__value); // broadcast the value
     while (static_cast<size_t>(__last - __first) >= __unroll_count * __vec_size) [[__unlikely__]] {
       __vec __lhs[__unroll_count];
 

diff  --git a/libcxx/test/std/experimental/simd/simd.class/simd_unary.pass.cpp b/libcxx/test/std/experimental/simd/simd.class/simd_unary.pass.cpp
index 056d6f65fc368..2c3751a97cf4e 100644
--- a/libcxx/test/std/experimental/simd/simd.class/simd_unary.pass.cpp
+++ b/libcxx/test/std/experimental/simd/simd.class/simd_unary.pass.cpp
@@ -12,6 +12,9 @@
 //   Assertion failed: N->getValueType(0) == MVT::v1i1 && "Expected v1i1 type"
 // XFAIL: target=armv7-unknown-linux-gnueabihf
 
+// FIXME: This should work with -flax-vector-conversions=none
+// ADDITIONAL_COMPILE_FLAGS(clang): -flax-vector-conversions=integer
+
 // <experimental/simd>
 //
 // [simd.class]

diff  --git a/libcxx/utils/libcxx/test/params.py b/libcxx/utils/libcxx/test/params.py
index 6f013a75195a8..c02d6df1c47a4 100644
--- a/libcxx/utils/libcxx/test/params.py
+++ b/libcxx/utils/libcxx/test/params.py
@@ -75,6 +75,9 @@
 
     # We're not annotating all the APIs, since that's a lot of annotations compared to how many we actually care about
     "-Wno-nullability-completeness",
+
+    # Technically not a warning flag, but might as well be:
+    "-flax-vector-conversions=none",
 ]
 
 _allStandards = ["c++03", "c++11", "c++14", "c++17", "c++20", "c++23", "c++26"]


        


More information about the libcxx-commits mailing list