[BlockGenerator] Insert initializations at beginning of start block
authorTobias Grosser <tobias@grosser.es>
Tue, 9 Aug 2016 15:34:59 +0000 (15:34 +0000)
committerTobias Grosser <tobias@grosser.es>
Tue, 9 Aug 2016 15:34:59 +0000 (15:34 +0000)
commit776700d0b7cfa67e99d07af5cd9adf0ae7846fff
tree2dfeb3c250f7cd6710fbdeb35858895f10a43579
parent8cef2c2f2dd94e9e8aa84f254bf3efdbf216cd03
[BlockGenerator] Insert initializations at beginning of start block

In case some code -- not guarded by control flow -- would be emitted directly in
the start block, it may happen that this code would use uninitalized scalar
values if the scalar initialization is only emitted at the end of the start
block. This is not a problem today in normal Polly, as all statements are
emitted in their own basic blocks, but Polly-ACC emits host-to-device copy
statements into the start block.

Additional Polly-ACC test coverage will be added in subsequent changes that
improve the handling of PHI nodes in Polly-ACC.

llvm-svn: 278124
polly/lib/CodeGen/BlockGenerators.cpp
polly/test/Isl/CodeGen/phi_loop_carried_float.ll
polly/test/Isl/CodeGen/phi_loop_carried_float_escape.ll
polly/test/Isl/CodeGen/phi_scalar_simple_2.ll