Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AMDGPU] Accept/Ignore any -mcmodel arguments. #70760

Merged
merged 2 commits into from
Oct 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions clang/lib/Driver/ToolChains/Clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5743,9 +5743,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
} else if (Triple.getArch() == llvm::Triple::x86_64) {
Ok = llvm::is_contained({"small", "kernel", "medium", "large", "tiny"},
CM);
} else if (Triple.isNVPTX()) {
// NVPTX does not care about the code model and will accept whatever works
// for the host.
} else if (Triple.isNVPTX() || Triple.isAMDGPU()) {
// NVPTX/AMDGPU does not care about the code model and will accept
// whatever works for the host.
Ok = true;
}
if (Ok) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neither nvptx or amdgpu backend accepts -mcmodel=tiny and kernel. the backends will fail with error:

fatal error: error in backend: Target does not support the tiny CodeModel

for tiny and kernel, we should not pass them to clang -cc1 and emit a warning that they are ignored.

Expand Down