From edf9581e4c115178ff899fc2eb4bf046d736bc5a Mon Sep 17 00:00:00 2001 From: Siddharth Bhat Date: Tue, 1 Aug 2017 14:26:39 +0000 Subject: [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 --- polly/lib/CodeGen/PPCGCodeGeneration.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'polly/lib/CodeGen/PPCGCodeGeneration.cpp') 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( -- cgit v1.2.3