brintos

brintos / llvm-project-archived public Read only

0
0
Text · 8.8 KiB · d8c2916 Raw
154 lines · plain
1; RUN: opt %loadNPMPolly -aa-pipeline=basic-aa -pass-remarks-missed=polly-detect -polly-detect-track-failures '-passes=polly-custom<detect>' -polly-print-detect -disable-output < %s 2>&1 | FileCheck %s2; RUN: opt %loadNPMPolly -aa-pipeline=basic-aa -pass-remarks-missed=polly-detect -polly-detect-track-failures '-passes=polly-custom<detect>' -polly-print-detect -polly-delinearize=false -polly-detect-keep-going -disable-output < %s 2>&1 | FileCheck %s -check-prefix=ALL3; RUN: opt %loadNPMPolly -aa-pipeline=basic-aa -pass-remarks-missed=polly-detect -polly-detect-track-failures '-passes=polly-custom<detect>' -polly-print-detect -disable-output < %s 2>&1 | FileCheck %s -check-prefix=DELIN4; RUN: opt %loadNPMPolly -aa-pipeline=basic-aa -pass-remarks-missed=polly-detect -polly-detect-track-failures '-passes=polly-custom<detect>' -polly-print-detect -polly-detect-keep-going -disable-output < %s 2>&1 | FileCheck %s -check-prefix=DELIN-ALL5; RUN: opt %loadNPMPolly -aa-pipeline=basic-aa -pass-remarks-missed=polly-detect -polly-detect-track-failures '-passes=polly-custom<detect>' -polly-print-detect -polly-allow-nonaffine -disable-output < %s 2>&1 | FileCheck %s -check-prefix=NONAFFINE6; RUN: opt %loadNPMPolly -aa-pipeline=basic-aa -pass-remarks-missed=polly-detect -polly-detect-track-failures '-passes=polly-custom<detect>' -polly-print-detect -polly-allow-nonaffine -disable-output < %s 2>&1 | FileCheck %s -check-prefix=NONAFFINE7 8;  1 void manyaccesses(float A[restrict], long n, float B[restrict][n])9;  2 {10;  3   for (long i = 0; i < 1024; ++i) {11;  4     float a1 = A[2 * i * i];12;  5     float a2 = A[2 * i * i + 1];13;  6     float b1 = B[0][0];14;  7     float b2 = B[i][i];15;  8     float b3 = B[i * i][i];16;  9     float b4 = B[i][0];17; 10     float b5 = B[0][i];18; 11     float b6 = B[0][i*i];19; 1220; 13     A[i * i] = a1 + a2 + b1 + b2 + b3 + b4 + b5 + b6;21; 14   }22; 15 }23 24; CHECK: remark: /tmp/test.c:3:20: The following errors keep this region from being a Scop.25; CHECK-NEXT: remark: /tmp/test.c:4:16: The array subscript of "A" is not affine26; CHECK-NEXT: remark: /tmp/test.c:13:51: Invalid Scop candidate ends here.27 28; ALL: remark: /tmp/test.c:3:20: The following errors keep this region from being a Scop.29; ALL-NEXT: remark: /tmp/test.c:4:16: The array subscript of "A" is not affine30; ALL-NEXT: remark: /tmp/test.c:5:16: The array subscript of "A" is not affine31; -> B[0][0] is affine32; ALL-NEXT: remark: /tmp/test.c:7:16: The array subscript of "B" is not affine33; ALL-NEXT: remark: /tmp/test.c:8:16: The array subscript of "B" is not affine34; ALL-NEXT: remark: /tmp/test.c:9:16: The array subscript of "B" is not affine35; -> B[0][i] is affine36; ALL-NEXT: remark: /tmp/test.c:11:16: The array subscript of "B" is not affine37; ALL-NEXT: remark: /tmp/test.c:13:5: The array subscript of "A" is not affine38; ALL-NEXT: remark: /tmp/test.c:13:51: Invalid Scop candidate ends here.39 40; DELIN: remark: /tmp/test.c:3:20: The following errors keep this region from being a Scop.41; DELIN-NEXT: remark: /tmp/test.c:4:16: The array subscript of "A" is not affine42; DELIN-NEXT: remark: /tmp/test.c:13:51: Invalid Scop candidate ends here.43 44; DELIN-ALL: remark: /tmp/test.c:3:20: The following errors keep this region from being a Scop.45; DELIN-ALL-NEXT: remark: /tmp/test.c:4:16: The array subscript of "A" is not affine46; DELIN-ALL-NEXT: remark: /tmp/test.c:5:16: The array subscript of "A" is not affine47; DELIN-ALL-NEXT: remark: /tmp/test.c:13:5: The array subscript of "A" is not affine48; -> B[0][0] is affine if delinearized49; -> B[i][i] is affine if delinearized50; DELIN-ALL-NEXT: remark: /tmp/test.c:8:16: The array subscript of "B" is not affine51; -> B[i][0] is affine if delinearized52; -> B[0][i] is affine if delinearized53; DELIN-ALL-NEXT: remark: /tmp/test.c:11:16: The array subscript of "B" is not affine54; DELIN-ALL-NEXT: remark: /tmp/test.c:13:51: Invalid Scop candidate ends here.55 56; NONAFFINE-NOT: remark: The following errors keep this region from being a Scop.57 58target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"59 60define void @manyaccesses(ptr noalias %A, i64 %n, ptr noalias %B) !dbg !4 {61entry:62  br label %entry.split63 64entry.split:                                      ; preds = %entry65  %tmp = add i64 %n, 1, !dbg !1066  br label %for.body, !dbg !1067 68for.body:                                         ; preds = %entry.split, %for.body69  %tmp3 = phi i64 [ 0, %entry.split ], [ %tmp14, %for.body ], !dbg !1570  %mul = mul i64 %tmp3, 2, !dbg !1771  %tmp4 = mul i64 %tmp, %tmp3, !dbg !1872  %arrayidx8 = getelementptr float, ptr %B, i64 %tmp4, !dbg !1973  %mul9 = mul i64 %n, %tmp3, !dbg !1574  %arrayidx12 = getelementptr float, ptr %B, i64 %mul9, !dbg !2075  %arrayidx15 = getelementptr float, ptr %B, i64 %tmp3, !dbg !2176  %mul1 = mul nsw i64 %mul, %tmp3, !dbg !1777  %arrayidx = getelementptr inbounds float, ptr %A, i64 %mul1, !dbg !2278  %tmp5 = load float, ptr %arrayidx, align 4, !dbg !2279  %mul3 = mul nsw i64 %mul, %tmp3, !dbg !2780  %add1 = or i64 %mul3, 1, !dbg !2781  %arrayidx4 = getelementptr inbounds float, ptr %A, i64 %add1, !dbg !2882  %tmp6 = load float, ptr %arrayidx4, align 4, !dbg !2883  %tmp7 = load float, ptr %B, align 4, !dbg !2984  %tmp8 = load float, ptr %arrayidx8, align 4, !dbg !1985  %tmp9 = mul i64 %mul9, %tmp3, !dbg !1586  %arrayidx10.sum = add i64 %tmp9, %tmp3, !dbg !1587  %arrayidx11 = getelementptr inbounds float, ptr %B, i64 %arrayidx10.sum, !dbg !1588  %tmp10 = load float, ptr %arrayidx11, align 4, !dbg !1589  %tmp11 = load float, ptr %arrayidx12, align 4, !dbg !2090  %tmp12 = load float, ptr %arrayidx15, align 4, !dbg !2191  %mul16 = mul nsw i64 %tmp3, %tmp3, !dbg !3092  %arrayidx18 = getelementptr inbounds float, ptr %B, i64 %mul16, !dbg !3193  %tmp13 = load float, ptr %arrayidx18, align 4, !dbg !3194  %add19 = fadd float %tmp5, %tmp6, !dbg !3295  %add20 = fadd float %add19, %tmp7, !dbg !3396  %add21 = fadd float %add20, %tmp8, !dbg !3497  %add22 = fadd float %add21, %tmp10, !dbg !3598  %add23 = fadd float %add22, %tmp11, !dbg !3699  %add24 = fadd float %add23, %tmp12, !dbg !37100  %add25 = fadd float %add24, %tmp13, !dbg !38101  %mul26 = mul nsw i64 %tmp3, %tmp3, !dbg !39102  %arrayidx27 = getelementptr inbounds float, ptr %A, i64 %mul26, !dbg !40103  store float %add25, ptr %arrayidx27, align 4, !dbg !40104  %tmp14 = add nsw i64 %tmp3, 1, !dbg !41105  %exitcond = icmp ne i64 %tmp14, 1024, !dbg !10106  br i1 %exitcond, label %for.body, label %for.end, !dbg !10107 108for.end:                                          ; preds = %for.body109  ret void, !dbg !42110}111 112!llvm.dbg.cu = !{!0}113!llvm.module.flags = !{!7, !8}114!llvm.ident = !{!9}115 116!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.6.0 ", isOptimized: true, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)117!1 = !DIFile(filename: "/tmp/test.c", directory: "/home/grosser/Projects/polly/git/tools/polly/test")118!2 = !{}119!4 = distinct !DISubprogram(name: "manyaccesses", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 2, file: !1, scope: !5, type: !6, retainedNodes: !2)120!5 = !DIFile(filename: "/tmp/test.c", directory: "/home/grosser/Projects/polly/git/tools/polly/test")121!6 = !DISubroutineType(types: !2)122!7 = !{i32 2, !"Dwarf Version", i32 4}123!8 = !{i32 2, !"Debug Info Version", i32 3}124!9 = !{!"clang version 3.6.0 "}125!10 = !DILocation(line: 3, column: 20, scope: !11)126!11 = !DILexicalBlockFile(discriminator: 2, file: !1, scope: !12)127!12 = !DILexicalBlockFile(discriminator: 1, file: !1, scope: !13)128!13 = distinct !DILexicalBlock(line: 3, column: 3, file: !1, scope: !14)129!14 = distinct !DILexicalBlock(line: 3, column: 3, file: !1, scope: !4)130!15 = !DILocation(line: 8, column: 16, scope: !16)131!16 = distinct !DILexicalBlock(line: 3, column: 35, file: !1, scope: !13)132!17 = !DILocation(line: 4, column: 26, scope: !16)133!18 = !DILocation(line: 4, column: 22, scope: !16)134!19 = !DILocation(line: 7, column: 16, scope: !16)135!20 = !DILocation(line: 9, column: 16, scope: !16)136!21 = !DILocation(line: 10, column: 16, scope: !16)137!22 = !DILocation(line: 4, column: 16, scope: !16)138!27 = !DILocation(line: 5, column: 26, scope: !16)139!28 = !DILocation(line: 5, column: 16, scope: !16)140!29 = !DILocation(line: 6, column: 16, scope: !16)141!30 = !DILocation(line: 11, column: 23, scope: !16) ; [ DW_TAG_lexical_block ] [/]142!31 = !DILocation(line: 11, column: 16, scope: !16) ; [ DW_TAG_lexical_block ] [/]143!32 = !DILocation(line: 13, column: 21, scope: !16)144!33 = !DILocation(line: 13, column: 26, scope: !16)145!34 = !DILocation(line: 13, column: 31, scope: !16)146!35 = !DILocation(line: 13, column: 36, scope: !16)147!36 = !DILocation(line: 13, column: 41, scope: !16)148!37 = !DILocation(line: 13, column: 46, scope: !16)149!38 = !DILocation(line: 13, column: 51, scope: !16)150!39 = !DILocation(line: 13, column: 11, scope: !16)151!40 = !DILocation(line: 13, column: 5, scope: !16)152!41 = !DILocation(line: 3, column: 30, scope: !13)153!42 = !DILocation(line: 15, column: 1, scope: !4)154