Add accelerator code generation pass skeleton
[polly-mirror.git] / test / ScopInfo / error-blocks-3.ll
blob15ff514ab1bfa6ce142be38d4367b004c114e4b5
1 ; RUN: opt %loadPolly -analyze -polly-scops  -polly-detect-keep-going -polly-allow-nonaffine < %s | FileCheck %s
3 ; TODO: FIXME: Investigate why "-polly-detect-keep-going" is needed to detect
4 ;              this SCoP. That flag should not make a difference.
6 ; CHECK:         Context:
7 ; CHECK-NEXT:    [N] -> {  : -2147483648 <= N <= 2147483647 }
8 ; CHECK-NEXT:    Assumed Context:
9 ; CHECK-NEXT:    [N] -> {  :  }
10 ; CHECK-NEXT:    Invalid Context:
11 ; CHECK-NEXT:    [N] -> {  : N >= 514 }
13 ; CHECK:         Statements {
14 ; CHECK-NEXT:           Stmt_if_end3
15 ; CHECK-NEXT:            Domain :=
16 ; CHECK-NEXT:                [N] -> { Stmt_if_end3[i0] : 0 <= i0 < N };
17 ; CHECK-NEXT:            Schedule :=
18 ; CHECK-NEXT:                [N] -> { Stmt_if_end3[i0] -> [i0] };
19 ; CHECK-NEXT:            ReadAccess :=  [Reduction Type: +] [Scalar: 0]
20 ; CHECK-NEXT:                [N] -> { Stmt_if_end3[i0] -> MemRef_A[i0] };
21 ; CHECK-NEXT:            MustWriteAccess :=     [Reduction Type: +] [Scalar: 0]
22 ; CHECK-NEXT:                [N] -> { Stmt_if_end3[i0] -> MemRef_A[i0] };
23 ; CHECK-NEXT:    }
25 ;    int f();
26 ;    void g(int *A, int N) {
27 ;      for (int i = 0; i < N; i++) {
28 ;        if (i > 512) {
29 ;          int v = f();
30 ;        S:
31 ;          A[v]++;
32 ;        }
33 ;        A[i]++;
34 ;      }
35 ;    }
37 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
39 define void @g(i32* %A, i32 %N) {
40 entry:
41   %tmp = sext i32 %N to i64
42   br label %for.cond
44 for.cond:                                         ; preds = %for.inc, %entry
45   %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
46   %cmp = icmp slt i64 %indvars.iv, %tmp
47   br i1 %cmp, label %for.body, label %for.end
49 for.body:                                         ; preds = %for.cond
50   %cmp1 = icmp sgt i64 %indvars.iv, 512
51   br i1 %cmp1, label %if.then, label %if.end3
53 if.then:                                          ; preds = %for.body
54   %call = call i32 (...) @f()
55   br label %S
57 S:                                                ; preds = %if.then
58   %idxprom = sext i32 %call to i64
59   %arrayidx = getelementptr inbounds i32, i32* %A, i64 %idxprom
60   %tmp1 = load i32, i32* %arrayidx, align 4
61   %inc = add nsw i32 %tmp1, 1
62   store i32 %inc, i32* %arrayidx, align 4
63   br label %if.end3
65 if.end3:                                          ; preds = %if.end, %for.body
66   %arrayidx5 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
67   %tmp2 = load i32, i32* %arrayidx5, align 4
68   %inc6 = add nsw i32 %tmp2, 1
69   store i32 %inc6, i32* %arrayidx5, align 4
70   br label %for.inc
72 for.inc:                                          ; preds = %if.end3, %if.then2
73   %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
74   br label %for.cond
76 for.end:                                          ; preds = %for.cond
77   ret void
80 declare i32 @f(...)