[OpenMP][MLIR] Add Flags attribute to OMP OffloadModuleInterface
authorAndrew Gozillon <Andrew.Gozillon@amd.com>
Wed, 29 Mar 2023 15:45:59 +0000 (10:45 -0500)
committerAndrew Gozillon <Andrew.Gozillon@amd.com>
Wed, 29 Mar 2023 17:54:38 +0000 (12:54 -0500)
commita7e91b18b73b9971d3af2c6df1811e3da63e61c8
treee11d3bb287b4a7f715a78d840295ebbc0fd71fb6
parent498041da4e7b781d57a6761f345721792ad7079d
[OpenMP][MLIR] Add Flags attribute to OMP OffloadModuleInterface

The intent of this attribute is for it to be applied to a module and
then hold information on runtime library (RTL) flags given to
Flang (or other OpenMP frontend) that should be lowered down to
LLVM-IR for devices as LLVM globals. The following related
flags are:

-fopenmp-target-debug
-fopenmp-assume-threads-oversubscription
-fopenmp-assume-teams-oversubscription
-fopenmp-assume-no-nested-parallelism
-fopenmp-assume-no-thread-state

These exist within Clang and are lowered into the IR when
offloading for device. This attribute allows this infromation
to be carried down from the Flang frontend to the
LLVM/OpenMP Dialect to LLVM-IR translation phase
and then be lowered to LLVM-IR.

Reviewers: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D144896
mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
mlir/include/mlir/Dialect/OpenMP/OpenMPOpsInterfaces.td
mlir/test/Dialect/OpenMP/attr.mlir [new file with mode: 0644]