This is an archive of the discontinued LLVM Phabricator instance.

[mlir][OpenMP] Generating enums in accordance with the guidelines
ClosedPublic

Authored by shraiysh on Mar 2 2022, 8:44 AM.

Details

Summary

This patch changes the enums generated from OMP.td for MLIR according
to the enum naming guidelines in LLVM Coding Standards.

This also helps the issues we had with static being a C++ keyword and
also a value for the schedule clause.

Enumerator naming guidelines: https://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly

Diff Detail

Event Timeline

shraiysh created this revision.Mar 2 2022, 8:44 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
shraiysh requested review of this revision.Mar 2 2022, 8:44 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
shraiysh updated this revision to Diff 414052.Mar 9 2022, 3:01 AM

Ping! Rebase with main.

kiranchandramohan accepted this revision.Mar 9 2022, 3:53 AM

LGTM. Please add a pointer to the the llvm guidelines recommending this change.

Does OpenACC use any of this infra currently?

llvm/unittests/Frontend/OpenMPParsingTest.cpp
76–77

Nit: Can this FIXME be removed?

mlir/tools/mlir-tblgen/DirectiveCommonGen.cpp
73–77

Nit: Is the const significant here?

This revision is now accepted and ready to land.Mar 9 2022, 3:53 AM
shraiysh edited the summary of this revision. (Show Details)Mar 9 2022, 5:19 AM
shraiysh updated this revision to Diff 414075.Mar 9 2022, 5:28 AM
shraiysh marked 2 inline comments as done.

Thanks for the review. Addressed comments.

Does OpenACC use any of this infra currently?

The tests pass so I don't think they use this. I can see they use ClauseVal once here but the generated enum is not used anywhere so I think we are safe.

shraiysh updated this revision to Diff 414076.Mar 9 2022, 5:30 AM

Removed another comment which was no longer needed.

This revision was landed with ongoing or failed builds.Mar 9 2022, 6:41 AM
This revision was automatically updated to reflect the committed changes.