llvm-project
72 строки · 3.2 Кб
1; RUN: opt -S %loadNPMPolly -aa-pipeline=basic-aa -polly-tiling=false -polly-pattern-matching-based-opts=false -polly-vectorizer=stripmine '-passes=polly-opt-isl,print<polly-ast>' -disable-output < %s | FileCheck %s
2target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
3
4@C = common global [1536 x [1536 x float]] zeroinitializer, align 16
5@A = common global [1536 x [1536 x float]] zeroinitializer, align 16
6@B = common global [1536 x [1536 x float]] zeroinitializer, align 16
7
8; Function Attrs: nounwind uwtable
9define void @foo() #0 {
10entry:
11br label %entry.split
12
13entry.split: ; preds = %entry
14br label %for.cond1.preheader
15
16for.cond1.preheader: ; preds = %entry.split, %for.inc28
17%indvar4 = phi i64 [ 0, %entry.split ], [ %indvar.next5, %for.inc28 ]
18br label %for.body3
19
20for.body3: ; preds = %for.cond1.preheader, %for.inc25
21%indvar6 = phi i64 [ 0, %for.cond1.preheader ], [ %indvar.next7, %for.inc25 ]
22%arrayidx24 = getelementptr [1536 x [1536 x float]], ptr @C, i64 0, i64 %indvar4, i64 %indvar6
23store float 0.000000e+00, ptr %arrayidx24, align 4
24br label %for.body8
25
26for.body8: ; preds = %for.body3, %for.body8
27%indvar = phi i64 [ 0, %for.body3 ], [ %indvar.next, %for.body8 ]
28%arrayidx16 = getelementptr [1536 x [1536 x float]], ptr @A, i64 0, i64 %indvar4, i64 %indvar
29%arrayidx20 = getelementptr [1536 x [1536 x float]], ptr @B, i64 0, i64 %indvar, i64 %indvar6
30%0 = load float, ptr %arrayidx24, align 4
31%1 = load float, ptr %arrayidx16, align 4
32%2 = load float, ptr %arrayidx20, align 4
33%mul = fmul float %1, %2
34%add = fadd float %0, %mul
35store float %add, ptr %arrayidx24, align 4
36%indvar.next = add i64 %indvar, 1
37%exitcond = icmp ne i64 %indvar.next, 1536
38br i1 %exitcond, label %for.body8, label %for.inc25
39
40for.inc25: ; preds = %for.body8
41%indvar.next7 = add i64 %indvar6, 1
42%exitcond8 = icmp ne i64 %indvar.next7, 1536
43br i1 %exitcond8, label %for.body3, label %for.inc28
44
45for.inc28: ; preds = %for.inc25
46%indvar.next5 = add i64 %indvar4, 1
47%exitcond9 = icmp ne i64 %indvar.next5, 1536
48br i1 %exitcond9, label %for.cond1.preheader, label %for.end30
49
50for.end30: ; preds = %for.inc28
51ret void
52}
53
54attributes #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" }
55
56; CHECK: #pragma known-parallel
57; CHECK: for (int c0 = 0; c0 <= 1535; c0 += 1)
58; CHECK: for (int c1 = 0; c1 <= 383; c1 += 1)
59; CHECK: // SIMD
60; CHECK: for (int c2 = 0; c2 <= 3; c2 += 1)
61; CHECK: Stmt_for_body3(c0, 4 * c1 + c2);
62; CHECK: #pragma known-parallel
63; CHECK: for (int c0 = 0; c0 <= 1535; c0 += 1)
64; CHECK: for (int c1 = 0; c1 <= 383; c1 += 1)
65; CHECK: for (int c2 = 0; c2 <= 1535; c2 += 1)
66; CHECK: // SIMD
67; CHECK: for (int c3 = 0; c3 <= 3; c3 += 1)
68; CHECK: Stmt_for_body8(c0, 4 * c1 + c3, c2);
69
70!llvm.ident = !{!0}
71
72!0 = !{!"clang version 3.5.0 "}
73