Skip to content

Arsenm/precheck/translate xargs#2603

Open
arsenm wants to merge 4 commits into
amd-stagingfrom
arsenm/precheck/translate-xargs
Open

Arsenm/precheck/translate xargs#2603
arsenm wants to merge 4 commits into
amd-stagingfrom
arsenm/precheck/translate-xargs

Conversation

@arsenm
Copy link
Copy Markdown

@arsenm arsenm commented May 19, 2026

No description provided.

arsenm and others added 4 commits May 19, 2026 20:37
Currently the AMDGPU HIP and OpenMP toolchains falsely report
all host sanitizers are supported, and then go out of their way
to skip forwarding those to the device compiles. Add an offloading
kind argument so that in the future this can be handled in one
place in the base toolchain.

Co-authored-by: Claude Sonnet 4 <noreply@anthropic.com>
Previously the AMDGPU toolchains hackily handled -fsanitize arguments.
They would lie and report that all host side sanitizers are available,
then TranslateArgs would filter out the device side cases that do not
work, providing diagnostics for the skipped cases. Move that logic
into the base sanitizer argument parsing.

This makes the produced diagnostics more consistent. Previously we
would get repeated warnings when a sanitizer is fully unsupported
by amdgpu, which should now be once for the toolchain. These could
be further improved; we're printing the specific field of -fsanitize
in more cases where it could be skipped. In other cases we have the
opposite problem, where we aren't reporting the exact sanitizer
from the -f flag in the case that depends on a subtarget feature.

This will help fix other broken target specific flag forwarding bugs
in the future.

Co-authored-by: Claude Sonnet 4 <noreply@anthropic.com>
HIP and OpenMP had cargo-cult broken implementations of TranslateArgs,
which special case transferred either -march or -mcpu to the device
argument list. The respective flags to pass flags to the device should
work for any argument, not just these. 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.
@arsenm arsenm requested a review from lamb-j as a code owner May 19, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant