[PATCH] D28870: [OpenMP] Add an OpenMP pass for redundant runtime library call removal

Lingda Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 18 13:26:17 PST 2017


lildmh created this revision.
Herald added subscribers: mgorny, mehdi_amini, sanjoy.
Herald added a reviewer: deadalnix.

This patch implements redundant OpenMP barrier & flush calls removal to optimize OpenMP performance. There are implicit barrier & flush calls in many places for OpenMP programs (e.g., at the end of a parallel region). Together with explicit calls written by programmers, it is possible to have redundant barrier & flush calls, which can adversely affect performance. Currently there is no mechanism in LLVM to eliminate these redundant calls. In this patch, we create a transformation pass to check all barrier and flush calls within a basic block and see if they are necessary. If not, they are removed from the program. We also plan to continue developing this code to handle more complex situations.


https://reviews.llvm.org/D28870

Files:
  include/llvm-c/Transforms/Scalar.h
  include/llvm/InitializePasses.h
  include/llvm/LinkAllPasses.h
  include/llvm/Transforms/Scalar.h
  include/llvm/Transforms/Scalar/RemoveOpenMPRedundancies.h
  lib/Passes/PassBuilder.cpp
  lib/Passes/PassRegistry.def
  lib/Transforms/IPO/PassManagerBuilder.cpp
  lib/Transforms/Scalar/CMakeLists.txt
  lib/Transforms/Scalar/RemoveOpenMPRedundancies.cpp
  lib/Transforms/Scalar/Scalar.cpp
  test/Transforms/RemoveOpenMPRedundancies/simple.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28870.84874.patch
Type: text/x-patch
Size: 16743 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170118/4ac8e676/attachment.bin>


More information about the llvm-commits mailing list