[clang] [flang] [Flang-new][OpenMP] Add offload related flags for AMDGPU (PR #96742)

Dominik Adamski via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 27 02:29:01 PDT 2024


================
@@ -333,6 +333,9 @@ void Flang::AddAMDGPUTargetArgs(const ArgList &Args,
     StringRef Val = A->getValue();
     CmdArgs.push_back(Args.MakeArgString("-mcode-object-version=" + Val));
   }
+
+  const ToolChain &TC = getToolChain();
+  TC.addClangTargetOptions(Args, CmdArgs, Action::OffloadKind::OFK_OpenMP);
----------------
DominikAdamski wrote:

Hi,
thanks for the feedback. I would like to share my observations with you:

1. Clang does not verify how we use these flags and it accepts them for non-GPU target.
2. These flags can be reused by other vendors. For example clang adds `mlink-builtin-bitcode` option for OpenMP Nvidia GPU [as well](https://github.com/llvm/llvm-project/blob/ba60d8a11af2cdd7e80e2fd968cdf52adcabf5a1/clang/test/Driver/openmp-offload-gpu.c#L92) .

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


More information about the cfe-commits mailing list