[PATCH] D102824: [OpenMP] Internalize functions in OpenMPOpt to improve IPO passes

Joseph Huber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 19 20:05:20 PDT 2021


jhuber6 created this revision.
jhuber6 added a reviewer: jdoerfert.
Herald added subscribers: okura, kuter, uenoku, guansong, hiraditya, yaxunl.
Herald added a reviewer: uenoku.
jhuber6 requested review of this revision.
Herald added a reviewer: sstefan1.
Herald added subscribers: llvm-commits, bbn, sstefan1.
Herald added a reviewer: baziotis.
Herald added a project: LLVM.

Currently the attributor needs to give up if a function has external linkage.
This means that the optimization introduced in D97818 <https://reviews.llvm.org/D97818> will only apply to static
functions. This change uses the Attributor to internalize OpenMP device
routines by making a copy of each function with private linkage and replacing
the uses in the module with it. This allows for the optimization to be applied
to any regular function.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D102824

Files:
  llvm/include/llvm/Transforms/IPO/Attributor.h
  llvm/lib/Transforms/IPO/Attributor.cpp
  llvm/lib/Transforms/IPO/OpenMPOpt.cpp
  llvm/test/Transforms/OpenMP/single_threaded_execution.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102824.346622.patch
Type: text/x-patch
Size: 6206 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210520/05525c1e/attachment.bin>


More information about the llvm-commits mailing list