[Polly] Use VirtualUse to determine references.
authorMichael Kruse <llvm-project@meinersbur.de>
Sat, 25 Sep 2021 06:03:36 +0000 (01:03 -0500)
committerMichael Kruse <llvm-project@meinersbur.de>
Sun, 26 Sep 2021 08:26:43 +0000 (03:26 -0500)
commitd5c87162db7763c89160dc66894bebf3bd1e90d7
tree301340ff76b5580b6b425ec8d0e023323b445047
parent1cea25eec90e355c9b072edc1b6e1e9903d7bca4
[Polly] Use VirtualUse to determine references.

VirtualUse ensures consistency over different source of values with
Polly. In particular, this enables its use of instructions moved between
Statement. Before the patch, the code wrongly assumed that the BB's
instructions are also the ScopStmt's instructions. Reference are
determined for OpenMP outlining and GPGPU kernel extraction.

GPGPU CodeGen had some problems. For one, it generated GPU kernel
parameters for constants. Second, it emitted GPU-side invariant loads
which have already been loaded by the host. This has been partially
fixed, it still generates a store for the invariant load result, but
using the value that the host has already written.

WARNING: I did not test the generated PollyACC code on an actual GPU.

The improved consistency will be made use of in the next patch.
polly/include/polly/CodeGen/IslNodeBuilder.h
polly/lib/CodeGen/IslNodeBuilder.cpp
polly/test/GPGPU/invariant-load-hoisting-read-in-kernel.ll
polly/test/GPGPU/invariant-load-of-scalar.ll
polly/test/GPGPU/phi-nodes-in-kernel.ll