[PATCH] D148038: [Flang][OpenMP][Driver][MLIR] Port fopenmp-host-ir-file-path flag and add MLIR module attribute to proliferate to OpenMP IR lowering

Andrew Gozillon via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 11 12:35:03 PDT 2023


agozillon created this revision.
Herald added subscribers: bviyer, 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 a reviewer: kiranchandramohan.
Herald added projects: Flang, All.
agozillon requested review of this revision.
Herald added subscribers: cfe-commits, jplehr, sstefan1, stephenneuendorffer, nicolasvasilache, jdoerfert, MaskRay.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: nicolasvasilache.
Herald added projects: clang, MLIR.

This patch ports the fopenmp-host-ir-file-path flag from Clang to Flang-new, this flag is added by the driver to the device pass when doing two phase compilation (device + host).

This flag is then applied to the module when compiling during the OpenMP device phase. This file can then be utilised during lowering of the OpenMP dialect to LLVM-IR, which allows the device and host to maintain 1:1 mapping of OpenMP metadata for variables during lowering via the OpenMPIRBuilders loadOffloadInfoMetadata facilities (which is used for declare target and I believe target regions as well).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D148038

Files:
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/ToolChains/Flang.cpp
  flang/include/flang/Frontend/LangOptions.h
  flang/include/flang/Tools/CrossToolHelpers.h
  flang/lib/Frontend/CompilerInvocation.cpp
  flang/test/Driver/driver-help.f90
  flang/test/Driver/omp-frontend-forwarding.f90
  flang/test/Lower/OpenMP/omp-host-ir-flag.f90
  mlir/include/mlir/Dialect/OpenMP/OpenMPOpsInterfaces.td

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148038.512552.patch
Type: text/x-patch
Size: 12202 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230411/c9b4f90d/attachment.bin>


More information about the cfe-commits mailing list