This is an archive of the discontinued LLVM Phabricator instance.

[Flang][OpenMP] Lower allocatable or pointer in private clause
ClosedPublic

Authored by d-smirnov on Apr 17 2023, 2:18 PM.

Details

Summary

This patch lowers allocatables and pointers named in "private" OpenMP clause.

Diff Detail

Event Timeline

Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 17 2023, 2:18 PM
kiranchandramohan requested review of this revision.Apr 17 2023, 2:18 PM
d-smirnov commandeered this revision.Apr 26 2023, 3:05 AM
d-smirnov added a reviewer: kiranchandramohan.

Can you add the context to your patch.

d-smirnov updated this revision to Diff 523307.May 18 2023, 3:05 AM

Handling private clause for allocatables

d-smirnov updated this revision to Diff 525782.May 25 2023, 1:54 PM

Added epilogue

I see that this is WIP but I guess since you put it on phab it is to get some reviews. There are couple of places where you don't follow the llvm guidlines.

flang/lib/Lower/Bridge.cpp
610–611

This change is not needed.

735–739

Not needed change and the code is already following the guidelines.

805

This is probably not needed.

808–811
flang/lib/Lower/OpenMP.cpp
140–143
144–146
tschuett added inline comments.
flang/lib/Lower/Bridge.cpp
808–811

The flang code style diverges unfortunately.

clementval added inline comments.May 25 2023, 2:07 PM
flang/lib/Lower/Bridge.cpp
808–811

In lowering it does not. At least not on this point.

d-smirnov updated this revision to Diff 527085.May 31 2023, 9:26 AM
d-smirnov marked 8 inline comments as done.

Small refactoring

d-smirnov retitled this revision from WIP : : [Flang][OpenMP] Lower allocatable or pointer to [Flang][OpenMP] Lower allocatable or pointer.May 31 2023, 9:27 AM
d-smirnov updated this revision to Diff 527087.May 31 2023, 9:28 AM

Linter

flang/lib/Lower/Bridge.cpp
610–611

reverted

735–739

reverted

805

Removed

808–811

I believe a wrapped condition of the "if" statement here affects readability

flang/lib/Lower/OpenMP.cpp
140–143

reverted

144–146

reverted

d-smirnov updated this revision to Diff 528000.Jun 2 2023, 2:53 PM

+ pointers

d-smirnov updated this revision to Diff 528397.Jun 5 2023, 6:16 AM

Linter + bugfix

d-smirnov retitled this revision from [Flang][OpenMP] Lower allocatable or pointer to [Flang][OpenMP] Lower allocatable or pointer in private clause.Jun 5 2023, 8:06 AM
d-smirnov edited the summary of this revision. (Show Details)
kiranchandramohan requested changes to this revision.Jun 16 2023, 5:34 AM
kiranchandramohan added inline comments.
flang/lib/Lower/Bridge.cpp
631

There seems to be some very similar code in line 739 onwards. Can this be refactored and shared?

This revision now requires changes to proceed.Jun 16 2023, 5:34 AM
d-smirnov updated this revision to Diff 536051.Jun 29 2023, 4:24 PM
d-smirnov marked an inline comment as done.

refactored

Some minor comments for tests. Looking mostly OK.

flang/lib/Lower/Bridge.cpp
12

Nit: Accidental change.

flang/lib/Lower/OpenMP.cpp
670–672

Nit: braces not required.

flang/test/Lower/OpenMP/parallel-private-clause.f90
184–233

There is a lot of code here that is not being checked. Can the additional code be removed if they are not checked. Also, only check what is relevant.

371

Nit: Use capital letters for capture variables (like r here).

390

The dealloc check for this is missing.

d-smirnov updated this revision to Diff 536455.Jun 30 2023, 3:19 PM
d-smirnov marked 5 inline comments as done.

addressed change requests

flang/lib/Lower/Bridge.cpp
12

reverted

631

Looks like I accidentally left the copied code here. Removed

flang/lib/Lower/OpenMP.cpp
670–672

removed

flang/test/Lower/OpenMP/parallel-private-clause.f90
184–233

removed

371

Amended

390

Added

This revision is now accepted and ready to land.Jul 3 2023, 9:21 AM