This is an archive of the discontinued LLVM Phabricator instance.

[Flang][OpenMP] Add more sema checks for ordered construct
ClosedPublic

Authored by arnamoy10 on Mar 16 2021, 12:05 PM.

Details

Summary

This patch fixes a bug to allow ordered construct within a non-worksharing loop, also adds more sema checks

Also adds a test case for the checks

Diff Detail

Event Timeline

arnamoy10 created this revision.Mar 16 2021, 12:05 PM
arnamoy10 requested review of this revision.Mar 16 2021, 12:05 PM
Herald added a project: Restricted Project. · View Herald Transcript
flang/lib/Semantics/check-omp-structure.cpp
346–348

"An ordered region corresponding to an ordered construct without any clause or with the threads or depend clause may not be closely nested inside a critical, ordered, loop, atomic, task, or taskloop region."

According to the standard the restriction is as given above. Does doSet capture this?

flang/test/Semantics/omp-ordered-simd.f90
15

"The only OpenMP constructs that can be encountered during execution of a simd (or worksharing-loop SIMD) region are the atomic construct, the loop construct, the simd construct and the ordered construct with the simd clause."

Will you tighten the check in a later patch to ensure that it is an ORDERED SIMD and not ORDERED only construct?

arnamoy10 added inline comments.Mar 18 2021, 12:55 PM
flang/lib/Semantics/check-omp-structure.cpp
346–348

Thanks, updating the patch.

flang/test/Semantics/omp-ordered-simd.f90
15

Yes, one more patch to take care of that!

Handling more cases for nesting of ordered construct

LGTM.

flang/lib/Semantics/check-omp-structure.cpp
359–360

Nit: I think we should captialise all the regions. Space missing before critical.

This revision is now accepted and ready to land.Mar 18 2021, 2:47 PM
arnamoy10 updated this revision to Diff 331901.Mar 19 2021, 9:04 AM

Changing case for the error message

arnamoy10 added inline comments.Mar 19 2021, 9:05 AM
flang/lib/Semantics/check-omp-structure.cpp
359–360

Done, thanks

arnamoy10 retitled this revision from [fix][Flang][OpenMP] Allow ordered construct within a non-worksharing loop to [Flang][OpenMP] Add more sema checks for ordered construct.Mar 19 2021, 9:20 AM
arnamoy10 edited the summary of this revision. (Show Details)