This is an archive of the discontinued LLVM Phabricator instance.

[Flang][OpenMP][Lower] Support PFT to MLIR lowering of loop-attached target constructs
ClosedPublic

Authored by skatrak on Jul 27 2023, 9:44 AM.

Details

Summary

This patch adds support for lowering target-related combined constructs from PFT to MLIR. The lowering of OpenMP loop constructs is generalized in preparation for later supporting different combinations of target, teams, distribute, parallel and simd directives.

Currently enabled by this patch are the following combined constructs:

  • do simd
  • parallel do simd
  • target parallel do simd
  • target parallel do
  • target simd

Depends on D156313 and D157090.

Diff Detail

Event Timeline

skatrak created this revision.Jul 27 2023, 9:44 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
skatrak requested review of this revision.Jul 27 2023, 9:44 AM
kiranchandramohan accepted this revision.Aug 2 2023, 2:43 PM

LG.

flang/lib/Lower/OpenMP.cpp
2365–2445

We might have all these defined in Semantics. Is it possible to reuse them?

2389–2423

Nit: While you are are here, is it possible to print the name of the directive?

This revision is now accepted and ready to land.Aug 2 2023, 2:43 PM
skatrak added inline comments.Aug 3 2023, 8:27 AM
flang/lib/Lower/OpenMP.cpp
2365–2445

Currently it's not possible, because these sets are defined in check-omp-structure.h which is not currently visible outside of Semantics (it's located in the lib/ directory). Would it be good for me to extract these sets into their own header inside include/Semantics and reuse them here?

flang/lib/Lower/OpenMP.cpp
2365–2445

I think extracting into a separate header and using it here would be good. You can do this as a separate patch.

skatrak updated this revision to Diff 547138.Aug 4 2023, 2:00 AM

Print unsupported loop construct names.

skatrak updated this revision to Diff 547189.Aug 4 2023, 6:37 AM

Extract directive sets into shared header.

skatrak edited the summary of this revision. (Show Details)
skatrak marked 3 inline comments as done.
skatrak updated this revision to Diff 547691.Aug 7 2023, 3:16 AM

Update patch with directive sets defined in header.

skatrak updated this revision to Diff 548970.Aug 10 2023, 4:39 AM

Rebase and update directive sets declaration to avoid issues on some systems.