1; RUN: opt %loadPolly -polly-scops -analyze -polly-import-jscop -polly-import-jscop-postfix=transformed < %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 3; 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]; 8; 9; 10; CHECK: Arrays { 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 17; 18; CHECK:New access function '{ Stmt_bb12[i0, i1, i2] -> E[i2, i0] }' detected in JSCOP file 19; 20; CODEGEN:define internal void @create_arrays(i32 %arg, i32 %arg1, i32 %arg2, double %arg3, double %beta, [1056 x double]* %A, [1024 x double]* %B, [1056 x double]* %arg7) #0 { 21; CODEGEN:bb: 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 27; 28; CODEGEN: %beta.s2a.reload = load double, double* %beta.s2a 29; CODEGEN: %polly.access.cast.E = bitcast [270336 x [200000 x double]]* %E to double* 30; CODEGEN: %polly.access.mul.E = mul nsw i64 %polly.indvar33, 200000 31; CODEGEN: %polly.access.add.E = add nsw i64 %polly.access.mul.E, %polly.indvar 32; CODEGEN: {{%.*}} = load double, double* %polly.access.E, align 8, !alias.scope [[TAG0:![0-9]+]], !noalias [[TAG2:![0-9]+]] 33; CODEGEN: store double {{%.*}}, double* %scevgep36, align 8, !alias.scope [[TAG5:![0-9]+]], !noalias [[TAG8:![0-9]+]] 34; 35; CODEGEN: [[TAG0]] = distinct !{[[TAG0]], [[TAG1:![0-9]+]], !"polly.alias.scope.E"} 36; CODEGEN: [[TAG1]] = distinct !{[[TAG1]], !"polly.alias.scope.domain"} 37; CODEGEN: [[TAG2]] = !{[[TAG3:![0-9]+]], [[TAG4:![0-9]+]], [[TAG5:![0-9]+]], [[TAG6:![0-9]+]]} 38; CODEGEN: [[TAG3]] = distinct !{[[TAG3]], [[TAG1]], !"polly.alias.scope.MemRef_B"} 39; CODEGEN: [[TAG4]] = distinct !{[[TAG4]], [[TAG1]], !"polly.alias.scope.MemRef_A"} 40; CODEGEN: [[TAG5]] = distinct !{[[TAG5]], [[TAG1]], !"polly.alias.scope.D"} 41; CODEGEN: [[TAG6]] = distinct !{[[TAG6]], [[TAG1]], !"polly.alias.scope.F"} 42; CODEGEN: [[TAG7:![0-9]+]] = !{[[TAG3]], [[TAG5]], [[TAG0]], [[TAG6]]} 43; 44target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 45target triple = "x86_64-unknown-unknown" 46 47; Function Attrs: nounwind uwtable 48define internal void @create_arrays(i32 %arg, i32 %arg1, i32 %arg2, double %arg3, double %beta, [1056 x double]* %A, [1024 x double]* %B, [1056 x double]* %arg7) #0 { 49bb: 50 br label %bb8 51 52bb8: ; preds = %bb 53 br label %bb9 54 55bb9: ; preds = %bb23, %bb8 56 %tmp = phi i64 [ 0, %bb8 ], [ %tmp24, %bb23 ] 57 br label %bb10 58 59bb10: ; preds = %bb20, %bb9 60 %tmp11 = phi i64 [ 0, %bb9 ], [ %tmp21, %bb20 ] 61 br label %bb12 62 63bb12: ; preds = %bb12, %bb10 64 %tmp13 = phi i64 [ 0, %bb10 ], [ %tmp18, %bb12 ] 65 %tmp14 = getelementptr inbounds [1024 x double], [1024 x double]* %B, i64 %tmp, i64 %tmp13 66 %tmp15 = load double, double* %tmp14, align 8 67 %tmp16 = fmul double %tmp15, %beta 68 %tmp17 = getelementptr inbounds [1056 x double], [1056 x double]* %A, i64 %tmp, i64 %tmp11 69 store double %tmp16, double* %tmp17, align 8 70 %tmp18 = add nuw nsw i64 %tmp13, 1 71 %tmp19 = icmp ne i64 %tmp18, 1024 72 br i1 %tmp19, label %bb12, label %bb20 73 74bb20: ; preds = %bb12 75 %tmp21 = add nuw nsw i64 %tmp11, 1 76 %tmp22 = icmp ne i64 %tmp21, 1056 77 br i1 %tmp22, label %bb10, label %bb23 78 79bb23: ; preds = %bb20 80 %tmp24 = add nuw nsw i64 %tmp, 1 81 %tmp25 = icmp ne i64 %tmp24, 1056 82 br i1 %tmp25, label %bb9, label %bb26 83 84bb26: ; preds = %bb23 85 ret void 86} 87 88attributes #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" } 89