Arsenm/precheck/translate xargs#2603
Open
arsenm wants to merge 4 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.