This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] libomptarget: Set ref count for global objects to positive infinity
ClosedPublic

Authored by grokos on Apr 20 2017, 4:36 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

grokos created this revision.Apr 20 2017, 4:36 PM
Hahnfeld added inline comments.Apr 20 2017, 11:08 PM
libomptarget/src/omptarget.cpp
1326–1327 ↗(On Diff #96053)

Shouldn't this be the other way round? If we already added this mapping before, just continue?

1331–1334 ↗(On Diff #96053)
  1. Are the casts neccessary?
  2. Please add a comment that the first addr is HostPtrBase while the second is HostPtrBegin
grokos updated this revision to Diff 96277.Apr 22 2017, 4:30 AM
grokos marked 2 inline comments as done.

Fixed bug.

libomptarget/src/omptarget.cpp
1326–1327 ↗(On Diff #96053)

Right, I overlooked this one...

1331–1334 ↗(On Diff #96053)

One of the casts is necessary. CurrHostEntry->addr is of type void *. In order to add to it the size of the entry (CurrHostEntry->addr + CurrHostEntry->size) it must be cast to an integral type. The other casts are optional, but it helps make clear that the entries of struct HostDataToTargetTy are of type uintptr_t.

This revision is now accepted and ready to land.Apr 22 2017, 4:48 AM
This revision was automatically updated to reflect the committed changes.