[Openmp-commits] [PATCH] D137744: [openmp] Only try to add the -mrtm flag on i386/x86_64

Martin Storsjö via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Nov 9 14:26:30 PST 2022


mstorsjo created this revision.
mstorsjo added reviewers: AndreyChurbanov, JonChesterfield, natgla.
Herald added subscribers: pengfei, guansong, yaxunl.
Herald added a project: All.
mstorsjo requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.
Herald added a project: OpenMP.

Clang does accept the flag for any architecture, but prints a
warning:

  clang-16: warning: argument unused during compilation: '-mrtm' [-Wunused-command-line-argument]

This flag is documented as an x86 specific flag, so don't try to
add it for other architectures, to silence this warning.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137744

Files:
  openmp/runtime/cmake/LibompHandleFlags.cmake


Index: openmp/runtime/cmake/LibompHandleFlags.cmake
===================================================================
--- openmp/runtime/cmake/LibompHandleFlags.cmake
+++ openmp/runtime/cmake/LibompHandleFlags.cmake
@@ -42,7 +42,9 @@
   libomp_append(flags_local /GS LIBOMP_HAVE_GS_FLAG)
   libomp_append(flags_local /EHsc LIBOMP_HAVE_EHSC_FLAG)
   libomp_append(flags_local /Oy- LIBOMP_HAVE_OY__FLAG)
-  libomp_append(flags_local -mrtm LIBOMP_HAVE_MRTM_FLAG)
+  if(${IA32} OR ${INTEL64})
+    libomp_append(flags_local -mrtm LIBOMP_HAVE_MRTM_FLAG)
+  endif()
   # Intel(R) C Compiler flags
   libomp_append(flags_local /Qsafeseh LIBOMP_HAVE_QSAFESEH_FLAG)
   libomp_append(flags_local -Qoption,cpp,--extended_float_types LIBOMP_HAVE_EXTENDED_FLOAT_TYPES_FLAG)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137744.474363.patch
Type: text/x-patch
Size: 763 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20221109/ab8baf44/attachment.bin>


More information about the Openmp-commits mailing list