[all-commits] [llvm/llvm-project] c95340: [OpenMP][Part 1] Reusable OpenMP context/traits ha...

Johannes Doerfert via All-commits all-commits at lists.llvm.org
Sun Feb 2 21:19:30 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c953409ff89e38f5aa5927f5adae3078db45d81c
      https://github.com/llvm/llvm-project/commit/c953409ff89e38f5aa5927f5adae3078db45d81c
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2020-02-02 (Sun, 02 Feb 2020)

  Changed paths:
    M llvm/include/llvm/ADT/SetOperations.h
    A llvm/include/llvm/Frontend/OpenMP/OMPContext.h
    M llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
    M llvm/lib/Frontend/OpenMP/CMakeLists.txt
    A llvm/lib/Frontend/OpenMP/OMPContext.cpp
    M llvm/unittests/Frontend/CMakeLists.txt
    A llvm/unittests/Frontend/OpenMPContextTest.cpp

  Log Message:
  -----------
  [OpenMP][Part 1] Reusable OpenMP context/traits handling

This is the first of multiple parts to make OpenMP context/trait
handling reusable and generic. This patch was originally part of 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.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D71847




More information about the All-commits mailing list