This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Add parsing/sema support for omp_all_memory reserved locator
ClosedPublic

Authored by mikerice on May 17 2022, 12:16 PM.

Details

Summary

Adds support for the reserved locator 'omp_all_memory' for use
in depend clauses with 'out' or 'inout' dependence-types.

Diff Detail

Event Timeline

mikerice created this revision.May 17 2022, 12:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 17 2022, 12:16 PM
mikerice requested review of this revision.May 17 2022, 12:16 PM
ABataev added inline comments.May 17 2022, 12:37 PM
clang/include/clang/AST/OpenMPClause.h
4772

I think we need also to store the location of this modifier

mikerice updated this revision to Diff 430190.May 17 2022, 2:44 PM

Added the source location of 'omp_all_memory' to the clause.

ABataev added inline comments.May 18 2022, 5:20 AM
clang/include/clang/AST/OpenMPClause.h
4812

setOmpAllMemory?

4859

isOmpAllMemory?

clang/include/clang/Sema/Sema.h
11437–11463

Would be good this "fat" list of parameters to a structure.

11552–11559

Same, worth trying to combine params to a struct

clang/lib/AST/OpenMPClause.cpp
1044–1045

Same, many params already

clang/lib/Parse/ParseOpenMP.cpp
4390–4391

Shall we add it to the list of modifiers, just like in, out, inout?

mikerice updated this revision to Diff 430721.May 19 2022, 9:51 AM

Use dependency kind to represent 'omp_all_memory' which fits nicely for codegen.
Add struct to OMPDependClause to reduce parameter passing.
Move OpenMPVarListDataTy so it can be shared between parsing and sema to reduce parameters in calls.

Thanks for the review @ABataev. Any more comments on this update?

ABataev added inline comments.May 24 2022, 7:04 AM
clang/lib/Parse/ParseOpenMP.cpp
4390–4391

Why cannot use getOpenMPSimpleClauseType or something like this?

mikerice updated this revision to Diff 431689.May 24 2022, 8:55 AM

Add a function to parse reserved locators.

clang/lib/Parse/ParseOpenMP.cpp
4390–4391

Since depend clauses would allow the modifiers differently based on context we'd need to modify and complicate getOpenMPSimpleClauseType to handle that. I kind of like a new routine to handle reserved modifiers instead, then it is more obvious what is happening in the code and new reserved locators can be easily added. What do you think?

This revision is now accepted and ready to land.May 24 2022, 9:31 AM
This revision was landed with ongoing or failed builds.May 24 2022, 10:37 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMay 24 2022, 10:37 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript