Introduce VirtualUse. NFC.
authorMichael Kruse <llvm@meinersbur.de>
Thu, 4 May 2017 15:22:57 +0000 (15:22 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Thu, 4 May 2017 15:22:57 +0000 (15:22 +0000)
commiteedae7630aeb02d6d2184e511802e600764bcc23
tree5cdaf4d20ec0a0d42d3e56fe45a99bd5034d1369
parent4ef0370e6dbd6fb995eb89ad943a93e0995aed44
Introduce VirtualUse. NFC.

If a ScopStmt references a (scalar) value, there are multiple
possibilities where this value can come. The decision about what kind of
use it is must be handled consistently at different places, which can be
error-prone. VirtualUse is meant to centralize the handling of the
different types of value uses.

This patch makes ScopBuilder and CodeGeneration use VirtualUse. This
already helps to show inconsistencies with the value handling. In order
to keep this patch NFC, exceptions to the general rules are added.
These might be fixed later if they turn to problems. Overall, this
should result in fewer post-codegen IR-verification errors, but instead
assertion failures in `getNewValue` that are closer to the actual error.

Differential Revision: https://reviews.llvm.org/D32667

llvm-svn: 302157
polly/include/polly/Support/VirtualInstruction.h [new file with mode: 0644]
polly/lib/Analysis/ScopBuilder.cpp
polly/lib/CMakeLists.txt
polly/lib/CodeGen/BlockGenerators.cpp
polly/lib/Support/VirtualInstruction.cpp [new file with mode: 0644]