[libcxx-commits] [libcxx] 15941dd - [libc++][PSTL] Add vectorization annotations when clang is used

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 31 18:52:09 PDT 2023


Author: Nikolas Klauser
Date: 2023-07-31T18:52:03-07:00
New Revision: 15941dd6296c6b6ac83c3cf1309896a511d0e35d

URL: https://github.com/llvm/llvm-project/commit/15941dd6296c6b6ac83c3cf1309896a511d0e35d
DIFF: https://github.com/llvm/llvm-project/commit/15941dd6296c6b6ac83c3cf1309896a511d0e35d.diff

LOG: [libc++][PSTL] Add vectorization annotations when clang is used

Reviewed By: #libc, ldionne

Spies: wangpc, libcxx-commits

Differential Revision: https://reviews.llvm.org/D155512

Added: 
    

Modified: 
    libcxx/include/__config

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__config b/libcxx/include/__config
index a5670d0848fef8..43a5c055166baa 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -1453,6 +1453,16 @@ __sanitizer_verify_double_ended_contiguous_container(const void*, const void*, c
 #    define _PSTL_PRAGMA_DECLARE_REDUCTION(NAME, OP)                                                                   \
       _PSTL_PRAGMA(omp declare reduction(NAME:OP : omp_out(omp_in)) initializer(omp_priv = omp_orig))
 
+#  elif defined(_LIBCPP_COMPILER_CLANG_BASED)
+
+#    define _PSTL_PRAGMA_SIMD _Pragma("clang loop vectorize(enable) interleave(enable)")
+#    define _PSTL_PRAGMA_DECLARE_SIMD
+#    define _PSTL_PRAGMA_SIMD_REDUCTION(PRM) _Pragma("clang loop vectorize(enable) interleave(enable)")
+#    define _PSTL_PRAGMA_SIMD_SCAN(PRM) _Pragma("clang loop vectorize(enable) interleave(enable)")
+#    define _PSTL_PRAGMA_SIMD_INCLUSIVE_SCAN(PRM)
+#    define _PSTL_PRAGMA_SIMD_EXCLUSIVE_SCAN(PRM)
+#    define _PSTL_PRAGMA_DECLARE_REDUCTION(NAME, OP)
+
 #  else // (defined(_OPENMP) && _OPENMP >= 201307)
 
 #    define _PSTL_PRAGMA_SIMD


        


More information about the libcxx-commits mailing list