[Openmp-commits] [PATCH] D97413: [OpenMP] Fix clang-cl build error regarding TSX intrinsics

Jonathan Peyton via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Feb 24 13:37:36 PST 2021


jlpeyton created this revision.
jlpeyton added a reviewer: hans.
jlpeyton added a project: OpenMP.
Herald added subscribers: guansong, yaxunl, mgorny.
jlpeyton requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.

Fix for https://bugs.llvm.org/show_bug.cgi?id=49339

The CMake check for the RTM intrinsics needs the `-mrtm` flag to be set during the test. This way `clang-cl` correctly detects it has the `_xbegin()` intrinsic. Otherwise, the CMake check fails.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97413

Files:
  openmp/runtime/cmake/config-ix.cmake


Index: openmp/runtime/cmake/config-ix.cmake
===================================================================
--- openmp/runtime/cmake/config-ix.cmake
+++ openmp/runtime/cmake/config-ix.cmake
@@ -175,6 +175,7 @@
       }
       int main() { int a = __kmp_umwait(0, 1000); return a; }")
   check_cxx_source_compiles("${source_code}" LIBOMP_HAVE_WAITPKG_INTRINSICS)
+  libomp_append(CMAKE_REQUIRED_FLAGS -mrtm LIBOMP_HAVE_MRTM_FLAG)
   set(source_code "// check for attribute rtm and rtm intrinsics
       #ifdef IMMINTRIN_H
       #include <immintrin.h>
@@ -191,6 +192,7 @@
       int main() { int a = __kmp_xbegin(); return a; }")
   check_cxx_source_compiles("${source_code}" LIBOMP_HAVE_RTM_INTRINSICS)
   set(CMAKE_REQUIRED_DEFINITIONS)
+  set(CMAKE_REQUIRED_FLAGS)
 endif()
 
 # Find perl executable


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97413.326183.patch
Type: text/x-patch
Size: 806 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210224/d08657db/attachment.bin>


More information about the Openmp-commits mailing list