This is an archive of the discontinued LLVM Phabricator instance.

Revert "[Flang][OpenMP] Add semantic check for OpenMP Private, Firstprivate and Lastprivate clauses."
ClosedPublic

Authored by kiranchandramohan on Mar 29 2022, 6:13 AM.

Details

Summary

This reverts commit a2ca6bbda6160c1b474fffd6204bcac9456c7eb1.

D93213 performs some checks to ensure that variables that appear in
statement functions are not in privatisation clauses. The point at
which this check is currently performed, there can be misparses that
cause more constructs to be identified as statement functions. This
can lead to various kinds of errors, hence reverting.

This revert hopefully fixes:
https://github.com/llvm/llvm-project/issues/54477
https://github.com/llvm/llvm-project/issues/54161
https://github.com/llvm/llvm-project/issues/54163

Diff Detail

Event Timeline

Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMar 29 2022, 6:13 AM
kiranchandramohan requested review of this revision.Mar 29 2022, 6:13 AM
shraiysh accepted this revision.Mar 29 2022, 7:59 AM

I believe the original semantic restriction has been removed in OpenMP 5.0.

This revision is now accepted and ready to land.Mar 29 2022, 7:59 AM

I believe the original semantic restriction has been removed in OpenMP 5.0.

This restriction is still present in the OpenMP 5.2 standard.
The OpenMP 5.2 standard (page 108, Section 4.3) says that "Variables that appear in namelist statements, in variable format expressions, and in expressions for statement function definitions, must not be privatized."
https://www.openmp.org/wp-content/uploads/OpenMP-API-Specification-5-2.pdf

I have filed a ticket to implement this check (https://github.com/llvm/llvm-project/issues/54677).

flang/lib/Semantics/resolve-directives.cpp