[PATCH] D147940: [Flang][OpenMP][OMPIRBuilder] Add lowering of TargetOp for device codegen

Sergio Afonso via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 10 07:07:45 PDT 2023


skatrak created this revision.
skatrak added reviewers: dpalermo, jsjodin, domada, agozillon, TIFitis, kiranchandramohan.
Herald added subscribers: bviyer, sunshaoce, Moerafaat, zero9178, bzcheeseman, awarzynski, sdasgup3, wenzhicui, wrengr, cota, teijeong, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, liufengdb, aartbik, mgester, arpith-jacob, antiagainst, shauheen, rriddle, mehdi_amini, thopre, guansong, hiraditya, yaxunl.
Herald added a reviewer: ftynse.
Herald added a project: All.
skatrak requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: nicolasvasilache.
Herald added subscribers: llvm-commits, jplehr, sstefan1, stephenneuendorffer, nicolasvasilache.
Herald added projects: MLIR, LLVM.

This patch adds support in the `OpenMPIRBuilder` for generating working
device code for OpenMP target regions. It generates and handles the
result of a call to `__kmpc_target_init()` at the beginning of the
function resulting from outlining each target region, and it also
generates the matching `__kmpc_target_deinit()` call before returning.

It relies on the implementation of target region outlining for host
codegen to handle the production of the new function and the lowering of
its body based on the contents of the associated target region.

Depends on D147172 <https://reviews.llvm.org/D147172>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147940

Files:
  llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
  llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
  mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147940.512140.patch
Type: text/x-patch
Size: 7636 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230410/aed96fc7/attachment-0001.bin>


More information about the llvm-commits mailing list