[PATCH] D144864: [Flang][Driver][MLIR] Add -fopenmp-is-device to Flang and link to an omp.is_device attribute

Andrew Gozillon via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 27 05:11:33 PST 2023


agozillon created this revision.
Herald added subscribers: sunshaoce, Moerafaat, zero9178, bzcheeseman, sdasgup3, wenzhicui, wrengr, cota, teijeong, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, liufengdb, aartbik, mgester, arpith-jacob, antiagainst, shauheen, rriddle, mehdi_amini, thopre, guansong, yaxunl.
Herald added a reviewer: sscalpone.
Herald added a reviewer: awarzynski.
Herald added projects: Flang, All.
agozillon requested review of this revision.
Herald added subscribers: cfe-commits, sstefan1, stephenneuendorffer, nicolasvasilache, jdoerfert, MaskRay.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: nicolasvasilache.
Herald added projects: clang, MLIR.

This patch adds the -fopenmp-is-device flag to Flang's FC1 and also
links it up to the application of an attribute to the mlir builtin.module
on lowering. Indiciating whether the module is for host or device.

This omp.is_device module attribute is a light weight adhoc attribute
with noconcrete ODS or class specification, similar to FIR and LLVM's
data_layout, defaultkind and kindmap's. Its intent is simply to carry
information for the moment, it affects transformations (or will in the
future) but does no transformations itself.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D144864

Files:
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/ToolChains/Flang.cpp
  clang/lib/Driver/ToolChains/Flang.h
  flang/include/flang/Frontend/LangOptions.def
  flang/lib/Frontend/CompilerInvocation.cpp
  flang/lib/Frontend/FrontendActions.cpp
  flang/test/Driver/driver-help.f90
  flang/tools/bbc/bbc.cpp
  mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
  mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144864.500740.patch
Type: text/x-patch
Size: 8612 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230227/af154be1/attachment.bin>


More information about the cfe-commits mailing list