[flang-commits] [flang] [flang][OpenACC] Allow data action and data-sharing clause overlap (PR #218588)
via flang-commits
flang-commits at lists.llvm.org
Tue Aug 25 07:34:19 PDT 2026
================
@@ -8,9 +8,13 @@ subroutine copy_then_reduction()
end subroutine
! CHECK-LABEL: func.func @_QPcopy_then_reduction()
-! CHECK: acc.reduction varPtr({{.*}}) recipe({{.*}}) name("x") -> !fir.ref<i32>
-! CHECK-NOT: acc.copy
-! CHECK: acc.parallel reduction({{.*}}) {
+! CHECK: %[[COPY1:.*]] = acc.copyin varPtr({{.*}}) dataClause(acc_copy) name("x") -> !fir.ref<i32>
+! CHECK: %[[REDUCTION1:.*]] = acc.reduction varPtr({{.*}}) recipe({{.*}}) name("x") -> !fir.ref<i32>
+! CHECK: acc.parallel dataOperands(%[[COPY1]] : !fir.ref<i32>) reduction(%[[REDUCTION1]] : !fir.ref<i32>) {
+! TODO: The region body uses the first mapping for x, making lowering depend on
----------------
jeanPerier wrote:
I do not know what was the behavior before #211606, but if this does not produce valid code in the end and that emitting a hard TODO in semantic/lowering is easy, I would advise adding it here so to avoid anyone spending time debugging this before you implement it.
https://github.com/llvm/llvm-project/pull/218588
More information about the flang-commits
mailing list