[OpenMP] Avoid costly shadow map traversals whenever possible
authorJoseph Huber <jhuber6@vols.utk.edu>
Fri, 10 Dec 2021 17:49:59 +0000 (12:49 -0500)
committerJoseph Huber <jhuber6@vols.utk.edu>
Fri, 10 Dec 2021 19:33:18 +0000 (14:33 -0500)
commit7c8f4e7b85ed98497f37571d72609f39a8eed447
tree0ad5968faac5f285fe194811e0f06f3cb446ca45
parent2a31b240df1ce1724960fd7cf98f673064b44206
[OpenMP] Avoid costly shadow map traversals whenever possible

In the OpenMC app we saw `omp target update` spending an awful lot of
time in the shadow map traversal without ever doing any update there.
There are two cases that allow us to avoid the traversal completely.
The simplest thing is that small updates cannot (reasonably) contain
an attached pointer part. The other case requires to track in the
mapping table if an entry might contain an attached pointer as part.
Given that we have a single location shadow map entries are created,
the latter is actually fairly easy as well.

Reviewed By: grokos

Differential Revision: https://reviews.llvm.org/D113124
openmp/libomptarget/src/api.cpp
openmp/libomptarget/src/device.cpp
openmp/libomptarget/src/device.h
openmp/libomptarget/src/omptarget.cpp