1 ; RUN: opt %loadPolly -polly-print-scops -disable-output < %s | FileCheck %s
3 ; void foo(long n, float A[][n][n]) {
4 ; for (long i = 0; i < 200; i++)
5 ; for (long j = 0; j < n; j++)
6 ; for (long k = 0; k < n; k++)
7 ; A[i % 2][j][k] += 10;
11 ; CHECK-NEXT: Stmt_for_body_8
12 ; CHECK-NEXT: Domain :=
13 ; CHECK-NEXT: [n] -> { Stmt_for_body_8[i0, i1, i2] : 0 <= i0 <= 199 and 0 <= i1 < n and 0 <= i2 < n };
14 ; CHECK-NEXT: Schedule :=
15 ; CHECK-NEXT: [n] -> { Stmt_for_body_8[i0, i1, i2] -> [i0, i1, i2] };
16 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
17 ; CHECK-NEXT: [n] -> { Stmt_for_body_8[i0, i1, i2] -> MemRef_A[1, i1, i2] : (1 + i0) mod 2 = 0; Stmt_for_body_8[i0, i1, i2] -> MemRef_A[0, i1, i2] : (i0) mod 2 = 0 };
18 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
19 ; CHECK-NEXT: [n] -> { Stmt_for_body_8[i0, i1, i2] -> MemRef_A[1, i1, i2] : (1 + i0) mod 2 = 0; Stmt_for_body_8[i0, i1, i2] -> MemRef_A[0, i1, i2] : (i0) mod 2 = 0 };
23 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
26 define void @foo(i64 %n, ptr %A) #0 {
30 entry.split: ; preds = %entry
31 br label %for.cond.1.preheader
33 for.cond.1.preheader: ; preds = %entry.split, %for.inc.14
34 %i.06 = phi i64 [ 0, %entry.split ], [ %inc15, %for.inc.14 ]
35 %cmp2.3 = icmp sgt i64 %n, 0
36 br i1 %cmp2.3, label %for.cond.5.preheader.lr.ph, label %for.inc.14
38 for.cond.5.preheader.lr.ph: ; preds = %for.cond.1.preheader
39 br label %for.cond.5.preheader
41 for.cond.5.preheader: ; preds = %for.cond.5.preheader.lr.ph, %for.inc.11
42 %j.04 = phi i64 [ 0, %for.cond.5.preheader.lr.ph ], [ %inc12, %for.inc.11 ]
43 %cmp6.1 = icmp sgt i64 %n, 0
44 br i1 %cmp6.1, label %for.body.8.lr.ph, label %for.inc.11
46 for.body.8.lr.ph: ; preds = %for.cond.5.preheader
49 for.body.8: ; preds = %for.body.8.lr.ph, %for.body.8
50 %k.02 = phi i64 [ 0, %for.body.8.lr.ph ], [ %inc, %for.body.8 ]
51 %rem = srem i64 %i.06, 2
52 %0 = mul nuw i64 %n, %n
53 %1 = mul nsw i64 %0, %rem
54 %arrayidx = getelementptr inbounds float, ptr %A, i64 %1
55 %2 = mul nsw i64 %j.04, %n
56 %arrayidx9 = getelementptr inbounds float, ptr %arrayidx, i64 %2
57 %arrayidx10 = getelementptr inbounds float, ptr %arrayidx9, i64 %k.02
58 %3 = load float, ptr %arrayidx10, align 4, !tbaa !1
59 %add = fadd float %3, 1.000000e+01
60 store float %add, ptr %arrayidx10, align 4, !tbaa !1
61 %inc = add nuw nsw i64 %k.02, 1
62 %exitcond = icmp ne i64 %inc, %n
63 br i1 %exitcond, label %for.body.8, label %for.cond.5.for.inc.11_crit_edge
65 for.cond.5.for.inc.11_crit_edge: ; preds = %for.body.8
68 for.inc.11: ; preds = %for.cond.5.for.inc.11_crit_edge, %for.cond.5.preheader
69 %inc12 = add nuw nsw i64 %j.04, 1
70 %exitcond7 = icmp ne i64 %inc12, %n
71 br i1 %exitcond7, label %for.cond.5.preheader, label %for.cond.1.for.inc.14_crit_edge
73 for.cond.1.for.inc.14_crit_edge: ; preds = %for.inc.11
76 for.inc.14: ; preds = %for.cond.1.for.inc.14_crit_edge, %for.cond.1.preheader
77 %inc15 = add nuw nsw i64 %i.06, 1
78 %exitcond8 = icmp ne i64 %inc15, 200
79 br i1 %exitcond8, label %for.cond.1.preheader, label %for.end.16
81 for.end.16: ; preds = %for.inc.14
85 ; Function Attrs: nounwind
86 declare void @llvm.lifetime.start(i64, ptr nocapture) #1
88 ; Function Attrs: nounwind
89 declare void @llvm.lifetime.end(i64, ptr nocapture) #1
91 attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "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" }
92 attributes #1 = { nounwind }
96 !0 = !{!"clang version 3.7.0 (trunk 240923) (llvm/trunk 240924)"}
98 !2 = !{!"float", !3, i64 0}
99 !3 = !{!"omnipotent char", !4, i64 0}
100 !4 = !{!"Simple C/C++ TBAA"}