1 ; RUN: opt %loadPolly \
2 ; RUN: -polly-analyze-read-only-scalars=false -polly-codegen -S < %s | \
5 ; RUN: opt %loadPolly \
6 ; RUN: -polly-analyze-read-only-scalars=true -polly-codegen -S < %s | \
9 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
11 ; Function Attrs: nounwind uwtable
12 define void @foo(ptr %A, i64 %N) #0 !dbg !4 {
16 entry.split: ; preds = %entry
17 tail call void @llvm.dbg.value(metadata ptr %A, metadata !14, metadata !DIExpression()), !dbg !15
18 tail call void @llvm.dbg.value(metadata i64 %N, metadata !16, metadata !DIExpression()), !dbg !15
19 tail call void @llvm.dbg.value(metadata i64 0, metadata !18, metadata !DIExpression()), !dbg !20
20 %cmp1 = icmp sgt i64 %N, 0, !dbg !20
21 br i1 %cmp1, label %for.body.lr.ph, label %for.end, !dbg !20
23 for.body.lr.ph: ; preds = %entry.split
24 br label %for.body, !dbg !20
26 for.body: ; preds = %for.body.lr.ph, %for.body
27 %0 = phi i64 [ 0, %for.body.lr.ph ], [ %1, %for.body ], !dbg !21
28 %arrayidx = getelementptr float, ptr %A, i64 %0, !dbg !21
29 %conv = sitofp i64 %0 to float, !dbg !21
30 store float %conv, ptr %arrayidx, align 4, !dbg !21
31 %1 = add nsw i64 %0, 1, !dbg !20
32 tail call void @llvm.dbg.value(metadata i64 %1, metadata !18, metadata !DIExpression()), !dbg !20
33 %exitcond = icmp ne i64 %1, %N, !dbg !20
34 br i1 %exitcond, label %for.body, label %for.cond.for.end_crit_edge, !dbg !20
36 for.cond.for.end_crit_edge: ; preds = %for.body
37 br label %for.end, !dbg !20
39 for.end: ; preds = %for.cond.for.end_crit_edge, %entry.split
43 ; CHECK: polly.split_new_and_old:
45 ; CHECK: tail call void @llvm.dbg.value
46 ; CHECK: tail call void @llvm.dbg.value
47 ; CHECK: tail call void @llvm.dbg.value
48 ; CHECK: tail call void @llvm.dbg.value
49 ; CHECK-NOT: tail call void @llvm.dbg.value
51 ; Function Attrs: nounwind readnone
52 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
54 ; Function Attrs: nounwind readnone
55 declare void @llvm.dbg.value(metadata, metadata, metadata) #1
57 attributes #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" }
58 attributes #1 = { nounwind readnone }
61 !llvm.module.flags = !{!11, !12}
64 !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)
65 !1 = !DIFile(filename: "loop.c", directory: "/home/grosser/Projects/polly/git/tools/polly")
67 !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)
68 !5 = !DIFile(filename: "loop.c", directory: "/home/grosser/Projects/polly/git/tools/polly")
69 !6 = !DISubroutineType(types: !7)
71 !8 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !9)
72 !9 = !DIBasicType(tag: DW_TAG_base_type, name: "float", size: 32, align: 32, encoding: DW_ATE_float)
73 !10 = !DIBasicType(tag: DW_TAG_base_type, name: "long int", size: 64, align: 64, encoding: DW_ATE_signed)
74 !11 = !{i32 2, !"Dwarf Version", i32 4}
75 !12 = !{i32 1, !"Debug Info Version", i32 3}
76 !13 = !{!"clang version 3.5 "}
77 !14 = !DILocalVariable(name: "A", line: 1, arg: 1, scope: !4, file: !5, type: !8)
78 !15 = !DILocation(line: 1, scope: !4)
79 !16 = !DILocalVariable(name: "N", line: 1, arg: 2, scope: !4, file: !5, type: !10)
81 !18 = !DILocalVariable(name: "i", line: 2, scope: !19, file: !5, type: !10)
82 !19 = distinct !DILexicalBlock(line: 2, column: 0, file: !1, scope: !4)
83 !20 = !DILocation(line: 2, scope: !19)
84 !21 = !DILocation(line: 3, scope: !19)
85 !22 = !DILocation(line: 4, scope: !4)