Skip to content
Commit 6a950422 authored by Dominik Adamski's avatar Dominik Adamski
Browse files

[OpenMP][MLIR] Add OpenMP version attribute to OMP OffloadModuleInterface

The intent of OpenMP version attribute is to be applied to a module
and then hold information on OpenMP version flag.

Information about OpenMP version can be specified in Clang
by flag -fopenmp-version and it is stored in LLVM-IR module metadata:
!llvm.module.flags = !{!0, !1}

!0 = !{i32 7, !"openmp", i32 51}

!1 = !{i32 7, !"openmp-device", i32 51}

OpenMP MLIR version attributes will allow to lower Flang frontend flag
to OpenMP MLIR code and then to LLVM IR.

There are two OpenMP MLIR version attributes. The first one "omp.version"
MLIR attribute corresponds to host OpenMP version. The second one
corresponds to "openmp-device" LLVM-IR  metadata. "openmp-device" LLVM-IR
metadata is attached only for offloaded code.

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

Reviewed By: kiranchandramohan
parent 0670470a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment