This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Initialize data sharing stack for SPMD case
ClosedPublic

Authored by gtbercea on Jul 11 2018, 7:54 AM.

Details

Summary

In the SPMD case, we need to initialize the data sharing and globalization infrastructure. This covers the case when an SPMD region calls a function in a different compilation unit.

Diff Detail

Repository
rL LLVM

Event Timeline

gtbercea created this revision.Jul 11 2018, 7:54 AM
gtbercea retitled this revision from [OpenMP] Initialize data sharing for SPMD case to [OpenMP] Initialize data sharing stack for SPMD case.Jul 11 2018, 7:55 AM
gtbercea updated this revision to Diff 155002.Jul 11 2018, 8:06 AM

Fix test.

What about the check for the new function call?

Hahnfeld added inline comments.
lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
84–85 ↗(On Diff #155002)

In case I'm not missing something obvious this function doesn't exist (yet) in libomptarget-nvptx?

1110–1114 ↗(On Diff #155002)

Why is this call being removed? There's no mention in the summary AFAICS

gtbercea updated this revision to Diff 155037.Jul 11 2018, 11:26 AM

Add test for spmd stack init function.

gtbercea marked 2 inline comments as done.Jul 11 2018, 11:44 AM
gtbercea added inline comments.
lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
84–85 ↗(On Diff #155002)

Correct. There's a libomptarget patch coming up as well.

1110–1114 ↗(On Diff #155002)

Not needed on workers after libomptarget patch. I could perhaps put this into a separate patch along with the test fix.

gtbercea marked 2 inline comments as done.Jul 11 2018, 1:27 PM
ABataev added inline comments.Jul 12 2018, 1:34 PM
test/OpenMP/nvptx_data_sharing.cpp
33 ↗(On Diff #155037)

It is better to check that this call is not emitted, like this CK1-NOT: call void @__kmpc_data_sharing_init_stack

test/OpenMP/nvptx_data_sharing_spmd.cpp
1–24 ↗(On Diff #155037)

I think we already have some tests with SPMD construct, you can just modify the existing tests instead of adding another one (e.g. nvptx_target_parallel_codegen.cpp)

gtbercea updated this revision to Diff 155391.Jul 13 2018, 8:12 AM

Fix tests.

gtbercea marked an inline comment as done.Jul 13 2018, 8:13 AM
This revision is now accepted and ready to land.Jul 13 2018, 8:15 AM
This revision was automatically updated to reflect the committed changes.