[libcxx-commits] [PATCH] D155512: [libc++][PSTL] Add vectorization annotations when clang is used

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 17 13:14:41 PDT 2023


philnik created this revision.
Herald added a project: All.
philnik requested review of this revision.
Herald added subscribers: libcxx-commits, wangpc.
Herald added a project: libc++.
Herald added a reviewer: libc++.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D155512

Files:
  libcxx/include/__config


Index: libcxx/include/__config
===================================================================
--- libcxx/include/__config
+++ libcxx/include/__config
@@ -1409,6 +1409,16 @@
 #    define _PSTL_PRAGMA_DECLARE_REDUCTION(NAME, OP)                                                                   \
       _PSTL_PRAGMA(omp declare reduction(NAME:OP : omp_out(omp_in)) initializer(omp_priv = omp_orig))
 
+#  elifdef _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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155512.541205.patch
Type: text/x-patch
Size: 1025 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230717/d37566f5/attachment.bin>


More information about the libcxx-commits mailing list