[PATCH] D71847: [OpenMP][Part 1] Reusable OpenMP context/traits handling

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 23 13:55:44 PST 2019


jdoerfert created this revision.
jdoerfert added reviewers: kiranchandramohan, ABataev, RaviNarayanaswamy, gtbercea, grokos, sdmitriev, JonChesterfield, hfinkel, fghanim.
Herald added subscribers: jfb, dexonsmith, guansong, bollu, hiraditya, mgorny.
Herald added a project: LLVM.

This is the first of multiple parts to make OpenMP context/trait
handling reusable and generic. This patch was originally part of D71830 <https://reviews.llvm.org/D71830>
but with the unit tests it can be tested independently.

This patch implements an almost complete handling of OpenMP
contexts/traits such that we can reuse most of the logic in Flang
through the OMPContext.{h,cpp} in llvm/Frontend/OpenMP.

All but construct SIMD specifiers, e.g., inbranch, and the device ISA
selector are define in llvm/lib/Frontend/OpenMP/OMPKinds.def. From
these definitions we generate the enum classes TraitSet,
TraitSelector, and TraitProperty as well as conversion and helper
functions in llvm/lib/Frontend/OpenMP/OMPContext.{h,cpp}.

The OpenMP context is now an explicit object (see struct OMPContext).
This is in anticipation of construct traits that need to be tracked. The
OpenMP context, as well as the VariantMatchInfo, are basically made up
of a set of active or respectively required traits, e.g., 'host', and an
ordered container of constructs which allows duplication. Matching and
scoring is kept as generic as possible to allow easy extension in the
future.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D71847

Files:
  llvm/include/llvm/ADT/SetOperations.h
  llvm/include/llvm/Frontend/OpenMP/OMPContext.h
  llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
  llvm/lib/Frontend/OpenMP/CMakeLists.txt
  llvm/lib/Frontend/OpenMP/OMPContext.cpp
  llvm/unittests/Frontend/CMakeLists.txt
  llvm/unittests/Frontend/OpenMPContextTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71847.235177.patch
Type: text/x-patch
Size: 45328 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191223/d5aba311/attachment.bin>


More information about the llvm-commits mailing list