• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -S %loadPolly -basic-aa -polly-opt-isl -polly-opt-fusion=max -polly-ast -analyze < %s | FileCheck %s
2; RUN: opt -S %loadPolly -basic-aa -polly-opt-isl -polly-opt-fusion=max -polly-ast -analyze -polly-dependences-computeout=1 < %s | FileCheck %s -check-prefix=TIMEOUT
3target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
4
5;     for(i = 0; i < 100; i++ )
6; S1:   A[i] = 2;
7;
8;     for (i = 0; i < 10; i++ )
9; S2:   A[i]  = 5;
10;
11;     for (i = 0; i < 200; i++ )
12; S3:   A[i] = 5;
13
14define void @sequential_writes() {
15entry:
16  %A = alloca [200 x i32]
17  br label %S1
18
19S1:
20  %indvar.1 = phi i64 [ 0, %entry ], [ %indvar.next.1, %S1 ]
21  %arrayidx.1 = getelementptr [200 x i32], [200 x i32]* %A, i64 0, i64 %indvar.1
22  store i32 2, i32* %arrayidx.1
23  %indvar.next.1 = add i64 %indvar.1, 1
24  %exitcond.1 = icmp ne i64 %indvar.next.1, 100
25  br i1 %exitcond.1, label %S1, label %exit.1
26
27exit.1:
28  br label %S2
29
30S2:
31  %indvar.2 = phi i64 [ 0, %exit.1 ], [ %indvar.next.2, %S2 ]
32  %arrayidx.2 = getelementptr [200 x i32], [200 x i32]* %A, i64 0, i64 %indvar.2
33  store i32 5, i32* %arrayidx.2
34  %indvar.next.2 = add i64 %indvar.2, 1
35  %exitcond.2 = icmp ne i64 %indvar.next.2, 10
36  br i1 %exitcond.2, label %S2, label %exit.2
37
38exit.2:
39  br label %S3
40
41S3:
42  %indvar.3 = phi i64 [ 0, %exit.2 ], [ %indvar.next.3, %S3 ]
43  %arrayidx.3 = getelementptr [200 x i32], [200 x i32]* %A, i64 0, i64 %indvar.3
44  store i32 7, i32* %arrayidx.3
45  %indvar.next.3 = add i64 %indvar.3, 1
46  %exitcond.3 = icmp ne i64 %indvar.next.3, 200
47  br i1 %exitcond.3, label %S3 , label %exit.3
48
49exit.3:
50  ret void
51}
52
53
54; CHECK: for (int c0 = 0; c0 <= 199; c0 += 1) {
55; CHECK:   if (c0 <= 99) {
56; CHECK:     Stmt_S1(c0);
57; CHECK:     if (c0 <= 9)
58; CHECK:       Stmt_S2(c0);
59; CHECK:   }
60; CHECK:   Stmt_S3(c0);
61; CHECK: }
62
63; TIMEOUT: for (int c0 = 0; c0 <= 99; c0 += 1)
64; TIMEOUT: Stmt_S1(c0);
65; TIMEOUT: for (int c0 = 0; c0 <= 9; c0 += 1)
66; TIMEOUT: Stmt_S2(c0);
67; TIMEOUT: for (int c0 = 0; c0 <= 199; c0 += 1)
68; TIMEOUT: Stmt_S3(c0);
69
70