This is an archive of the discontinued LLVM Phabricator instance.

[Flang] [OpenMP] [Semantics] Change SIMD ALIGNED clause support from parsing a std::list<Name> to OmpObjectlist
ClosedPublic

Authored by raghavendhra on Jun 10 2023, 3:29 PM.

Details

Summary

This is an assisting patch which is implemented to address review comment to switch std::list<Name> to OmpObjectlist from https://reviews.llvm.org/D142722.

Also addressed a semantic check https://github.com/llvm/llvm-project/issues/61161 OpenMP 5.2 standard states that only pointer variables (C_PTR, Cray pointers, POINTER or ALLOCATABLE items) can appear in SIMD aligned clause (section 5.11). And not to allow common block names on an ALIGNED clause.

Diff Detail

Event Timeline

raghavendhra created this revision.Jun 10 2023, 3:29 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
raghavendhra requested review of this revision.Jun 10 2023, 3:30 PM

Thank you for the patch. Should we add tests for this?

Thank you for the patch. Should we add tests for this?

There is a test already for SIMD ALIGNED and I added few lines to the file simd_aligned.F90 in my latest commit to test the new restriction I implemented regarding common block names not being referred within an ALIGNED clause.

Rebase and addressed review comment to add a test case for not allowing common block name in an ALIGNED clause.

Please update the title. std::list<Name> is not a namelist in the Fortran sense.

raghavendhra retitled this revision from [Flang] [OpenMP] [Semantics] Change SIMD ALIGNED clause support from parsing a namelist to Objectlist to [Flang] [OpenMP] [Semantics] Change SIMD ALIGNED clause support from parsing a std::list<Name> to OmpObjectlist.Jun 23 2023, 8:21 PM

Please update the title. std::list<Name> is not a namelist in the Fortran sense.

Done!

Addressed this in latest revision. Thanks for bringing that into attention.

domada added inline comments.Jun 28 2023, 5:10 AM
flang/lib/Semantics/check-omp-structure.cpp
200

nit: unused variable ‘commonBlock’

raghavendhra marked an inline comment as done.Jun 28 2023, 3:27 PM

Thanks for catching that Dominik. :)

Removed unused variable and rebased the patch.

Please change the summary of the patch to include everything that is there in this patch.
-> Switch to OmpObjectList and why
-> Semantic check

LG.

flang/lib/Semantics/check-omp-structure.cpp
198–199

This check can either be hoisted into the if or could be a wrapping condition over the rest of the else if.

if (const auto *name{parser::Unwrap<parser::Name>(ompObject)} && name->symbol) {
  if (FindCommonBlockContaining(*(name->symbol))) {
  } else if ...
  ...
}
if (const auto *name{parser::Unwrap<parser::Name>(ompObject)}) {
  if (name->symbol) {
    if (FindCommonBlockContaining(*(name->symbol))) {
    } ...
    ...
  }
}
This revision is now accepted and ready to land.Jun 29 2023, 2:18 AM
raghavendhra edited the summary of this revision. (Show Details)Jun 29 2023, 3:24 PM

Final rebase before commit.

This revision was landed with ongoing or failed builds.Jun 29 2023, 3:25 PM
This revision was automatically updated to reflect the committed changes.