diff options
| -rw-r--r-- | polly/lib/CodeGen/BlockGenerators.cpp | 2 | ||||
| -rw-r--r-- | polly/lib/CodeGen/IslNodeBuilder.cpp | 8 | ||||
| -rw-r--r-- | polly/test/Isl/CodeGen/OpenMP/loop-body-references-outer-values.ll | 2 | ||||
| -rw-r--r-- | polly/test/Isl/CodeGen/OpenMP/single_loop.ll | 2 | ||||
| -rw-r--r-- | polly/test/Isl/CodeGen/phi_loop_carried_float.ll | 1 | ||||
| -rw-r--r-- | polly/test/Isl/CodeGen/phi_loop_carried_float_escape.ll | 1 | ||||
| -rw-r--r-- | polly/test/Isl/CodeGen/phi_scalar_simple_1.ll | 2 | ||||
| -rw-r--r-- | polly/test/Isl/CodeGen/phi_scalar_simple_2.ll | 1 |
8 files changed, 15 insertions, 4 deletions
diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp index 8de5f5970f1..ce7a32e93f7 100644 --- a/polly/lib/CodeGen/BlockGenerators.cpp +++ b/polly/lib/CodeGen/BlockGenerators.cpp @@ -484,7 +484,7 @@ void BlockGenerator::createScalarInitialization(Scop &S) { if (StartBB == R.getEntry()) StartBB = SplitBBTerm->getSuccessor(1); - Builder.SetInsertPoint(StartBB->begin()); + Builder.SetInsertPoint(StartBB->getTerminator()); for (auto &Pair : S.arrays()) { auto &Array = Pair.second; diff --git a/polly/lib/CodeGen/IslNodeBuilder.cpp b/polly/lib/CodeGen/IslNodeBuilder.cpp index 85c92402dcd..1574e6167f0 100644 --- a/polly/lib/CodeGen/IslNodeBuilder.cpp +++ b/polly/lib/CodeGen/IslNodeBuilder.cpp @@ -534,6 +534,14 @@ void IslNodeBuilder::createForParallel(__isl_take isl_ast_node *For) { Value *IV; CmpInst::Predicate Predicate; + // The preamble of parallel code interacts different than normal code with + // e.g., scalar initialization. Therefore, we ensure the parallel code is + // separated from the last basic block. + BasicBlock *ParBB = + SplitBlock(Builder.GetInsertBlock(), Builder.GetInsertPoint(), &DT, &LI); + ParBB->setName("polly.parallel.for"); + Builder.SetInsertPoint(ParBB->begin()); + Body = isl_ast_node_for_get_body(For); Init = isl_ast_node_for_get_init(For); Inc = isl_ast_node_for_get_inc(For); diff --git a/polly/test/Isl/CodeGen/OpenMP/loop-body-references-outer-values.ll b/polly/test/Isl/CodeGen/OpenMP/loop-body-references-outer-values.ll index cb7e4e37c93..af564d00514 100644 --- a/polly/test/Isl/CodeGen/OpenMP/loop-body-references-outer-values.ll +++ b/polly/test/Isl/CodeGen/OpenMP/loop-body-references-outer-values.ll @@ -14,7 +14,7 @@ ; AST: for (int c0 = 0; c0 <= 99; c0 += 1) ; AST: Stmt_for_body(c0); -; IR-LABEL: polly.start: +; IR-LABEL: polly.parallel.for: ; IR-NEXT: %0 = bitcast { float* }* %polly.par.userContext to i8* ; IR-NEXT: call void @llvm.lifetime.start(i64 8, i8* %0) ; IR-NEXT: %1 = getelementptr inbounds { float* }, { float* }* %polly.par.userContext, i32 0, i32 0 diff --git a/polly/test/Isl/CodeGen/OpenMP/single_loop.ll b/polly/test/Isl/CodeGen/OpenMP/single_loop.ll index e15a24c1b44..32239031440 100644 --- a/polly/test/Isl/CodeGen/OpenMP/single_loop.ll +++ b/polly/test/Isl/CodeGen/OpenMP/single_loop.ll @@ -30,7 +30,7 @@ ; IR-NEXT: entry ; IR-NEXT: %polly.par.userContext = alloca -; IR-LABEL: polly.start: +; IR-LABEL: polly.parallel.for: ; IR-NEXT: %0 = bitcast {}* %polly.par.userContext to i8* ; IR-NEXT: call void @llvm.lifetime.start(i64 0, i8* %0) ; IR-NEXT: %polly.par.userContext1 = bitcast {}* %polly.par.userContext to i8* diff --git a/polly/test/Isl/CodeGen/phi_loop_carried_float.ll b/polly/test/Isl/CodeGen/phi_loop_carried_float.ll index 6ebbc503ebf..c5bcf36b5ed 100644 --- a/polly/test/Isl/CodeGen/phi_loop_carried_float.ll +++ b/polly/test/Isl/CodeGen/phi_loop_carried_float.ll @@ -17,6 +17,7 @@ ; CHECK-NEXT: ret ; CHECK-LABEL: polly.start: +; CHECK-NEXT: sext ; CHECK-NEXT: store float 0.000000e+00, float* %tmp.0.phiops ; CHECK-LABEL: polly.merge2: diff --git a/polly/test/Isl/CodeGen/phi_loop_carried_float_escape.ll b/polly/test/Isl/CodeGen/phi_loop_carried_float_escape.ll index 1bb51b40026..d0c582e109f 100644 --- a/polly/test/Isl/CodeGen/phi_loop_carried_float_escape.ll +++ b/polly/test/Isl/CodeGen/phi_loop_carried_float_escape.ll @@ -16,6 +16,7 @@ ; CHECK-NEXT: br label %exit ; CHECK-LABEL: polly.start: +; CHECK-NEXT: sext ; CHECK-NEXT: store float 0.000000e+00, float* %tmp.0.phiops ; CHECK-LABEL: polly.merge2: diff --git a/polly/test/Isl/CodeGen/phi_scalar_simple_1.ll b/polly/test/Isl/CodeGen/phi_scalar_simple_1.ll index 01189aafbf8..1fb1d00f27f 100644 --- a/polly/test/Isl/CodeGen/phi_scalar_simple_1.ll +++ b/polly/test/Isl/CodeGen/phi_scalar_simple_1.ll @@ -26,7 +26,7 @@ entry: ; CHECK: ret i32 %x.addr.0.merge ; CHECK-LABEL: polly.start: -; CHECK-NEXT: store i32 %x, i32* %x.addr.0.phiops +; CHECK: store i32 %x, i32* %x.addr.0.phiops ; CHECK-LABEL: polly.merge: ; CHECK: %x.addr.0.final_reload = load i32, i32* %x.addr.0.s2a diff --git a/polly/test/Isl/CodeGen/phi_scalar_simple_2.ll b/polly/test/Isl/CodeGen/phi_scalar_simple_2.ll index afc921ac285..3c23145095b 100644 --- a/polly/test/Isl/CodeGen/phi_scalar_simple_2.ll +++ b/polly/test/Isl/CodeGen/phi_scalar_simple_2.ll @@ -28,6 +28,7 @@ entry: ; CHECK: ret i32 %x.addr.0.merge ; CHECK-LABEL: polly.start: +; CHECK-NEXT: sext ; CHECK-NEXT: store i32 %x, i32* %x.addr.0.phiops ; CHECK-LABEL: polly.merge21: |

