llvm-project
101 строка · 4.7 Кб
1; RUN: opt -S %loadNPMPolly -aa-pipeline=basic-aa -polly-pattern-matching-based-opts=false -polly-vectorizer=stripmine '-passes=polly-opt-isl,print<polly-ast>' -disable-output < %s | FileCheck %s
2; RUN: opt -S %loadNPMPolly -aa-pipeline=basic-aa -polly-pattern-matching-based-opts=false -polly-vectorizer=stripmine -polly-prevect-width=16 '-passes=polly-opt-isl,print<polly-ast>' -disable-output < %s | FileCheck %s -check-prefix=VEC16
3
4target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
5
6@C = common global [1536 x [1536 x float]] zeroinitializer, align 16
7@A = common global [1536 x [1536 x float]] zeroinitializer, align 16
8@B = common global [1536 x [1536 x float]] zeroinitializer, align 16
9
10; Function Attrs: nounwind uwtable
11define void @foo() #0 {
12entry:
13br label %entry.split
14
15entry.split: ; preds = %entry
16br label %for.cond1.preheader
17
18for.cond1.preheader: ; preds = %entry.split, %for.inc28
19%indvar4 = phi i64 [ 0, %entry.split ], [ %indvar.next5, %for.inc28 ]
20br label %for.body3
21
22for.body3: ; preds = %for.cond1.preheader, %for.inc25
23%indvar6 = phi i64 [ 0, %for.cond1.preheader ], [ %indvar.next7, %for.inc25 ]
24%arrayidx24 = getelementptr [1536 x [1536 x float]], ptr @C, i64 0, i64 %indvar4, i64 %indvar6
25store float 0.000000e+00, ptr %arrayidx24, align 4
26br label %for.body8
27
28for.body8: ; preds = %for.body3, %for.body8
29%indvar = phi i64 [ 0, %for.body3 ], [ %indvar.next, %for.body8 ]
30%arrayidx16 = getelementptr [1536 x [1536 x float]], ptr @A, i64 0, i64 %indvar4, i64 %indvar
31%arrayidx20 = getelementptr [1536 x [1536 x float]], ptr @B, i64 0, i64 %indvar, i64 %indvar6
32%0 = load float, ptr %arrayidx24, align 4
33%1 = load float, ptr %arrayidx16, align 4
34%2 = load float, ptr %arrayidx20, align 4
35%mul = fmul float %1, %2
36%add = fadd float %0, %mul
37store float %add, ptr %arrayidx24, align 4
38%indvar.next = add i64 %indvar, 1
39%exitcond = icmp ne i64 %indvar.next, 1536
40br i1 %exitcond, label %for.body8, label %for.inc25
41
42for.inc25: ; preds = %for.body8
43%indvar.next7 = add i64 %indvar6, 1
44%exitcond8 = icmp ne i64 %indvar.next7, 1536
45br i1 %exitcond8, label %for.body3, label %for.inc28
46
47for.inc28: ; preds = %for.inc25
48%indvar.next5 = add i64 %indvar4, 1
49%exitcond9 = icmp ne i64 %indvar.next5, 1536
50br i1 %exitcond9, label %for.cond1.preheader, label %for.end30
51
52for.end30: ; preds = %for.inc28
53ret void
54}
55
56attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
57
58; CHECK: #pragma known-parallel
59; CHECK: for (int c0 = 0; c0 <= 47; c0 += 1)
60; CHECK: for (int c1 = 0; c1 <= 47; c1 += 1)
61; CHECK: for (int c2 = 0; c2 <= 31; c2 += 1)
62; CHECK: for (int c3 = 0; c3 <= 7; c3 += 1)
63; CHECK: // SIMD
64; CHECK: for (int c4 = 0; c4 <= 3; c4 += 1)
65; CHECK: Stmt_for_body3(32 * c0 + c2, 32 * c1 + 4 * c3 + c4);
66; CHECK: #pragma known-parallel
67; CHECK: for (int c0 = 0; c0 <= 47; c0 += 1)
68; CHECK: for (int c1 = 0; c1 <= 47; c1 += 1)
69; CHECK: for (int c2 = 0; c2 <= 47; c2 += 1)
70; CHECK: for (int c3 = 0; c3 <= 31; c3 += 1)
71; CHECK: for (int c4 = 0; c4 <= 7; c4 += 1)
72; CHECK: for (int c5 = 0; c5 <= 31; c5 += 1)
73; CHECK: // SIMD
74; CHECK: for (int c6 = 0; c6 <= 3; c6 += 1)
75; CHECK: Stmt_for_body8(32 * c0 + c3, 32 * c1 + 4 * c4 + c6, 32 * c2 + c5);
76
77; VEC16: {
78; VEC16: #pragma known-parallel
79; VEC16: for (int c0 = 0; c0 <= 47; c0 += 1)
80; VEC16: for (int c1 = 0; c1 <= 47; c1 += 1)
81; VEC16: for (int c2 = 0; c2 <= 31; c2 += 1)
82; VEC16: for (int c3 = 0; c3 <= 1; c3 += 1)
83; VEC16: // SIMD
84; VEC16: for (int c4 = 0; c4 <= 15; c4 += 1)
85; VEC16: Stmt_for_body3(32 * c0 + c2, 32 * c1 + 16 * c3 + c4);
86; VEC16: #pragma known-parallel
87; VEC16: for (int c0 = 0; c0 <= 47; c0 += 1)
88; VEC16: for (int c1 = 0; c1 <= 47; c1 += 1)
89; VEC16: for (int c2 = 0; c2 <= 47; c2 += 1)
90; VEC16: for (int c3 = 0; c3 <= 31; c3 += 1)
91; VEC16: for (int c4 = 0; c4 <= 1; c4 += 1)
92; VEC16: for (int c5 = 0; c5 <= 31; c5 += 1)
93; VEC16: // SIMD
94; VEC16: for (int c6 = 0; c6 <= 15; c6 += 1)
95; VEC16: Stmt_for_body8(32 * c0 + c3, 32 * c1 + 16 * c4 + c6, 32 * c2 + c5);
96; VEC16: }
97
98
99!llvm.ident = !{!0}
100
101!0 = !{!"clang version 3.5.0 "}
102