1 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-parallel -polly-parallel-force -polly-ast -analyze < %s | FileCheck %s -check-prefix=AST
2 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-parallel -polly-parallel-force -polly-codegen-isl -S -verify-dom-info < %s | FileCheck %s -check-prefix=IR
4 ; This test case verifies that we create correct code even if two OpenMP loops
5 ; share common outer variables.
7 ; AST: if (nj >= p_1 + 3) {
9 ; AST: #pragma omp parallel for
10 ; AST: for (int c0 = 0; c0 < p_0 + nj - 1; c0 += 1)
11 ; AST: Stmt_for_body35(c0);
14 ; AST: #pragma omp parallel for
15 ; AST: for (int c0 = 0; c0 <= p_0 + p_1; c0 += 1)
16 ; AST: Stmt_for_body35(c0);
18 ; IR: @foo.polly.subfn
19 ; IR: @foo.polly.subfn1
21 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
22 target triple = "x86_64-unknown-linux-gnu"
24 define void @foo(i64 %nj, [512 x double]* %R) {
26 br label %for.cond1.preheader
29 %k.014 = phi i64 [ %inc87, %for.inc86 ], [ 0, %entry ]
30 %j.010 = add nsw i64 %k.014, 1
31 br i1 undef, label %for.body35, label %for.inc86
34 %j.012 = phi i64 [ %j.0, %for.body35 ], [ %j.010, %for.cond1.preheader ]
35 %arrayidx39 = getelementptr inbounds [512 x double], [512 x double]* %R, i64 0, i64 %j.012
36 store double 0.000000e+00, double* %arrayidx39
37 %j.0 = add nsw i64 %j.012, 1
38 %cmp34 = icmp slt i64 %j.0, %nj
39 br i1 %cmp34, label %for.body35, label %for.inc86
42 %inc87 = add nsw i64 %k.014, 1
43 br i1 undef, label %for.cond1.preheader, label %for.end88