diff options
| author | Michael Kruse <llvm@meinersbur.de> | 2017-09-07 12:15:01 +0000 |
|---|---|---|
| committer | Michael Kruse <llvm@meinersbur.de> | 2017-09-07 12:15:01 +0000 |
| commit | 2f5cbc449a6371486982c20648975ee70894f71d (patch) | |
| tree | e423960eb64316459e9d2d5469dd2669e1d6296e /polly/lib/CodeGen/BlockGenerators.cpp | |
| parent | 7372d48c748711b5256d0cea95ab58810c65b1d8 (diff) | |
| download | bcm5719-llvm-2f5cbc449a6371486982c20648975ee70894f71d.tar.gz bcm5719-llvm-2f5cbc449a6371486982c20648975ee70894f71d.zip | |
[CodeGen] Bitcast scalar writes to actual value.
The type of NewValue might change due to ScalarEvolution
looking though bitcasts. The synthesized NewValue therefore
becomes the type before the bitcast.
llvm-svn: 312718
Diffstat (limited to 'polly/lib/CodeGen/BlockGenerators.cpp')
| -rw-r--r-- | polly/lib/CodeGen/BlockGenerators.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp index 5988fc88da0..53b6f500997 100644 --- a/polly/lib/CodeGen/BlockGenerators.cpp +++ b/polly/lib/CodeGen/BlockGenerators.cpp @@ -692,6 +692,13 @@ void BlockGenerator::generateScalarStores( DT.dominates(cast<Instruction>(Address)->getParent(), Builder.GetInsertBlock())) && "Domination violation"); + + // The new Val might have a different type than the old Val due to + // ScalarEvolution looking through bitcasts. + if (Val->getType() != Address->getType()->getPointerElementType()) + Address = Builder.CreateBitOrPointerCast( + Address, Val->getType()->getPointerTo()); + Builder.CreateStore(Val, Address); }); |

