[all-commits] [llvm/llvm-project] 21a746: clang/AMDGPU: Use TranslateArgs from the base tool...
Matt Arsenault via All-commits
all-commits at lists.llvm.org
Fri Jun 12 01:29:46 PDT 2026
Branch: refs/heads/users/arsenm/clang/amdgpu-fix-using-host-TranslateArgs-not-base-toolchain
Home: https://github.com/llvm/llvm-project
Commit: 21a74633c50b3e3f66904fa5b0230b05c2f6dc5b
https://github.com/llvm/llvm-project/commit/21a74633c50b3e3f66904fa5b0230b05c2f6dc5b
Author: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: 2026-06-11 (Thu, 11 Jun 2026)
Changed paths:
M clang/lib/Driver/Driver.cpp
M clang/lib/Driver/ToolChain.cpp
M clang/lib/Driver/ToolChains/AMDGPU.cpp
M clang/lib/Driver/ToolChains/AMDGPU.h
M clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
M clang/lib/Driver/ToolChains/AMDGPUOpenMP.h
M clang/lib/Driver/ToolChains/Gnu.cpp
M clang/lib/Driver/ToolChains/HIPAMD.cpp
M clang/lib/Driver/ToolChains/HIPAMD.h
A clang/test/Driver/offload-darwin-host.hip
A clang/test/Driver/openmp-Xopenmp-target-forward-args.c
Log Message:
-----------
clang/AMDGPU: Use TranslateArgs from the base toolchain instead of the host
This fixes -Xopenmp-target / -Xarch for arbitrary arguments. HIP and OpenMP
had cargo-cult broken implementations of TranslateArgs, which called the host
toolchain's implementation, and then special case transferred either -march
or -mcpu to the device argument list. The respective device forwarding flags
should work for any argument, not just this one. The main feature that needs
to be preserved is the shared filtering of unsupported sanitizers to degrade
them into warnings.
Most of the changes here are dealing with fallout observed when
the host target is darwin. The darwin toolchain happens to have
some hacky statefulness tracking the compile target version, which
gets written and rewritten on argument parsing. To maintain this hack,
there are a few unused calls to getArgsForToolChain; start passing OFK_Host
to these so the offload toolchains don't get confused and think they're in
a non-offload context.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list