-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[clang][Driver][OpenMP][SPIR-V] Fix SPIR-V OpenMP DeviceRTL expected file name #141855
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
Conversation
…file name Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
@llvm/pr-subscribers-clang Author: Nick Sarnie (sarnex) ChangesThe option name to specify the path is Also the Full diff: https://github.com/llvm/llvm-project/pull/141855.diff 3 Files Affected:
diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 60db462d87342..937ee09cac7cc 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -2811,7 +2811,7 @@ void tools::addOpenMPDeviceRTL(const Driver &D,
StringRef ArchPrefix = Triple.isAMDGCN() ? "amdgpu"
: Triple.isNVPTX() ? "nvptx"
- : "spirv64";
+ : "spirv";
std::string LibOmpTargetName = ("libomptarget-" + ArchPrefix + ".bc").str();
// First check whether user specifies bc library
diff --git a/clang/test/Driver/Inputs/spirv-openmp/lib/libomptarget-spirv64.bc b/clang/test/Driver/Inputs/spirv-openmp/lib/libomptarget-spirv.bc
similarity index 100%
rename from clang/test/Driver/Inputs/spirv-openmp/lib/libomptarget-spirv64.bc
rename to clang/test/Driver/Inputs/spirv-openmp/lib/libomptarget-spirv.bc
diff --git a/clang/test/Driver/spirv-openmp-toolchain.c b/clang/test/Driver/spirv-openmp-toolchain.c
index 3fd6d94a1222b..a61f3bc2399eb 100644
--- a/clang/test/Driver/spirv-openmp-toolchain.c
+++ b/clang/test/Driver/spirv-openmp-toolchain.c
@@ -54,7 +54,7 @@
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp -fopenmp-targets=spirv64-intel \
// RUN: --sysroot=%S/Inputs/spirv-openmp/ %s 2>&1 | FileCheck --check-prefix=CHECK-GPULIB %s
-// CHECK-GPULIB: "-cc1" "-triple" "spirv64-intel"{{.*}}"-mlink-builtin-bitcode" "{{.*}}libomptarget-spirv64.bc"
+// CHECK-GPULIB: "-cc1" "-triple" "spirv64-intel"{{.*}}"-mlink-builtin-bitcode" "{{.*}}libomptarget-spirv.bc"
// RUN: not %clang -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp --offload-arch=spirv64-intel \
// RUN: --libomptarget-spirv-bc-path=%t/ -nogpulib %s 2>&1 \
|
@llvm/pr-subscribers-clang-driver Author: Nick Sarnie (sarnex) ChangesThe option name to specify the path is Also the Full diff: https://github.com/llvm/llvm-project/pull/141855.diff 3 Files Affected:
diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 60db462d87342..937ee09cac7cc 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -2811,7 +2811,7 @@ void tools::addOpenMPDeviceRTL(const Driver &D,
StringRef ArchPrefix = Triple.isAMDGCN() ? "amdgpu"
: Triple.isNVPTX() ? "nvptx"
- : "spirv64";
+ : "spirv";
std::string LibOmpTargetName = ("libomptarget-" + ArchPrefix + ".bc").str();
// First check whether user specifies bc library
diff --git a/clang/test/Driver/Inputs/spirv-openmp/lib/libomptarget-spirv64.bc b/clang/test/Driver/Inputs/spirv-openmp/lib/libomptarget-spirv.bc
similarity index 100%
rename from clang/test/Driver/Inputs/spirv-openmp/lib/libomptarget-spirv64.bc
rename to clang/test/Driver/Inputs/spirv-openmp/lib/libomptarget-spirv.bc
diff --git a/clang/test/Driver/spirv-openmp-toolchain.c b/clang/test/Driver/spirv-openmp-toolchain.c
index 3fd6d94a1222b..a61f3bc2399eb 100644
--- a/clang/test/Driver/spirv-openmp-toolchain.c
+++ b/clang/test/Driver/spirv-openmp-toolchain.c
@@ -54,7 +54,7 @@
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp -fopenmp-targets=spirv64-intel \
// RUN: --sysroot=%S/Inputs/spirv-openmp/ %s 2>&1 | FileCheck --check-prefix=CHECK-GPULIB %s
-// CHECK-GPULIB: "-cc1" "-triple" "spirv64-intel"{{.*}}"-mlink-builtin-bitcode" "{{.*}}libomptarget-spirv64.bc"
+// CHECK-GPULIB: "-cc1" "-triple" "spirv64-intel"{{.*}}"-mlink-builtin-bitcode" "{{.*}}libomptarget-spirv.bc"
// RUN: not %clang -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp --offload-arch=spirv64-intel \
// RUN: --libomptarget-spirv-bc-path=%t/ -nogpulib %s 2>&1 \
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The .bc
file for AMDGPU is unused, I'd imagine SPIR-V is as well since its compilation flow is like AMDGPU.
Right now we don't even build the DeviceRTL for SPIR-V, however I do have it built locally with some other modifications that seem to result in it being used and I ran into this issue there. |
…file name (#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 <nick.sarnie@intel.com>
…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 <nick.sarnie@intel.com>
…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 <nick.sarnie@intel.com>
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 belibomptarget-spirv64.bc
. and use the same prefixspirv64
to suggest the option to the user.Also the
nvptx
triple isnvptx64
and the option/filename there is justnvptx
, so we should be consistent.