• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt %loadPolly -polly-detect -analyze < %s | FileCheck %s
2
3; void f(long A[], long N) {
4;   long i;
5;
6;  if (true){
7;    i = 0;
8;    goto next;
9;  }else{
10;    i = 1;
11;    goto next;
12; }
13;
14; next:
15;  if (true)
16;    goto for.i;
17;  else
18;    goto for.i;
19;
20; for.i:
21;   for (i = 0; i < N; ++i)
22;     A[i] = i;
23; }
24
25target 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"
26
27define void @f(i64* %A, i64 %N) nounwind {
28entry:
29  fence seq_cst
30  br i1 true, label %then1, label %else1
31
32then1:
33  br label %next
34
35else1:
36  br label %next
37
38next:
39  br i1 true, label %then, label %else
40
41then:
42  br label %for.i.head
43
44else:
45  br label %for.i.head
46
47for.i.head:
48  br label %for.i.head1
49
50for.i.head1:
51  br label %for.i
52
53for.i:
54  %indvar = phi i64 [ 0, %for.i.head1], [ %indvar.next, %for.i ]
55  fence seq_cst
56  %scevgep = getelementptr i64, i64* %A, i64 %indvar
57  store i64 %indvar, i64* %scevgep
58  %indvar.next = add nsw i64 %indvar, 1
59  %exitcond = icmp eq i64 %indvar.next, %N
60  br i1 %exitcond, label %return, label %for.i
61
62return:
63  fence seq_cst
64  ret void
65}
66
67; CHECK: Valid Region for Scop: next => for.i
68