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

Sergio Afonso via flang-commits flang-commits at lists.llvm.org
Wed Jul 24 07:51:35 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=");
----------------
skatrak wrote:

This block of code is copied from clang: https://github.com/llvm/llvm-project/blob/59e1c6cd63eb9287df6516f9a5ae564075e9c218/clang/lib/Driver/ToolChains/Clang.cpp#L7746

Would it be better to leave it unchanged, let both implementations diverge or apply these suggestions to clang too? I think it makes sense to do them, just trying to avoid divergence on duplicated code.

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


More information about the flang-commits mailing list