gpu: avoid copying data to/from global memory that is local to statement
commit1d8cc65eed68439e77344e9c27406d9088f6a7b2
authorSven Verdoolaege <skimo@kotnet.org>
Thu, 1 Jan 2015 22:23:39 +0000 (1 23:23 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Tue, 13 Jan 2015 10:26:26 +0000 (13 11:26 +0100)
tree6d6720611ab4a9567a57c5135ca00bb951407c12
parentfa76a1b86af88a62c29212314d191189c5747f38
gpu: avoid copying data to/from global memory that is local to statement

Ever since c27d9a3 (avoid copying data to/from global memory that is
only used internally, Fri Feb 22 16:53:08 2013 +0100), we try and avoid
copying data to/from global memory that is known to be only used
inside a single instance of a kernel, by removing those data elements
that are only used in dataflow within such an instance.

However, in order not to needlessly break up the set of accessed
elements into smaller pieces, we only perform this restriction
if there are actually any data elements involved in local dataflow.
Unfortunately, this means the optimization is also skipped
if the accesses are not involved in any dataflow.
In particular, this may happen if the dataflow only occurs
within the same (compound) statement instance.

Try and handle those cases to some extent by at least removing
accesses from statements that are not involved in any dataflow.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
gpu.c