[flang-commits] [clang] [flang] [Flang][Driver] Introduce -fopenmp-targets offloading option (PR #100152)

Andrzej WarzyƄski via flang-commits flang-commits at lists.llvm.org
Mon Jul 29 13:57:50 PDT 2024


================
@@ -492,6 +493,18 @@ void Flang::addOffloadOptions(Compilation &C, const InputInfoList &Inputs,
     if (Args.hasArg(options::OPT_nogpulib))
       CmdArgs.push_back("-nogpulib");
   }
+
+  // For all the host OpenMP offloading compile jobs we need to pass the targets
+  // information using -fopenmp-targets= option.
+  if (JA.isHostOffloading(Action::OFK_OpenMP)) {
+    SmallString<128> Targets("-fopenmp-targets=");
----------------
banach-space wrote:

This looks to be taken verbatim from Clang:
* https://github.com/llvm/llvm-project/blob/2ba3fe7356f065757a2279f65e4ef5c8f1476293/clang/lib/Driver/ToolChains/Clang.cpp#L7768-L7778

It should be extracted to a dedicated hook and moved to https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/ToolChains/CommonArgs.cpp.  That's the best we have today. 

>  I think @banach-space is the expert on this area, so maybe he knows of any plans already in place to improve this situation or can give us some pointers on how to better deal with this in the short term.

These days I only have very limited bandwidth to _review_ driver patches. Please consider every contribution that you make as an opportunity to improve code re-use between Clang and Flang.

https://github.com/llvm/llvm-project/pull/100152


More information about the flang-commits mailing list