This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Avoid emitting maps for target link variables when unified memory is used
ClosedPublic

Authored by gtbercea on Apr 18 2019, 12:02 PM.

Diff Detail

Event Timeline

gtbercea created this revision.Apr 18 2019, 12:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 18 2019, 12:02 PM
ABataev added inline comments.Apr 18 2019, 12:42 PM
lib/CodeGen/CGOpenMPRuntime.cpp
8259

Hmm, what about regular declare target declarations? Also, this is not enough. You also should not capture such variables in the captured regions.

gtbercea updated this revision to Diff 200782.May 22 2019, 10:03 AM
  • Fix function call.
gtbercea marked an inline comment as done.May 22 2019, 10:06 AM
gtbercea added inline comments.
lib/CodeGen/CGOpenMPRuntime.cpp
8259

For now, only variables under the link clause are considered for unified memory usage.

gtbercea updated this revision to Diff 200818.May 22 2019, 2:09 PM
  • Include sema check.

Tests?

lib/CodeGen/CGOpenMPRuntime.h
1628

Do we need to make it virtual?

gtbercea updated this revision to Diff 201307.May 24 2019, 12:09 PM
  • Add test.

Just one question after looking at the test: how we're going to link the device variable to its host copy? I think the address should be passed to the runtime, no?

lib/CodeGen/CGOpenMPRuntime.h
1628

Still not answered

Just one question after looking at the test: how we're going to link the device variable to its host copy? I think the address should be passed to the runtime, no?

The runtime will take care of it by performing a copy of the host address into the device pointer.

gtbercea updated this revision to Diff 204780.Jun 14 2019, 9:01 AM
  • Remove virtual.
gtbercea marked 2 inline comments as done.Jun 14 2019, 9:01 AM
ABataev added inline comments.Jun 14 2019, 9:31 AM
lib/CodeGen/CGOpenMPRuntime.h
1628

You can make this function const.

gtbercea updated this revision to Diff 204806.Jun 14 2019, 10:35 AM
  • Make function const.
gtbercea marked an inline comment as done.Jun 14 2019, 10:36 AM
ABataev accepted this revision.Jun 14 2019, 10:46 AM
This revision is now accepted and ready to land.Jun 14 2019, 10:46 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2019, 10:55 AM