GPGPU: Dynamically ensure 'sufficient compute'
commit4c35366cf7d08dc76b353d43e14e628586636592
authorTobias Grosser <tobias@grosser.es>
Sun, 18 Sep 2016 06:50:35 +0000 (18 06:50 +0000)
committerTobias Grosser <tobias@grosser.es>
Sun, 18 Sep 2016 06:50:35 +0000 (18 06:50 +0000)
tree3ef5d6b88ecb233abecbd1dbceb08078b2d714b8
parent081a29fdd844ad83b6ca4b60b194274dc0fec896
GPGPU: Dynamically ensure 'sufficient compute'

Offloading to a GPU is only beneficial if there is a sufficient amount of
compute that can be accelerated. Many kernels just have a very small number
of dynamic compute, which means GPU acceleration is not beneficial. We
compute at run-time an approximation of how many dynamic instructions will be
executed and fall back to CPU code in case this number is not sufficiently
large. To keep the run-time checking code simple, we over-approximate the
number of instructions executed in each statement by computing the volume of
the rectangular hull of its iteration space.

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@281848 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/PPCGCodeGeneration.cpp
test/GPGPU/double-parallel-loop.ll