1 ; RUN: opt -S %loadPolly -polly-pattern-matching-based-opts=false -polly-vectorizer=stripmine -polly-opt-isl -polly-print-ast -disable-output < %s | FileCheck %s
2 ; CHECK: // 1st level tiling - Tiles
3 ; CHECK-NEXT: #pragma known-parallel
4 ; CHECK-NEXT: for (int c0 = 0; c0 <= floord(ni - 1, 32); c0 += 1)
5 ; CHECK-NEXT: for (int c1 = 0; c1 <= floord(nj - 1, 32); c1 += 1)
6 ; CHECK-NEXT: #pragma minimal dependence distance: 1
7 ; CHECK-NEXT: for (int c2 = 0; c2 <= floord(nk - 1, 32); c2 += 1) {
8 ; CHECK-NEXT: // 1st level tiling - Points
9 ; CHECK-NEXT: for (int c3 = 0; c3 <= min(31, ni - 32 * c0 - 1); c3 += 1) {
10 ; CHECK-NEXT: for (int c4 = 0; c4 <= min(7, -8 * c1 + nj / 4 - 1); c4 += 1)
11 ; CHECK-NEXT: #pragma minimal dependence distance: 1
12 ; CHECK-NEXT: for (int c5 = 0; c5 <= min(31, nk - 32 * c2 - 1); c5 += 1) {
14 ; CHECK-NEXT: #pragma simd
15 ; CHECK-NEXT: for (int c6 = 0; c6 <= 3; c6 += 1)
16 ; CHECK-NEXT: Stmt_for_body_6(32 * c0 + c3, 32 * c1 + 4 * c4 + c6, 32 * c2 + c5);
18 ; CHECK-NEXT: if (32 * c1 + 31 >= nj)
19 ; CHECK-NEXT: #pragma minimal dependence distance: 1
20 ; CHECK-NEXT: for (int c5 = 0; c5 <= min(31, nk - 32 * c2 - 1); c5 += 1) {
22 ; CHECK-NEXT: #pragma simd
23 ; CHECK-NEXT: for (int c6 = 0; c6 < nj % 4; c6 += 1)
24 ; CHECK-NEXT: Stmt_for_body_6(32 * c0 + c3, -(nj % 4) + nj + c6, 32 * c2 + c5);
29 ; Function Attrs: nounwind uwtable
30 define void @kernel_gemm(i32 %ni, i32 %nj, i32 %nk, double %alpha, double %beta, ptr %C, ptr %A, ptr %B) #0 {
32 %cmp.27 = icmp sgt i32 %ni, 0
33 br i1 %cmp.27, label %for.cond.1.preheader.lr.ph, label %for.end.22
35 for.cond.1.preheader.lr.ph: ; preds = %entry
36 br label %for.cond.1.preheader
38 for.cond.1.preheader: ; preds = %for.cond.1.preheader.lr.ph, %for.inc.20
39 %indvars.iv33 = phi i64 [ 0, %for.cond.1.preheader.lr.ph ], [ %indvars.iv.next34, %for.inc.20 ]
40 %cmp2.25 = icmp sgt i32 %nj, 0
41 br i1 %cmp2.25, label %for.cond.4.preheader.lr.ph, label %for.inc.20
43 for.cond.4.preheader.lr.ph: ; preds = %for.cond.1.preheader
44 br label %for.cond.4.preheader
46 for.cond.4.preheader: ; preds = %for.cond.4.preheader.lr.ph, %for.inc.17
47 %indvars.iv29 = phi i64 [ 0, %for.cond.4.preheader.lr.ph ], [ %indvars.iv.next30, %for.inc.17 ]
48 %cmp5.23 = icmp sgt i32 %nk, 0
49 br i1 %cmp5.23, label %for.body.6.lr.ph, label %for.inc.17
51 for.body.6.lr.ph: ; preds = %for.cond.4.preheader
54 for.body.6: ; preds = %for.body.6.lr.ph, %for.body.6
55 %indvars.iv = phi i64 [ 0, %for.body.6.lr.ph ], [ %indvars.iv.next, %for.body.6 ]
56 %arrayidx8 = getelementptr inbounds [1024 x double], ptr %A, i64 %indvars.iv33, i64 %indvars.iv
57 %0 = load double, ptr %arrayidx8, align 8
58 %arrayidx12 = getelementptr inbounds [1024 x double], ptr %B, i64 %indvars.iv, i64 %indvars.iv29
59 %1 = load double, ptr %arrayidx12, align 8
60 %mul = fmul double %0, %1
61 %arrayidx16 = getelementptr inbounds [1024 x double], ptr %C, i64 %indvars.iv33, i64 %indvars.iv29
62 %2 = load double, ptr %arrayidx16, align 8
63 %add = fadd double %2, %mul
64 store double %add, ptr %arrayidx16, align 8
65 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
66 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
67 %exitcond = icmp ne i32 %lftr.wideiv, %nk
68 br i1 %exitcond, label %for.body.6, label %for.cond.4.for.inc.17_crit_edge
70 for.cond.4.for.inc.17_crit_edge: ; preds = %for.body.6
73 for.inc.17: ; preds = %for.cond.4.for.inc.17_crit_edge, %for.cond.4.preheader
74 %indvars.iv.next30 = add nuw nsw i64 %indvars.iv29, 1
75 %lftr.wideiv31 = trunc i64 %indvars.iv.next30 to i32
76 %exitcond32 = icmp ne i32 %lftr.wideiv31, %nj
77 br i1 %exitcond32, label %for.cond.4.preheader, label %for.cond.1.for.inc.20_crit_edge
79 for.cond.1.for.inc.20_crit_edge: ; preds = %for.inc.17
82 for.inc.20: ; preds = %for.cond.1.for.inc.20_crit_edge, %for.cond.1.preheader
83 %indvars.iv.next34 = add nuw nsw i64 %indvars.iv33, 1
84 %lftr.wideiv35 = trunc i64 %indvars.iv.next34 to i32
85 %exitcond36 = icmp ne i32 %lftr.wideiv35, %ni
86 br i1 %exitcond36, label %for.cond.1.preheader, label %for.cond.for.end.22_crit_edge
88 for.cond.for.end.22_crit_edge: ; preds = %for.inc.20
91 for.end.22: ; preds = %for.cond.for.end.22_crit_edge, %entry