[llvm-branch-commits] [flang] [llvm] [flang][OpenMP] Generalize isOpenMPPrivatizingConstruct (PR #148654)

Leandro Lupori via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Jul 14 10:40:25 PDT 2025


================
@@ -3,8 +3,9 @@
 ! Check that variables are not privatized twice when TASKGROUP is used.
 
 !CHECK-LABEL: func.func @_QPsub() {
-!CHECK:         omp.parallel {
-!CHECK:           %[[PAR_I:.*]]:2 = hlfir.declare %{{.*}} {uniq_name = "_QFsubEi"}
+!CHECK:         omp.parallel private(@_QFsubEi_private_i32 %[[SUB_I:.*]]#0 -> %[[ARG:.*]] : !fir.ref<i32>)
+!CHECK:           %[[ALLOCA:.*]] = fir.alloca i32
+!CHECK:           %[[PAR_I:.*]]:2 = hlfir.declare %[[ALLOCA]] {uniq_name = "_QFsubEi"}
----------------
luporl wrote:

In this test, was the issue the fact that `i` was not being privatized because `taskgroup` was not being considered as a privatizing construct, which made `i` not be collected as a symbol in nested regions?

Was `i` getting a private copy just by accident, because it was a loop-iteration variable inside `parallel` in this case?

https://github.com/llvm/llvm-project/pull/148654


More information about the llvm-branch-commits mailing list