[Openmp-commits] [PATCH] D108404: [libomptarget][amdcgn] Add build dependency for llvm-link and opt

Joachim Protze via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Aug 19 13:09:49 PDT 2021

protze.joachim created this revision.
protze.joachim added reviewers: tianshilei1992, JonChesterfield.
protze.joachim added a project: OpenMP.
Herald added subscribers: mgorny, jvesely.
protze.joachim requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: llvm-commits, sstefan1.
Herald added a project: LLVM.

D107156 <https://reviews.llvm.org/D107156> and D107320 <https://reviews.llvm.org/D107320> are not sufficient when OpenMP is built as llvm runtime because dependencies only work within the same cmake instance.
We could limit the dependency to cases where libomptarget/plugins are really built. But compared to the whole llvm project, building openmp runtime is negligible and postponing the build of OpenMP runtime after the dependencies are ready seems reasonable.

The direct dependency introduced in D107156 <https://reviews.llvm.org/D107156> and D107320 <https://reviews.llvm.org/D107320> is necessary for the case where OpenMP is built as llvm project.
This patch superseeds D107320 <https://reviews.llvm.org/D107320>.



Index: openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
--- openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
+++ openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
@@ -157,7 +157,7 @@
     OUTPUT ${bc_libname}
     COMMAND ${LINK_TOOL} ${bc_files} | ${OPT_TOOL} --always-inline -o ${OUTPUTDIR}/${bc_libname}
-    DEPENDS ${bc_files} opt)
+    DEPENDS ${bc_files} llvm-link opt)
   add_custom_target(lib${libname}-${mcpu} ALL DEPENDS ${bc_libname})
Index: llvm/runtimes/CMakeLists.txt
--- llvm/runtimes/CMakeLists.txt
+++ llvm/runtimes/CMakeLists.txt
@@ -407,6 +407,9 @@
         add_dependencies(install-${component} install-${component}-${name})
         add_dependencies(install-${component}-stripped install-${component}-${name}-stripped)
+      if("$name" STREQUAL "openmp")
+        add_dependencies(runtimes-${name} opt llvm-link)
+      endif()
     foreach(multilib ${LLVM_RUNTIME_MULTILIBS})

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108404.367595.patch
Type: text/x-patch
Size: 1114 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210819/6ae5cb0d/attachment.bin>

More information about the Openmp-commits mailing list