[OpenMP] Enable HeapToStack conversion in OpenMPOpt for new RTL globalization calls
authorJoseph Huber <jhuber6@vols.utk.edu>
Mon, 7 Jun 2021 17:24:30 +0000 (13:24 -0400)
committerHuber, Joseph <huberjn@ornl.gov>
Tue, 22 Jun 2021 17:23:05 +0000 (13:23 -0400)
commit7d69da71dd35f91a5d4310b16940405e7f0c2f20
tree10af94c9153f85bc326846b947e974f9b0b085db
parent2662351e3b75052f3ab273b36ee7d64b5cb7cb85
[OpenMP] Enable HeapToStack conversion in OpenMPOpt for new RTL globalization calls

Summary:
The changes to globalization introduced in D97680 introduce a large amount of overhead by default. The old globalization method would always ignore globalization code if executing in SPMD mode. This wasn't strictly correct as data sharing is still possible in SPMD mode. The new interface is correct but introduces globalization code even when unnecessary. This optimization will use the existing HeapToStack transformation in the attributor to allow for unneeded globalization to be replaced with thread-private stack memory. This is done using the newly introduced library instances for the RTL functions added in D102087.

Depends on D97818

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D102197
llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
llvm/lib/Transforms/IPO/OpenMPOpt.cpp
llvm/test/Transforms/OpenMP/gpu_state_machine_function_ptr_replacement.ll
llvm/test/Transforms/OpenMP/remove_globalization.ll [new file with mode: 0644]
llvm/test/Transforms/PhaseOrdering/openmp-opt-module.ll