This is an archive of the discontinued LLVM Phabricator instance.

[OpenMPOpt] Expand SPMDization with guarding for target parallel regions
ClosedPublic

Authored by ggeorgakoudis on Jul 27 2021, 10:34 AM.

Details

Summary

This patch expands SPMDization (converting generic execution mode to SPMD for target regions) by guarding code regions that should be executed only by the main thread. Specifically, it generates guarded regions, which only the main thread executes, and the synchronization with worker threads using simple barriers. For correctness, the patch aborts SPMDization for target regions if the same code executes in a parallel region, thus must be not be guarded. This check is implemented using the ParallelLevels AA.

Diff Detail

Event Timeline

ggeorgakoudis created this revision.Jul 27 2021, 10:34 AM
ggeorgakoudis requested review of this revision.Jul 27 2021, 10:34 AM
Herald added a reviewer: sstefan1. · View Herald Transcript
Herald added a reviewer: baziotis. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript

Does this have a test?

we also need a commit message

ggeorgakoudis edited the summary of this revision. (Show Details)Jul 27 2021, 9:11 PM
jhuber6 accepted this revision.Jul 28 2021, 3:27 PM

LGTM

This revision is now accepted and ready to land.Jul 28 2021, 3:27 PM

Rebase, update tests

This revision was landed with ongoing or failed builds.Aug 4 2021, 11:49 AM
This revision was automatically updated to reflect the committed changes.