Skip to content

Commit 05c76e7

Browse files
authored
[clang][Driver][OpenMP][SPIR-V] Fix SPIR-V OpenMP DeviceRTL expected file name (llvm#141855)
The option name to specify the path is `--libomptarget-spirv-bc-path` so the existing error gives an invalid option name (`--libomptarget-spirv64-bc-path`) when it can't find the file. Also the expected file name is weird, we expect the file name to be `libomptarget-spirv64.bc`. and use the same prefix `spirv64` to suggest the option to the user. Also the `nvptx` triple is `nvptx64` and the option/filename there is just `nvptx`, so we should be consistent. Signed-off-by: Sarnie, Nick <[email protected]>
1 parent 7d44430 commit 05c76e7

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

clang/lib/Driver/ToolChains/CommonArgs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2811,7 +2811,7 @@ void tools::addOpenMPDeviceRTL(const Driver &D,
28112811

28122812
StringRef ArchPrefix = Triple.isAMDGCN() ? "amdgpu"
28132813
: Triple.isNVPTX() ? "nvptx"
2814-
: "spirv64";
2814+
: "spirv";
28152815
std::string LibOmpTargetName = ("libomptarget-" + ArchPrefix + ".bc").str();
28162816

28172817
// First check whether user specifies bc library

clang/test/Driver/spirv-openmp-toolchain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp -fopenmp-targets=spirv64-intel \
5656
// RUN: --sysroot=%S/Inputs/spirv-openmp/ %s 2>&1 | FileCheck --check-prefix=CHECK-GPULIB %s
57-
// CHECK-GPULIB: "-cc1" "-triple" "spirv64-intel"{{.*}}"-mlink-builtin-bitcode" "{{.*}}libomptarget-spirv64.bc"
57+
// CHECK-GPULIB: "-cc1" "-triple" "spirv64-intel"{{.*}}"-mlink-builtin-bitcode" "{{.*}}libomptarget-spirv.bc"
5858

5959
// RUN: not %clang -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp --offload-arch=spirv64-intel \
6060
// RUN: --libomptarget-spirv-bc-path=%t/ -nogpulib %s 2>&1 \

0 commit comments

Comments
 (0)