-
Notifications
You must be signed in to change notification settings - Fork 11.5k
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
[flang][OpenMP] Add private
to allocate
in parallel-sections.f90
#92185
[flang][OpenMP] Add private
to allocate
in parallel-sections.f90
#92185
Conversation
Add a privatizing clause to the construct that uses `allocate` clause. Amend the CHECK lines to reflect the expected output.
@llvm/pr-subscribers-flang-openmp @llvm/pr-subscribers-flang-fir-hlfir Author: Krzysztof Parzyszek (kparzysz) ChangesAdd a privatizing clause to the construct that uses Full diff: https://github.com/llvm/llvm-project/pull/92185.diff 1 Files Affected:
diff --git a/flang/test/Lower/OpenMP/parallel-sections.f90 b/flang/test/Lower/OpenMP/parallel-sections.f90
index 2f78dd4562b0a..ff96bdc29d425 100644
--- a/flang/test/Lower/OpenMP/parallel-sections.f90
+++ b/flang/test/Lower/OpenMP/parallel-sections.f90
@@ -40,12 +40,8 @@ subroutine omp_parallel_sections_allocate(x, y)
use omp_lib
integer, intent(inout) :: x, y
!CHECK: %[[allocator_1:.*]] = arith.constant 4 : i64
- !CHECK: %[[allocator_2:.*]] = arith.constant 4 : i64
- !CHECK: omp.parallel allocate(
- !CHECK: %[[allocator_2]] : i64 -> %{{.*}} : !fir.ref<i32>) {
- !CHECK: omp.sections allocate(
- !CHECK: %[[allocator_1]] : i64 -> %{{.*}} : !fir.ref<i32>) {
- !$omp parallel sections allocate(omp_high_bw_mem_alloc: x)
+ !CHECK: omp.sections allocate(%[[allocator_1]] : i64 -> %{{.*}} : !fir.ref<i32>) {
+ !$omp parallel sections allocate(omp_high_bw_mem_alloc: x) private(x, y)
!CHECK: omp.section {
!$omp section
x = x + 12
|
!CHECK: omp.sections allocate(%[[allocator_1]] : i64 -> %{{.*}} : !fir.ref<i32>) { | ||
!$omp parallel sections allocate(omp_high_bw_mem_alloc: x) private(x, y) |
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.
Did you miss the CHECK for parallel?
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.
Added.
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.
Thanks for the fix. nit: I think this test also does not need to depend upon openmp_runtime
We'd need to remove the |
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.
LG.
Feel free to leave it as it is if it isn't trivial |
The generated code will change slightly. This isn't the only test where the allocate modifier is used---we can decide later whether we want to keep using it in tests or not. Better yet, we'd fix the module dependency issue... |
Add a privatizing clause to the construct that uses
allocate
clause. Amend the CHECK lines to reflect the expected output.