diff options
| author | Tobias Grosser <tobias@grosser.es> | 2016-08-09 15:34:59 +0000 |
|---|---|---|
| committer | Tobias Grosser <tobias@grosser.es> | 2016-08-09 15:34:59 +0000 |
| commit | 776700d0b7cfa67e99d07af5cd9adf0ae7846fff (patch) | |
| tree | 2dfeb3c250f7cd6710fbdeb35858895f10a43579 /polly/lib/CodeGen | |
| parent | 8cef2c2f2dd94e9e8aa84f254bf3efdbf216cd03 (diff) | |
| download | bcm5719-llvm-776700d0b7cfa67e99d07af5cd9adf0ae7846fff.tar.gz bcm5719-llvm-776700d0b7cfa67e99d07af5cd9adf0ae7846fff.zip | |
[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
Diffstat (limited to 'polly/lib/CodeGen')
| -rw-r--r-- | polly/lib/CodeGen/BlockGenerators.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp index c5758fb7013..982d7e7546f 100644 --- a/polly/lib/CodeGen/BlockGenerators.cpp +++ b/polly/lib/CodeGen/BlockGenerators.cpp @@ -484,7 +484,7 @@ void BlockGenerator::createScalarInitialization(Scop &S) { if (StartBB == S.getEntry()) StartBB = SplitBBTerm->getSuccessor(1); - Builder.SetInsertPoint(StartBB->getTerminator()); + Builder.SetInsertPoint(&*StartBB->begin()); for (auto &Array : S.arrays()) { if (Array->getNumberOfDimensions() != 0) |

