1 ; RUN: opt %loadPolly -polly-print-scops -polly-print-import-jscop -polly-import-jscop-postfix=transformed -disable-output < %s 2>&1 | FileCheck %s
2 ; RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-codegen -S < %s 2>&1 | FileCheck %s --check-prefix=CODEGEN
4 ; for (i = 0; i < _PB_NI; i++)
5 ; for (j = 0; j < _PB_NJ; j++)
6 ; for (k = 0; k < _PB_NK; ++k)
7 ; B[i][j] = beta * A[i][k];
11 ; CHECK: double MemRef_B[*][1024]; // Element size 8
12 ; CHECK: double MemRef_beta; // Element size 8
13 ; CHECK: double MemRef_A[*][1056]; // Element size 8
14 ; CHECK: double D[270336]; // Element size 8
15 ; CHECK: double E[270336][200000]; // Element size 8
16 ; CHECK: i64 F[270336]; // Element size 8
18 ; CHECK:New access function '{ Stmt_bb12[i0, i1, i2] -> E[i2, i0] }' detected in JSCOP file
20 ; CODEGEN:define internal void @create_arrays(i32 %arg, i32 %arg1, i32 %arg2, double %arg3, double %beta, ptr %A, ptr %B, ptr %arg7) #0 {
22 ; CODEGEN: %beta.s2a = alloca double
23 ; CODEGEN: %D = alloca [270336 x double]
24 ; CODEGEN: %E = alloca [270336 x [200000 x double]]
25 ; CODEGEN: %F = alloca [270336 x i64]
26 ; CODEGEN: br label %bb8
28 ; CODEGEN: %beta.s2a.reload = load double, ptr %beta.s2a
29 ; CODEGEN: %polly.access.mul.E = mul nsw i64 %polly.indvar31, 200000
30 ; CODEGEN: %polly.access.add.E = add nsw i64 %polly.access.mul.E, %polly.indvar
31 ; CODEGEN: {{%.*}} = load double, ptr %polly.access.E, align 8, !alias.scope !4, !noalias !7
32 ; CODEGEN: store double {{%.*}}, ptr %scevgep34, align 8, !alias.scope !12, !noalias !13
34 ; CODEGEN: !0 = distinct !{!0, !1}
35 ; CODEGEN: !1 = !{!"llvm.loop.vectorize.enable", i32 0}
36 ; CODEGEN: !2 = distinct !{!2, !1}
37 ; CODEGEN: !3 = distinct !{!3, !1}
39 ; CODEGEN: !5 = distinct !{!5, !6, !"polly.alias.scope.E"}
40 ; CODEGEN: !6 = distinct !{!6, !"polly.alias.scope.domain"}
41 ; CODEGEN: !7 = !{!8, !9, !10, !11}
42 ; CODEGEN: !8 = distinct !{!8, !6, !"polly.alias.scope.MemRef_B"}
43 ; CODEGEN: !9 = distinct !{!9, !6, !"polly.alias.scope.MemRef_A"}
44 ; CODEGEN: !10 = distinct !{!10, !6, !"polly.alias.scope.D"}
45 ; CODEGEN: !11 = distinct !{!11, !6, !"polly.alias.scope.F"}
46 ; CODEGEN: !12 = !{!9}
47 ; CODEGEN: !13 = !{!8, !10, !5, !11}
49 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
50 target triple = "x86_64-unknown-unknown"
52 ; Function Attrs: nounwind uwtable
53 define internal void @create_arrays(i32 %arg, i32 %arg1, i32 %arg2, double %arg3, double %beta, ptr %A, ptr %B, ptr %arg7) #0 {
60 bb9: ; preds = %bb23, %bb8
61 %tmp = phi i64 [ 0, %bb8 ], [ %tmp24, %bb23 ]
64 bb10: ; preds = %bb20, %bb9
65 %tmp11 = phi i64 [ 0, %bb9 ], [ %tmp21, %bb20 ]
68 bb12: ; preds = %bb12, %bb10
69 %tmp13 = phi i64 [ 0, %bb10 ], [ %tmp18, %bb12 ]
70 %tmp14 = getelementptr inbounds [1024 x double], ptr %B, i64 %tmp, i64 %tmp13
71 %tmp15 = load double, ptr %tmp14, align 8
72 %tmp16 = fmul double %tmp15, %beta
73 %tmp17 = getelementptr inbounds [1056 x double], ptr %A, i64 %tmp, i64 %tmp11
74 store double %tmp16, ptr %tmp17, align 8
75 %tmp18 = add nuw nsw i64 %tmp13, 1
76 %tmp19 = icmp ne i64 %tmp18, 1024
77 br i1 %tmp19, label %bb12, label %bb20
80 %tmp21 = add nuw nsw i64 %tmp11, 1
81 %tmp22 = icmp ne i64 %tmp21, 1056
82 br i1 %tmp22, label %bb10, label %bb23
85 %tmp24 = add nuw nsw i64 %tmp, 1
86 %tmp25 = icmp ne i64 %tmp24, 1056
87 br i1 %tmp25, label %bb9, label %bb26
93 attributes #0 = { nounwind uwtable "target-cpu"="x86-64" "target-features"="+aes,+avx,+cmov,+cx16,+fxsr,+mmx,+pclmul,+popcnt,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+x87,+xsave,+xsaveopt" }