This is an archive of the discontinued LLVM Phabricator instance.

Simplifying memory globalization from the front end to move optimizations to the middle end.
AbandonedPublic

Authored by josemonsalve2 on Nov 2 2020, 10:42 PM.

Details

Reviewers
jdoerfert
Summary

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

Diff Detail

Event Timeline

josemonsalve2 created this revision.Nov 2 2020, 10:42 PM
Herald added projects: Restricted Project, Restricted Project, Restricted Project. · View Herald TranscriptNov 2 2020, 10:42 PM
josemonsalve2 requested review of this revision.Nov 2 2020, 10:42 PM

Let's start by adding an updated test to this so we can see how the result looks.

Removing globalized record for parallel regions

When globalization occurs in parallel regions, a record was crerated that is not necessary anymore.
This is expected to be done in the back end.

I'm working on the other tests right now.

Modifying 3 more tests to reflect changes in this patch

josemonsalve2 abandoned this revision.Jul 26 2021, 1:33 PM
josemonsalve2 added a subscriber: jhuber6.

This has been completed by @jhuber6 in D97680