[Openmp-commits] [PATCH] D83271: [OpenMP] Replace function pointer uses in GPU state machine

Johannes Doerfert via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Jul 6 18:08:00 PDT 2020


jdoerfert created this revision.
jdoerfert added reviewers: jhuber6, fghanim, JonChesterfield, grokos, AndreyChurbanov, ye-luo, tianshilei1992, ggeorgakoudis.
Herald added subscribers: llvm-commits, aaron.ballman, sstefan1, guansong, bollu, hiraditya, yaxunl.
Herald added a project: LLVM.

In non-SPMD mode we create a state machine like code to identify the
parallel region the GPU worker threads should execute next. The
identification uses the parallel region function pointer as that allows
it to work even if the kernel (=target region) and the parallel region
are in separate TUs. However, taking the address of a function comes
with various downsides. With this patch we will identify the most common
situation and replace the function pointer use with a dummy global
symbol (for identification purposes only). That means, if the parallel
region is only called from a single target region (or kernel), we do not
use the function pointer of the parallel region to identify it but a new
global symbol.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83271

Files:
  llvm/lib/Transforms/IPO/OpenMPOpt.cpp
  llvm/test/Transforms/OpenMP/gpu_state_machine_function_ptr_replacement.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83271.275875.patch
Type: text/x-patch
Size: 18911 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20200707/6417d2f4/attachment-0001.bin>


More information about the Openmp-commits mailing list