[PATCH] D124156: [flang][OpenMP] Added parser support for in_reduction clause on OpenMP Task directive

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 23 02:46:34 PDT 2022


kiranchandramohan added a comment.

In D124156#3527039 <https://reviews.llvm.org/D124156#3527039>, @peixin wrote:

> In D124156#3473770 <https://reviews.llvm.org/D124156#3473770>, @peixin wrote:
>
>> Does this need changes in `flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp`? @kiranchandramohan
>
> LGTM. Please wait for @kiranchandramohan 's comments about this.

It reports something like the following for the in_reduction clause which seems OK. You can build the tool with  `-DFLANG_BUILD_EXAMPLES=On` and check with `check-flang-examples`.  Run the tool like

  $BUILD_DIR/bin/flang-new -fc1 -load $BUILD_DIR/lib/flangOmpReport.so -plugin flang-omp-report -fopenmp $FILE_NAME -o -



  construct:       task
  clauses:
    - clause:          in_reduction
      details:         '+:z'



================
Comment at: flang/test/Semantics/omp-clause-validity01.f90:66
   do i = 1, N
      z = 2
   end do
----------------
shraiysh wrote:
> Why are we adding semantics test when we have no semantic checks for this clause yet? IMO we should not be adding this test right now.
> 
> Anyways, if you decide to add this test, maybe add it as a separate test because private(b) and in_reduction(+:b) are probably conflicting. Also, please add some reducing code inside the structured block.
Possibly, it is checking the allowed clauses that are automatically created due to entries in OMP.td.

Not clear whether it is allowed or not. But something simple and separate would be better.
```
!$omp taskgroup task_reduction(+:z)
!$omp task in_reduction(+:z)
z = z + 5
!$omp end task
!$omp end taskgroup
```

We might also need to ask the task modifier to the regular reduction clause sometime.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124156/new/

https://reviews.llvm.org/D124156



More information about the llvm-commits mailing list