summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen/PPCGCodeGeneration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'polly/lib/CodeGen/PPCGCodeGeneration.cpp')
-rw-r--r--polly/lib/CodeGen/PPCGCodeGeneration.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
index fcfc9ff6c8f..de261fcf172 100644
--- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp
+++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
@@ -192,6 +192,8 @@ void GPUNodeBuilder::createKernel(__isl_take isl_ast_node *KernelStmt) {
createKernelFunction(Kernel);
+ create(isl_ast_node_copy(Kernel->tree));
+
Builder.SetInsertPoint(&HostInsertPoint);
IDToValue = HostIDs;
@@ -304,8 +306,12 @@ void GPUNodeBuilder::createKernelFunction(ppcg_kernel *Kernel) {
Function *FN = createKernelFunctionDecl(Kernel);
+ BasicBlock *PrevBlock = Builder.GetInsertBlock();
auto EntryBlock = BasicBlock::Create(Builder.getContext(), "entry", FN);
+ DominatorTree &DT = P->getAnalysis<DominatorTreeWrapperPass>().getDomTree();
+ DT.addNewBlock(EntryBlock, PrevBlock);
+
Builder.SetInsertPoint(EntryBlock);
Builder.CreateRetVoid();
Builder.SetInsertPoint(EntryBlock, EntryBlock->begin());
OpenPOWER on IntegriCloud