[clang] [Clang] Make `-Xarch_` handling generic for all toolchains (PR #125421)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 3 12:16:00 PST 2025


================
@@ -1115,14 +1117,13 @@ def fno_convergent_functions : Flag<["-"], "fno-convergent-functions">,
 
 // Common offloading options
 let Group = offload_Group in {
-def offload_arch_EQ : Joined<["--"], "offload-arch=">, Flags<[NoXarchOption]>,
----------------
jhuber6 wrote:

I don't think there's actually a way to do that unfortunately. When we query the like of active `--offload-arch` kinds we don't have a bound architecture yet. There's no way to know if the string *is* a CPU argument. So, the only case would be to reject usage of this altogether, which is clearly not useful because we have `-Xopenmp-target=` which is just a dumber version of this handling.

So, there's no way to detect the usage here and rejecting it flatly isn't desirable. The current behavior is that `-Xarch_gfx90a --offload-arch=gfx90a` will be unused.

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


More information about the cfe-commits mailing list