This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Avoid checking parent reference count in targetDataEnd
ClosedPublic

Authored by jdenny on Jun 25 2021, 8:36 AM.

Details

Summary

The patch has the following benefits:

  • Eliminates a lock/unlock of the data mapping table.
  • Clarifies the logic that determines whether a struct member's device-to-host transfer occurs. The old logic, which checks the parent struct's reference count, is a leftover from back when we had a different map interface (as pointed out at https://reviews.llvm.org/D104924#2846972).

Diff Detail

Event Timeline

jdenny created this revision.Jun 25 2021, 8:36 AM
jdenny requested review of this revision.Jun 25 2021, 8:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 25 2021, 8:36 AM
Herald added a subscriber: sstefan1. · View Herald Transcript

I'm also very curious about that. If and only if the parent struct's reference count 1.

grokos accepted this revision.Jun 29 2021, 6:26 AM

The new code is equivalent to the old one but clearer and with one fewer lock. Checking the parent struct is a leftover from back when we had a different map interface.

This revision is now accepted and ready to land.Jun 29 2021, 6:26 AM

The new code is equivalent to the old one but clearer and with one fewer lock. Checking the parent struct is a leftover from back when we had a different map interface.

Thanks! I'm going to integrate this comment into the commit log.

I'll soon propose a similar patch for targetDataBegin.

jdenny edited the summary of this revision. (Show Details)Jun 29 2021, 7:33 AM

Should I try to land this patch now? It's been accepted, but the similar D105121 has not and seemed to stir more controversy.

jdenny updated this revision to Diff 357618.Jul 9 2021, 1:34 PM

Rebased.