[PATCH] D97818: [OpenMP] Remove GPU globalization calls in the middle-end

Joseph Huber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 2 16:34:58 PST 2021


jhuber6 created this revision.
jhuber6 added a reviewer: jdoerfert.
jhuber6 added projects: LLVM, OpenMP.
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.

The changes introduced in D97680 <https://reviews.llvm.org/D97680> create a simpler interface to code that needs to be globalized. This interface is used to simplify the globalization calls in the middle end. We can build an abstract attribute on the call site of the globalization function and run a fixed-point analysis using the Attributor to determine if any calls capture the memory that's been globalized. If the result is that there is no capturing, then the globalization call can be simply replaced with an alloca instruction because that memory cannot escape the thread and does not need globalization.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97818

Files:
  llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
  llvm/lib/Transforms/IPO/AttributorAttributes.cpp
  llvm/lib/Transforms/IPO/OpenMPOpt.cpp
  llvm/test/Transforms/OpenMP/remove_globalization.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97818.327626.patch
Type: text/x-patch
Size: 6230 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210303/c79e7f40/attachment.bin>


More information about the llvm-commits mailing list