This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Enable HeapToStack conversion in OpenMPOpt for new RTL globalization calls
ClosedPublic

Authored by jhuber6 on May 10 2021, 2:06 PM.

Details

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

Diff Detail

Event Timeline

jhuber6 created this revision.May 10 2021, 2:06 PM
jhuber6 requested review of this revision.May 10 2021, 2:06 PM
Herald added a reviewer: baziotis. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
jdoerfert accepted this revision.May 10 2021, 4:39 PM

LGTM, two nits

llvm/lib/Transforms/IPO/OpenMPOpt.cpp
1653

Run heap two stack for all functions if we have at least one kernel.

llvm/test/Transforms/OpenMP/remove_globalization.ll
2

use the update script please.

This revision is now accepted and ready to land.May 10 2021, 4:39 PM
jhuber6 updated this revision to Diff 344540.May 11 2021, 12:41 PM
jhuber6 updated this revision to Diff 347100.May 21 2021, 12:17 PM
jhuber6 edited the summary of this revision. (Show Details)

Rebasing on D97818 as they mutually invalidated eachother's tests when combined.

jhuber6 updated this revision to Diff 350301.Jun 7 2021, 8:18 AM
jhuber6 edited the summary of this revision. (Show Details)

Rebasing and fixing test.

jhuber6 updated this revision to Diff 350371.Jun 7 2021, 11:38 AM

Fixing test from D98608.

This revision was landed with ongoing or failed builds.Jun 22 2021, 10:23 AM
This revision was automatically updated to reflect the committed changes.