[JSON][PM] Port json import/export over to new pm
[polly-mirror.git] / test / ScopInfo / multiple_exiting_blocks_two_loop.ll
blob1283ef63350f4ac8a24d2f251acb76360b97d5cf
1 ; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s
3 ;    void foo(long n, float A[100]) {
4 ;      for (long j = 0; j < n; j++) {
5 ;        for (long i = j; i < n; i++) {
6 ;          if (i < 0)
7 ;            goto end;
9 ;          if (i >= 100)
10 ;            goto end;
12 ;          A[i] += i;
13 ;        }
14 ;      }
15 ;    end:
16 ;      return;
17 ;    }
19 ; CHECK: Domain :=
20 ; CHECK:  [n] -> { Stmt_if_end_7[i0, i1] : i0 >= 0 and 0 <= i1 <= 99 - i0 and i1 < n - i0 };
22 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
24 define void @foo(i64 %n, float* %A) {
25 entry:
26   br label %for.cond
28 for.cond:                                         ; preds = %for.inc.8, %entry
29   %j.0 = phi i64 [ 0, %entry ], [ %inc9, %for.inc.8 ]
30   %cmp = icmp slt i64 %j.0, %n
31   br i1 %cmp, label %for.body, label %for.end.10
33 for.body:                                         ; preds = %for.cond
34   br label %for.cond.1
36 for.cond.1:                                       ; preds = %for.inc, %for.body
37   %i.0 = phi i64 [ %j.0, %for.body ], [ %inc, %for.inc ]
38   %cmp2 = icmp slt i64 %i.0, %n
39   br i1 %cmp2, label %for.body.3, label %for.end
41 for.body.3:                                       ; preds = %for.cond.1
42   br i1 false, label %if.then, label %if.end
44 if.then:                                          ; preds = %for.body.3
45   br label %end
47 if.end:                                           ; preds = %for.body.3
48   %cmp5 = icmp sgt i64 %i.0, 99
49   br i1 %cmp5, label %if.then.6, label %if.end.7
51 if.then.6:                                        ; preds = %if.end
52   br label %end
54 if.end.7:                                         ; preds = %if.end
55   %conv = sitofp i64 %i.0 to float
56   %arrayidx = getelementptr inbounds float, float* %A, i64 %i.0
57   %tmp = load float, float* %arrayidx, align 4
58   %add = fadd float %tmp, %conv
59   store float %add, float* %arrayidx, align 4
60   br label %for.inc
62 for.inc:                                          ; preds = %if.end.7
63   %inc = add nuw nsw i64 %i.0, 1
64   br label %for.cond.1
66 for.end:                                          ; preds = %for.cond.1
67   br label %for.inc.8
69 for.inc.8:                                        ; preds = %for.end
70   %inc9 = add nuw nsw i64 %j.0, 1
71   br label %for.cond
73 for.end.10:                                       ; preds = %for.cond
74   br label %end
76 end:                                              ; preds = %for.end.10, %if.then.6, %if.then
77   ret void