This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Add an option to limit shared memory usage in OpenMPOpt
ClosedPublic

Authored by jhuber6 on Feb 17 2022, 12:50 PM.

Details

Summary

One of the optimizations performed in OpenMPOpt pushes globalized
variables to static shared memory. This is preferable to keeping the
runtime call in all cases, however if too many variables are pushed to
hared memory the kernel will crash. Since this is an optimization and
not something the user specified explicitly, there should be an option
to limit this optimization in those cases. This path introduces the
-openmp-opt-shared-limit= option to limit the amount of bytes that
will be placed in shared memory from HeapToShared.

Diff Detail

Event Timeline

jhuber6 created this revision.Feb 17 2022, 12:50 PM
jhuber6 requested review of this revision.Feb 17 2022, 12:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 17 2022, 12:50 PM
jdoerfert added inline comments.Feb 17 2022, 12:53 PM
llvm/lib/Transforms/IPO/OpenMPOpt.cpp
3010

What happens in non-assert builds, are statistics available to be used?

jhuber6 updated this revision to Diff 409758.Feb 17 2022, 1:00 PM

Add a new variable to hold the value since we use it unconditionatlly now.

jdoerfert accepted this revision.Feb 17 2022, 1:02 PM

LG, two nits

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

Add a debug message though.

3088

Add doxygen docs plz.

This revision is now accepted and ready to land.Feb 17 2022, 1:02 PM
jhuber6 updated this revision to Diff 409766.Feb 17 2022, 1:10 PM

Fixing nits

This revision was landed with ongoing or failed builds.Feb 18 2022, 5:35 AM
This revision was automatically updated to reflect the committed changes.