1; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s
2
3; This test case verifies that we generate numbered statement names in case
4; no LLVM-IR names are used in the test case. We also verify, that we
5; distinguish statements named with a number and unnamed statements that happen
6; to have an index identical to a number used in a statement name.
7
8; CHECK: Arrays {
9; CHECK-NEXT:     float MemRef0[*][%n]; // Element size 4
10; CHECK-NEXT:     float MemRef1[*][%n]; // Element size 4
11; CHECK-NEXT: }
12; CHECK-NEXT: Arrays (Bounds as pw_affs) {
13; CHECK-NEXT:     float MemRef0[*][ [n] -> { [] -> [(n)] } ]; // Element size 4
14; CHECK-NEXT:     float MemRef1[*][ [n] -> { [] -> [(n)] } ]; // Element size 4
15; CHECK-NEXT: }
16
17; CHECK: Statements {
18; CHECK-NEXT: 	Stmt2
19; CHECK-NEXT:         Domain :=
20; CHECK-NEXT:             [n] -> { Stmt2[i0, i1] : 0 <= i0 < n and 0 <= i1 < n };
21; CHECK-NEXT:         Schedule :=
22; CHECK-NEXT:             [n] -> { Stmt2[i0, i1] -> [0, i0, i1, 0] };
23; CHECK-NEXT:         ReadAccess :=	[Reduction Type: NONE] [Scalar: 0]
24; CHECK-NEXT:             [n] -> { Stmt2[i0, i1] -> MemRef0[i0, i1] };
25; CHECK-NEXT:         ReadAccess :=	[Reduction Type: NONE] [Scalar: 0]
26; CHECK-NEXT:             [n] -> { Stmt2[i0, i1] -> MemRef1[i0, i1] };
27; CHECK-NEXT:         MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 0]
28; CHECK-NEXT:             [n] -> { Stmt2[i0, i1] -> MemRef1[i0, i1] };
29; CHECK-NEXT: 	Stmt10
30; CHECK-NEXT:         Domain :=
31; CHECK-NEXT:             [n] -> { Stmt10[i0, i1] : 0 <= i0 < n and 0 <= i1 < n };
32; CHECK-NEXT:         Schedule :=
33; CHECK-NEXT:             [n] -> { Stmt10[i0, i1] -> [1, i0, i1, 0] };
34; CHECK-NEXT:         ReadAccess :=	[Reduction Type: NONE] [Scalar: 0]
35; CHECK-NEXT:             [n] -> { Stmt10[i0, i1] -> MemRef1[i0, i1] };
36; CHECK-NEXT:         ReadAccess :=	[Reduction Type: NONE] [Scalar: 0]
37; CHECK-NEXT:             [n] -> { Stmt10[i0, i1] -> MemRef0[i0, i1] };
38; CHECK-NEXT:         MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 0]
39; CHECK-NEXT:             [n] -> { Stmt10[i0, i1] -> MemRef0[i0, i1] };
40; CHECK-NEXT: 	Stmt_2
41; CHECK-NEXT:         Domain :=
42; CHECK-NEXT:             [n] -> { Stmt_2[i0, i1] : 0 <= i0 < n and 0 <= i1 < n };
43; CHECK-NEXT:         Schedule :=
44; CHECK-NEXT:             [n] -> { Stmt_2[i0, i1] -> [1, i0, i1, 1] };
45; CHECK-NEXT:         MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 0]
46; CHECK-NEXT:             [n] -> { Stmt_2[i0, i1] -> MemRef0[i0, i1]
47
48target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
49
50; Function Attrs: nounwind uwtable
51define void @vec3(i64 %n, float*, float*) #0 {
52  br label %.split
53
54.split:                                           ; preds = %0
55  br label %.preheader2.lr.ph
56
57.preheader2.lr.ph:                                ; preds = %.split
58  br label %.preheader2
59
60.preheader2:                                      ; preds = %.preheader2.lr.ph, %15
61  %i.010 = phi i64 [ 0, %.preheader2.lr.ph ], [ %16, %15 ]
62  br label %.lr.ph8
63
64.lr.ph8:                                          ; preds = %.preheader2
65  br label %4
66
67..preheader1_crit_edge:                           ; preds = %15
68  br label %.preheader1
69
70.preheader1:                                      ; preds = %..preheader1_crit_edge, %.split
71  %3 = icmp sgt i64 %n, 0
72  br i1 %3, label %.preheader.lr.ph, label %"name"
73
74.preheader.lr.ph:                                 ; preds = %.preheader1
75  br label %.preheader
76
77; <label>:4:                                      ; preds = %.lr.ph8, %4
78  %j.07 = phi i64 [ 0, %.lr.ph8 ], [ %14, %4 ]
79  %5 = mul nsw i64 %i.010, %n
80  %6 = getelementptr inbounds float, float* %1, i64 %5
81  %7 = getelementptr inbounds float, float* %6, i64 %j.07
82  %8 = load float, float* %7, align 4
83  %9 = mul nsw i64 %i.010, %n
84  %10 = getelementptr inbounds float, float* %0, i64 %9
85  %11 = getelementptr inbounds float, float* %10, i64 %j.07
86  %12 = load float, float* %11, align 4
87  %13 = fadd float %8, %12
88  store float %13, float* %11, align 4
89  %14 = add nuw nsw i64 %j.07, 1
90  %exitcond13 = icmp ne i64 %14, %n
91  br i1 %exitcond13, label %4, label %._crit_edge9
92
93._crit_edge9:                                     ; preds = %4
94  br label %15
95
96; <label>:15:                                     ; preds = %._crit_edge9, %.preheader2
97  %16 = add nuw nsw i64 %i.010, 1
98  %exitcond14 = icmp ne i64 %16, %n
99  br i1 %exitcond14, label %.preheader2, label %..preheader1_crit_edge
100
101.preheader:                                       ; preds = %.preheader.lr.ph, %29
102  %i1.04 = phi i64 [ 0, %.preheader.lr.ph ], [ %30, %29 ]
103  %17 = icmp sgt i64 %n, 0
104  br i1 %17, label %.lr.ph, label %29
105
106.lr.ph:                                           ; preds = %.preheader
107  br label %18
108
109; <label>:18:                                     ; preds = %.lr.ph, %18
110  %j2.03 = phi i64 [ 0, %.lr.ph ], [ %28, %"2" ]
111  %19 = mul nsw i64 %i1.04, %n
112  %20 = getelementptr inbounds float, float* %0, i64 %19
113  %21 = getelementptr inbounds float, float* %20, i64 %j2.03
114  %22 = load float, float* %21, align 4
115  %23 = mul nsw i64 %i1.04, %n
116  %24 = getelementptr inbounds float, float* %1, i64 %23
117  %25 = getelementptr inbounds float, float* %24, i64 %j2.03
118  %26 = load float, float* %25, align 4
119  %27 = fadd float %22, %26
120  store float %27, float* %25, align 4
121  br label %"2"
122
123"2":
124  store float 42.0, float* %25
125  %28 = add nuw nsw i64 %j2.03, 1
126  %exitcond = icmp ne i64 %28, %n
127  br i1 %exitcond, label %18, label %._crit_edge
128
129._crit_edge:                                      ; preds = %18
130  br label %29
131
132; <label>:29:                                     ; preds = %._crit_edge, %.preheader
133  %30 = add nuw nsw i64 %i1.04, 1
134  %exitcond12 = icmp ne i64 %30, %n
135  br i1 %exitcond12, label %.preheader, label %._crit_edge6
136
137._crit_edge6:                                     ; preds = %29
138  br label %"name"
139
140"name":
141  ret void
142}
143
144attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
145
146!llvm.ident = !{!0}
147
148!0 = !{!"Ubuntu clang version 3.7.1-3ubuntu4 (tags/RELEASE_371/final) (based on LLVM 3.7.1)"}
149