summaryrefslogtreecommitdiff
path: root/polly/lib/CodeGen/PPCGCodeGeneration.cpp
diff options
context:
space:
mode:
authorSiddharth Bhat <siddu.druid@gmail.com>2017-08-01 14:26:39 +0000
committerSiddharth Bhat <siddu.druid@gmail.com>2017-08-01 14:26:39 +0000
commitedf9581e4c115178ff899fc2eb4bf046d736bc5a (patch)
tree0ffafca34f386aea8370567f6da9ae7abe9e3ad6 /polly/lib/CodeGen/PPCGCodeGeneration.cpp
parentb5cb48c6ae16d6ffc54c7d7281160bcc4acdc4cb (diff)
[PPCGCodeGeneration] Correct usage of llvm::Value with getLatestValue.
It is possible that the `HostPtr` that coresponds to an array could be invariant load hoisted. Make sure we use the invariant load hoisted value by using `IslNodeBuilder::getLatestValue`. Differential Revision: https://reviews.llvm.org/D36001 llvm-svn: 309681
Diffstat (limited to 'polly/lib/CodeGen/PPCGCodeGeneration.cpp')
-rw-r--r--polly/lib/CodeGen/PPCGCodeGeneration.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
index bf4f66fcd1d2..a759c4d58ebb 100644
--- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp
+++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
@@ -1104,6 +1104,7 @@ Value *GPUNodeBuilder::getOrCreateManagedDeviceArray(gpu_array_info *Array,
HostPtr = BlockGen.getOrCreateAlloca(ArrayInfo);
else
HostPtr = ArrayInfo->getBasePtr();
+ HostPtr = getLatestValue(HostPtr);
Value *Offset = getArrayOffset(Array);
if (Offset) {
@@ -1137,6 +1138,7 @@ void GPUNodeBuilder::createDataTransfer(__isl_take isl_ast_node *TransferStmt,
HostPtr = BlockGen.getOrCreateAlloca(ScopArray);
else
HostPtr = ScopArray->getBasePtr();
+ HostPtr = getLatestValue(HostPtr);
if (Offset) {
HostPtr = Builder.CreatePointerCast(