-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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][OpenMP] Do not attach -fcuda-is-device flag for AMDGPU OpenMP #96909
[AMDGPU][OpenMP] Do not attach -fcuda-is-device flag for AMDGPU OpenMP #96909
Conversation
`-fcuda-is-device` flag is not used for OpenMP offloading for AMD GPUs and it does not need to be added as clang cc1 option for OpenMP code.
@llvm/pr-subscribers-clang @llvm/pr-subscribers-backend-amdgpu Author: Dominik Adamski (DominikAdamski) Changes
Full diff: https://github.com/llvm/llvm-project/pull/96909.diff 2 Files Affected:
diff --git a/clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp b/clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
index d17ecb15c8208..c7fef090cb625 100644
--- a/clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
+++ b/clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
@@ -47,8 +47,6 @@ void AMDGPUOpenMPToolChain::addClangTargetOptions(
assert(DeviceOffloadingKind == Action::OFK_OpenMP &&
"Only OpenMP offloading kinds are supported.");
- CC1Args.push_back("-fcuda-is-device");
-
if (DriverArgs.hasArg(options::OPT_nogpulib))
return;
diff --git a/clang/test/Driver/amdgpu-openmp-toolchain.c b/clang/test/Driver/amdgpu-openmp-toolchain.c
index 49af04acc4639..a153c4afb0ce8 100644
--- a/clang/test/Driver/amdgpu-openmp-toolchain.c
+++ b/clang/test/Driver/amdgpu-openmp-toolchain.c
@@ -7,7 +7,7 @@
// verify the tools invocations
// CHECK: "-cc1" "-triple" "x86_64-unknown-linux-gnu"{{.*}}"-emit-llvm-bc"{{.*}}"-x" "c"
-// CHECK: "-cc1" "-triple" "amdgcn-amd-amdhsa" "-aux-triple" "x86_64-unknown-linux-gnu"{{.*}}"-fcuda-is-device"{{.*}}"-target-cpu" "gfx906"
+// CHECK: "-cc1" "-triple" "amdgcn-amd-amdhsa" "-aux-triple" "x86_64-unknown-linux-gnu"{{.*}}"-target-cpu" "gfx906"
// CHECK: "-cc1" "-triple" "x86_64-unknown-linux-gnu"{{.*}}"-emit-obj"
// CHECK: clang-linker-wrapper{{.*}} "-o" "a.out"
|
@llvm/pr-subscribers-clang-driver Author: Dominik Adamski (DominikAdamski) Changes
Full diff: https://github.com/llvm/llvm-project/pull/96909.diff 2 Files Affected:
diff --git a/clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp b/clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
index d17ecb15c8208..c7fef090cb625 100644
--- a/clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
+++ b/clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
@@ -47,8 +47,6 @@ void AMDGPUOpenMPToolChain::addClangTargetOptions(
assert(DeviceOffloadingKind == Action::OFK_OpenMP &&
"Only OpenMP offloading kinds are supported.");
- CC1Args.push_back("-fcuda-is-device");
-
if (DriverArgs.hasArg(options::OPT_nogpulib))
return;
diff --git a/clang/test/Driver/amdgpu-openmp-toolchain.c b/clang/test/Driver/amdgpu-openmp-toolchain.c
index 49af04acc4639..a153c4afb0ce8 100644
--- a/clang/test/Driver/amdgpu-openmp-toolchain.c
+++ b/clang/test/Driver/amdgpu-openmp-toolchain.c
@@ -7,7 +7,7 @@
// verify the tools invocations
// CHECK: "-cc1" "-triple" "x86_64-unknown-linux-gnu"{{.*}}"-emit-llvm-bc"{{.*}}"-x" "c"
-// CHECK: "-cc1" "-triple" "amdgcn-amd-amdhsa" "-aux-triple" "x86_64-unknown-linux-gnu"{{.*}}"-fcuda-is-device"{{.*}}"-target-cpu" "gfx906"
+// CHECK: "-cc1" "-triple" "amdgcn-amd-amdhsa" "-aux-triple" "x86_64-unknown-linux-gnu"{{.*}}"-target-cpu" "gfx906"
// CHECK: "-cc1" "-triple" "x86_64-unknown-linux-gnu"{{.*}}"-emit-obj"
// CHECK: clang-linker-wrapper{{.*}} "-o" "a.out"
|
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.
We don't even pass this in the NVPTX offloading case, so there's no reason to do it for AMDGPU.
revert: breaks smoke virtfunc1 and virtual_functions * 8bb00cb [AMDGPU][OpenMP] Do not attach -fcuda-is-device flag for AMDGPU OpenMP (llvm#96909) Change-Id: Iddfaa6e382f0078303256e5e24a3a69af0d524d7
…PU OpenMP (llvm#96909)" This reverts commit 8bb00cb.
This change seems to have broken a CI: https://gitlab.e4s.io/uo-public/llvm-openmp-offloading/-/jobs/283716 Could you please take a look and revert if you need time to investigate? |
…PU OpenMP" (#97531) Reverts #96909 (commit ID: 8bb00cb) It breaks OpenMP CI: https://gitlab.e4s.io/uo-public/llvm-openmp-offloading/-/jobs/283716
This reverts commit 8252dbe.
llvm#96909) `-fcuda-is-device` flag is not used for OpenMP offloading for AMD GPUs and it does not need to be added as clang cc1 option for OpenMP code.
…PU OpenMP" (llvm#97531) Reverts llvm#96909 (commit ID: 8bb00cb) It breaks OpenMP CI: https://gitlab.e4s.io/uo-public/llvm-openmp-offloading/-/jobs/283716
llvm#96909) `-fcuda-is-device` flag is not used for OpenMP offloading for AMD GPUs and it does not need to be added as clang cc1 option for OpenMP code.
…PU OpenMP" (llvm#97531) Reverts llvm#96909 (commit ID: 8bb00cb) It breaks OpenMP CI: https://gitlab.e4s.io/uo-public/llvm-openmp-offloading/-/jobs/283716
-fcuda-is-device flag is not used for OpenMP offloading for AMD GPUs and it does not need to be added as clang cc1 option for OpenMP code. This PR has the same functionality as #96909 but it doesn't introduce regression for virtual function support.
This reverts commit f2e362e. PR: llvm#99002 causes that -fcuda-is-device is not added for AMD GPU OpenMP.
-fcuda-is-device flag is not used for OpenMP offloading for AMD GPUs and it does not need to be added as clang cc1 option for OpenMP code. This PR has the same functionality as llvm#96909 but it doesn't introduce regression for virtual function support.
-fcuda-is-device flag is not used for OpenMP offloading for AMD GPUs and it does not need to be added as clang cc1 option for OpenMP code. This PR has the same functionality as llvm#96909 but it doesn't introduce regression for virtual function support.
Summary: -fcuda-is-device flag is not used for OpenMP offloading for AMD GPUs and it does not need to be added as clang cc1 option for OpenMP code. This PR has the same functionality as #96909 but it doesn't introduce regression for virtual function support. Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60251022
-fcuda-is-device
flag is not used for OpenMP offloading for AMD GPUs and it does not need to be added as clang cc1 option for OpenMP code.