[PATCH] D83635: [OpenMPOpt][WIP] Merge parallel regions

Giorgis Georgakoudis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 11 17:58:16 PDT 2020


ggeorgakoudis created this revision.
Herald added subscribers: llvm-commits, bbn, aaron.ballman, sstefan1, jfb, guansong, hiraditya, yaxunl.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: sstefan1.
Herald added a reviewer: baziotis.
Herald added a project: LLVM.

There are cases that generated OpenMP code consists of multiple,
consecutive OpenMP parallel regions, either due to high-level
programming models, such as RAJA, Kokkos, lowering to OpenMP code, or
simply because the programmer parallelized code this way.  This
optimization merges consecutive parallel OpenMP regions to: (1) reduce
the runtime overhead of re-activating a team of threads; (2) enlarge the
scope for other OpenMP optimizations, e.g., runtime call deduplication
and synchronization elimination.

This implementation defensively merges parallel regions, only when they
are within the same BB and any in-between instructions are safe to
execute in parallel.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83635

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83635.277269.patch
Type: text/x-patch
Size: 38775 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200712/a93aebb4/attachment.bin>


More information about the llvm-commits mailing list