[PATCH] D59331: [OpenMP][Offloading][3/3] OpenMP GPU kernel optimizations

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 13 13:59:24 PDT 2019


jdoerfert created this revision.
jdoerfert added reviewers: ABataev, arpith-jacob, guraypp, gtbercea, hfinkel.
jdoerfert added projects: OpenMP, LLVM.

NOTE: Also see the '[RFC] Late (OpenMP) GPU code "SPMD-zation"' email thread.

This patch introduces an LLVM optimization for target regions (TRegions)
that tries to enable SPMD-mode or use custom state machines for the
kernels.

TRegion have been introduced in https://reviews.llvm.org/D59319 .

The interface is deliberately simple to be easily analyzable in the
middle end. Design decisions included:

- Hide all (complex) implementation choices in the runtime library but allow complete removal of the abstraction once the runtime is inlined.
- Provide all runtime calls with sufficient, easy encoded information.
- Make the LLVM optimization, even though tied to the TRegion interface, as general as possible.

Positive and negative examples for the LLVM optimization are provided in the

  `llvm/test/Transforms/OpenMP/to_SPMD_mode.ll`

and

  `llvm/test/Transforms/OpenMP/no_SPMD_mode.ll`

test files.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D59331

Files:
  llvm/include/llvm/InitializePasses.h
  llvm/include/llvm/LinkAllPasses.h
  llvm/include/llvm/Transforms/IPO.h
  llvm/lib/Transforms/IPO/CMakeLists.txt
  llvm/lib/Transforms/IPO/IPO.cpp
  llvm/lib/Transforms/IPO/OpenMPOpt.cpp
  llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
  llvm/test/Other/opt-O2-pipeline.ll
  llvm/test/Other/opt-O3-pipeline.ll
  llvm/test/Other/opt-Os-pipeline.ll
  llvm/test/Transforms/OpenMP/no_SPMD_mode.ll
  llvm/test/Transforms/OpenMP/to_SPMD_mode.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59331.190503.patch
Type: text/x-patch
Size: 142825 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190313/996328e2/attachment.bin>


More information about the llvm-commits mailing list