Skip to content

Commit b19bf3e

Browse files
authored
[clang][SPIRV] Don't warn on -mcmodel (#86039)
The code model doesn't affect the sub-compilation, so don't check it. Followup to #70740.
1 parent cde54df commit b19bf3e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -5863,8 +5863,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
58635863
} else if (Triple.getArch() == llvm::Triple::x86_64) {
58645864
Ok = llvm::is_contained({"small", "kernel", "medium", "large", "tiny"},
58655865
CM);
5866-
} else if (Triple.isNVPTX() || Triple.isAMDGPU()) {
5867-
// NVPTX/AMDGPU does not care about the code model and will accept
5866+
} else if (Triple.isNVPTX() || Triple.isAMDGPU() || Triple.isSPIRV()) {
5867+
// NVPTX/AMDGPU/SPIRV does not care about the code model and will accept
58685868
// whatever works for the host.
58695869
Ok = true;
58705870
} else if (Triple.isSPARC64()) {

clang/test/Driver/unsupported-option-gpu.c

+1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
// DEFINE: %{check} = %clang -### --target=x86_64-linux-gnu -c -mcmodel=medium
33

44
// RUN: %{check} -x cuda %s --cuda-path=%S/Inputs/CUDA/usr/local/cuda --offload-arch=sm_60 --no-cuda-version-check -fbasic-block-sections=all
5+
// RUN: %{check} -x hip %s --offload=spirv64 -nogpulib -nogpuinc
56
// RUN: %{check} -x hip %s --rocm-path=%S/Inputs/rocm -nogpulib -nogpuinc

0 commit comments

Comments
 (0)