• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt %loadPolly -polly-parallel -polly-vectorizer=stripmine -polly-codegen-verify -polly-opt-isl -polly-ast -polly-codegen -analyze < %s | FileCheck %s
2;
3; Check that there are no nested #pragma omp parallel for inside a
4; #pragma omp parallel for loop.
5; See llvm.org/PR38073 and llvm.org/PR33153
6;
7; This test unfortunately is very dependent on the result of the schedule
8; optimizer (-polly-opt-isl).
9;
10target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
11
12@b = external dso_local unnamed_addr global [1984 x [1984 x double]], align 16
13@c = external dso_local unnamed_addr global [1984 x [1984 x double]], align 16
14
15define dso_local void @main() local_unnamed_addr {
16entry:
17  %cond = select i1 undef, i32 undef, i32 1984
18  %tmp = zext i32 %cond to i64
19  %cond63 = select i1 undef, i32 undef, i32 1984
20  %tmp1 = zext i32 %cond63 to i64
21  br label %for.cond51.preheader
22
23for.cond51.preheader:
24  %indvars.iv213 = phi i64 [ 0, %entry ], [ %indvars.iv.next214, %for.inc98 ]
25  %cond73 = select i1 undef, i32 undef, i32 1984
26  %tmp2 = zext i32 %cond73 to i64
27  br label %for.cond56.preheader
28
29for.cond56.preheader:
30  %indvars.iv223 = phi i64 [ 0, %for.cond51.preheader ], [ %indvars.iv.next224, %for.inc95 ]
31  br label %for.cond66.preheader
32
33for.cond66.preheader:
34  %indvars.iv219 = phi i64 [ %indvars.iv.next220, %for.inc92 ], [ 0, %for.cond56.preheader ]
35  br label %for.body75
36
37for.body75:
38  %indvars.iv215 = phi i64 [ %indvars.iv213, %for.cond66.preheader ], [ %indvars.iv.next216, %for.body75 ]
39  %arrayidx83 = getelementptr inbounds [1984 x [1984 x double]], [1984 x [1984 x double]]* @b, i64 0, i64 %indvars.iv219, i64 %indvars.iv215
40  %tmp3 = load double, double* %arrayidx83, align 8
41  %arrayidx87 = getelementptr inbounds [1984 x [1984 x double]], [1984 x [1984 x double]]* @c, i64 0, i64 %indvars.iv223, i64 %indvars.iv215
42  store double undef, double* %arrayidx87, align 8
43  %indvars.iv.next216 = add nuw nsw i64 %indvars.iv215, 1
44  %cmp74 = icmp ult i64 %indvars.iv.next216, %tmp2
45  br i1 %cmp74, label %for.body75, label %for.inc92
46
47for.inc92:
48  %indvars.iv.next220 = add nuw nsw i64 %indvars.iv219, 1
49  %cmp64 = icmp ult i64 %indvars.iv.next220, %tmp1
50  br i1 %cmp64, label %for.cond66.preheader, label %for.inc95
51
52for.inc95:
53  %indvars.iv.next224 = add nuw nsw i64 %indvars.iv223, 1
54  %cmp54 = icmp ult i64 %indvars.iv.next224, %tmp
55  br i1 %cmp54, label %for.cond56.preheader, label %for.inc98
56
57for.inc98:
58  %indvars.iv.next214 = add nuw nsw i64 %indvars.iv213, 48
59  br label %for.cond51.preheader
60}
61
62; No parallel loop except the to outermost.
63; CHECK: #pragma omp parallel for
64; CHECK: #pragma omp parallel for
65; CHECK-NOT: #pragma omp parallel for
66