78 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<detect>' -polly-print-detect -polly-report -disable-output < %s 2>&1 | FileCheck %s2target datalayout = "e-i64:64-f80:128-s:64-n8:16:32:64-S128"3 4; Function Attrs: nounwind uwtable5define void @foo(ptr %A) !dbg !4 {6entry:7 br label %entry.split8 9entry.split: ; preds = %entry10 br label %for.body, !dbg !1111 12for.body: ; preds = %entry.split, %for.body13 %indvar = phi i64 [ 0, %entry.split ], [ %indvar.next, %for.body ]14 %i.01 = trunc i64 %indvar to i32, !dbg !1315 %arrayidx = getelementptr float, ptr %A, i64 %indvar, !dbg !1316 %conv = sitofp i32 %i.01 to float, !dbg !1317 store float %conv, ptr %arrayidx, align 4, !dbg !1318 %indvar.next = add i64 %indvar, 1, !dbg !1119 %exitcond = icmp ne i64 %indvar.next, 100, !dbg !1120 br i1 %exitcond, label %for.body, label %for.end, !dbg !1121 22for.end: ; preds = %for.body23 ret void, !dbg !1424}25 26; CHECK: note: Polly detected an optimizable loop region (scop) in function 'foo'27; CHECK: test.c:2: Start of scop28; CHECK: test.c:3: End of scop29 30; Function Attrs: nounwind uwtable31define void @bar(ptr %A) !dbg !7 {32entry:33 br label %entry.split34 35entry.split: ; preds = %entry36 br label %for.body, !dbg !1537 38for.body: ; preds = %entry.split, %for.body39 %indvar = phi i64 [ 0, %entry.split ], [ %indvar.next, %for.body ]40 %i.01 = trunc i64 %indvar to i32, !dbg !1741 %arrayidx = getelementptr float, ptr %A, i64 %indvar, !dbg !1742 %conv = sitofp i32 %i.01 to float, !dbg !1743 store float %conv, ptr %arrayidx, align 4, !dbg !1744 %indvar.next = add i64 %indvar, 1, !dbg !1545 %exitcond = icmp ne i64 %indvar.next, 100, !dbg !1546 br i1 %exitcond, label %for.body, label %for.end, !dbg !1547 48for.end: ; preds = %for.body49 ret void, !dbg !1850}51 52; CHECK: note: Polly detected an optimizable loop region (scop) in function 'bar'53; CHECK: test.c:9: Start of scop54; CHECK: test.c:13: End of scop55 56!llvm.dbg.cu = !{!0}57!llvm.module.flags = !{!8, !9}58!llvm.ident = !{!10}59 60!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)61!1 = !DIFile(filename: "test.c", directory: "/home/grosser/Projects/polly/git/tools/polly")62!2 = !{}63!4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 1, file: !1, scope: !5, type: !6, retainedNodes: !2)64!5 = !DIFile(filename: "test.c", directory: "/home/grosser/Projects/polly/git/tools/polly")65!6 = !DISubroutineType(types: !{null})66!7 = distinct !DISubprogram(name: "bar", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 6, file: !1, scope: !5, type: !6, retainedNodes: !2)67!8 = !{i32 2, !"Dwarf Version", i32 4}68!9 = !{i32 1, !"Debug Info Version", i32 3}69!10 = !{!"clang version 3.5 "}70!11 = !DILocation(line: 2, scope: !12)71!12 = distinct !DILexicalBlock(line: 2, column: 0, file: !1, scope: !4)72!13 = !DILocation(line: 3, scope: !12)73!14 = !DILocation(line: 4, scope: !4)74!15 = !DILocation(line: 9, scope: !16)75!16 = distinct !DILexicalBlock(line: 9, column: 0, file: !1, scope: !7)76!17 = !DILocation(line: 13, scope: !16)77!18 = !DILocation(line: 14, scope: !7)78