Skip to content

Commit f6a9c4d

Browse files
authored
[SYCL][Clang] Rename -Wno-libspirv-hip-cuda to -Wunsafe-libspirv-not-linked (#19053)
IMO there are a few problems with the current name: - Its negative option form `-Wno-no-libspirv-hip-cuda` is very awkward. - It is very specific about the HIP or CUDA backend, which does not allow for future expansion to other backends, that might use libspirv. - It's not descriptive: without the context of the error message, its not at all clear what the warning is about.
1 parent 9d13f4f commit f6a9c4d

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def err_drv_no_sycl_libspirv : Error<
127127
def warn_flag_no_sycl_libspirv
128128
: Warning<"'-fno-sycl-libspirv' should not be used with target '%0'; "
129129
"libspirv is required for correct behavior">,
130-
InGroup<NoLibspirvHipCuda>;
130+
InGroup<UnsafeLibspirvNotLinked>;
131131
def err_drv_mix_cuda_hip : Error<
132132
"mixed CUDA and HIP compilation is not supported">;
133133
def err_drv_bad_target_id : Error<

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,9 +1607,9 @@ def CudaUnknownVersion: DiagGroup<"unknown-cuda-version">;
16071607
// ignored by CUDA.
16081608
def HIPOnly : DiagGroup<"hip-only">;
16091609

1610-
// A warning generated when compiling SYCL applications for HIP or CUDA backends
1611-
// without linking LIBSPIRV.
1612-
def NoLibspirvHipCuda : DiagGroup<"no-libspirv-hip-cuda">;
1610+
// A warning generated when compiling SYCL applications without linking LIBSPIRV
1611+
// for targets that require it.
1612+
def UnsafeLibspirvNotLinked : DiagGroup<"unsafe-libspirv-not-linked">;
16131613

16141614
// Warning about mixed HIP and OpenMP compilation / target offloading.
16151615
def HIPOpenMPOffloading: DiagGroup<"hip-omp-target-directives">;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// Test that appropriate warnings are output when -fno-sycl-libspirv is used.
22

33
// RUN: not %clangxx -fsycl -fsycl-targets=nvptx64-nvidia-cuda,amdgcn-amd-amdhsa -fno-sycl-libspirv %s -### 2>&1 | FileCheck %s
4-
// CHECK-DAG: warning: '-fno-sycl-libspirv' should not be used with target 'nvptx64-nvidia-cuda'; libspirv is required for correct behavior [-Wno-libspirv-hip-cuda]
5-
// CHECK-DAG: warning: '-fno-sycl-libspirv' should not be used with target 'amdgcn-amd-amdhsa'; libspirv is required for correct behavior [-Wno-libspirv-hip-cuda]
4+
// CHECK-DAG: warning: '-fno-sycl-libspirv' should not be used with target 'nvptx64-nvidia-cuda'; libspirv is required for correct behavior [-Wunsafe-libspirv-not-linked]
5+
// CHECK-DAG: warning: '-fno-sycl-libspirv' should not be used with target 'amdgcn-amd-amdhsa'; libspirv is required for correct behavior [-Wunsafe-libspirv-not-linked]
66
// RUN: %clangxx -fsycl -fsycl-targets=spir64-unknown-unknown -fno-sycl-libspirv %s -### 2>&1 | FileCheck --check-prefix=CHECK-SPIR64 %s
77
// CHECK-SPIR64: ignoring '-fno-sycl-libspirv' option as it is not currently supported for target 'spir64-unknown-unknown' [-Woption-ignored]

0 commit comments

Comments
 (0)