[PATCH] D90670: Simplifying memory globalization from the front end to move optimizations to the middle end.

Jose Manuel Monsalve Diaz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 2 22:42:28 PST 2020


josemonsalve2 created this revision.
josemonsalve2 added a reviewer: jdoerfert.
Herald added projects: clang, OpenMP, LLVM.
Herald added subscribers: llvm-commits, openmp-commits, cfe-commits.
josemonsalve2 requested review of this revision.
Herald added a subscriber: sstefan1.

Memory globalization was fully implemented in the front end. There are three runtime
functions in Libomptarget:

- __kmpc_data_sharing_push_stack
- __kmpc_data_sharing_coalesced_push_stack
- __kmpc_data_sharing_pop_stack

The front end performed a scape analysis and created a record declare with all the stack
variables. Then, based on the context (isTTD and other parameters) it would create a push
for the size of the record, or for that size multiplied by the WARP (to globalize for the 
whole WARP.

This PR removes the record creation, and it simplifies the front end to be a simple runtime
call that will be later on optimized in the middle end. The middle end will be able to 
determine the stack variables that do scape, and those that do not, as well as the 
approrpiate merging of different globalized variables


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90670

Files:
  clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
  clang/lib/CodeGen/CGOpenMPRuntimeGPU.h
  llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
  openmp/libomptarget/deviceRTLs/common/src/data_sharing.cu
  openmp/libomptarget/deviceRTLs/interface.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90670.302467.patch
Type: text/x-patch
Size: 29630 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201103/224b794d/attachment-0001.bin>


More information about the cfe-commits mailing list