xref: /llvm-project/polly/test/CodeGen/debug-intrinsics.ll (revision 094572701dce4aaf36f4521d6cf750420d39f206)
1e1f056f6Srahulana-quic; RUN: opt %loadNPMPolly \
2e1f056f6Srahulana-quic; RUN: -polly-analyze-read-only-scalars=false -passes=polly-codegen -S < %s | \
335f70200SMichael Kruse; RUN: FileCheck %s
435f70200SMichael Kruse
5e1f056f6Srahulana-quic; RUN: opt %loadNPMPolly \
6e1f056f6Srahulana-quic; RUN: -polly-analyze-read-only-scalars=true -passes=polly-codegen -S < %s | \
735f70200SMichael Kruse; RUN: FileCheck %s
835f70200SMichael Kruse
935f70200SMichael Krusetarget datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
1035f70200SMichael Kruse
1135f70200SMichael Kruse; Function Attrs: nounwind uwtable
12b332499aSNikita Popovdefine void @foo(ptr %A, i64 %N) #0 !dbg !4 {
1335f70200SMichael Kruseentry:
1435f70200SMichael Kruse  br label %entry.split
1535f70200SMichael Kruse
1635f70200SMichael Kruseentry.split:                                      ; preds = %entry
17b332499aSNikita Popov  tail call void @llvm.dbg.value(metadata ptr %A, metadata !14, metadata !DIExpression()), !dbg !15
1835f70200SMichael Kruse  tail call void @llvm.dbg.value(metadata i64 %N, metadata !16, metadata !DIExpression()), !dbg !15
1935f70200SMichael Kruse  tail call void @llvm.dbg.value(metadata i64 0, metadata !18, metadata !DIExpression()), !dbg !20
2035f70200SMichael Kruse  %cmp1 = icmp sgt i64 %N, 0, !dbg !20
2135f70200SMichael Kruse  br i1 %cmp1, label %for.body.lr.ph, label %for.end, !dbg !20
2235f70200SMichael Kruse
2335f70200SMichael Krusefor.body.lr.ph:                                   ; preds = %entry.split
2435f70200SMichael Kruse  br label %for.body, !dbg !20
2535f70200SMichael Kruse
2635f70200SMichael Krusefor.body:                                         ; preds = %for.body.lr.ph, %for.body
2735f70200SMichael Kruse  %0 = phi i64 [ 0, %for.body.lr.ph ], [ %1, %for.body ], !dbg !21
28b332499aSNikita Popov  %arrayidx = getelementptr float, ptr %A, i64 %0, !dbg !21
2935f70200SMichael Kruse  %conv = sitofp i64 %0 to float, !dbg !21
30b332499aSNikita Popov  store float %conv, ptr %arrayidx, align 4, !dbg !21
3135f70200SMichael Kruse  %1 = add nsw i64 %0, 1, !dbg !20
3235f70200SMichael Kruse  tail call void @llvm.dbg.value(metadata i64 %1, metadata !18, metadata !DIExpression()), !dbg !20
3335f70200SMichael Kruse  %exitcond = icmp ne i64 %1, %N, !dbg !20
3435f70200SMichael Kruse  br i1 %exitcond, label %for.body, label %for.cond.for.end_crit_edge, !dbg !20
3535f70200SMichael Kruse
3635f70200SMichael Krusefor.cond.for.end_crit_edge:                       ; preds = %for.body
3735f70200SMichael Kruse  br label %for.end, !dbg !20
3835f70200SMichael Kruse
3935f70200SMichael Krusefor.end:                                          ; preds = %for.cond.for.end_crit_edge, %entry.split
4035f70200SMichael Kruse  ret void, !dbg !22
4135f70200SMichael Kruse}
4235f70200SMichael Kruse
4335f70200SMichael Kruse; CHECK: polly.split_new_and_old:
4435f70200SMichael Kruse
45*09457270SStephen Tozer; CHECK: #dbg_value
46*09457270SStephen Tozer; CHECK: #dbg_value
47*09457270SStephen Tozer; CHECK: #dbg_value
48*09457270SStephen Tozer; CHECK: #dbg_value
49*09457270SStephen Tozer; CHECK-NOT: #dbg_value
5035f70200SMichael Kruse
5135f70200SMichael Kruse; Function Attrs: nounwind readnone
5235f70200SMichael Krusedeclare void @llvm.dbg.declare(metadata, metadata, metadata) #1
5335f70200SMichael Kruse
5435f70200SMichael Kruse; Function Attrs: nounwind readnone
5535f70200SMichael Krusedeclare void @llvm.dbg.value(metadata, metadata, metadata) #1
5635f70200SMichael Kruse
5735f70200SMichael Kruseattributes #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" }
5835f70200SMichael Kruseattributes #1 = { nounwind readnone }
5935f70200SMichael Kruse
6035f70200SMichael Kruse!llvm.dbg.cu = !{!0}
6135f70200SMichael Kruse!llvm.module.flags = !{!11, !12}
6235f70200SMichael Kruse!llvm.ident = !{!13}
6335f70200SMichael Kruse
6435f70200SMichael Kruse!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)
6535f70200SMichael Kruse!1 = !DIFile(filename: "loop.c", directory: "/home/grosser/Projects/polly/git/tools/polly")
6635f70200SMichael Kruse!2 = !{}
6735f70200SMichael Kruse!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)
6835f70200SMichael Kruse!5 = !DIFile(filename: "loop.c", directory: "/home/grosser/Projects/polly/git/tools/polly")
6935f70200SMichael Kruse!6 = !DISubroutineType(types: !7)
7035f70200SMichael Kruse!7 = !{null, !8, !10}
7135f70200SMichael Kruse!8 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !9)
7235f70200SMichael Kruse!9 = !DIBasicType(tag: DW_TAG_base_type, name: "float", size: 32, align: 32, encoding: DW_ATE_float)
7335f70200SMichael Kruse!10 = !DIBasicType(tag: DW_TAG_base_type, name: "long int", size: 64, align: 64, encoding: DW_ATE_signed)
7435f70200SMichael Kruse!11 = !{i32 2, !"Dwarf Version", i32 4}
7535f70200SMichael Kruse!12 = !{i32 1, !"Debug Info Version", i32 3}
7635f70200SMichael Kruse!13 = !{!"clang version 3.5 "}
7735f70200SMichael Kruse!14 = !DILocalVariable(name: "A", line: 1, arg: 1, scope: !4, file: !5, type: !8)
7835f70200SMichael Kruse!15 = !DILocation(line: 1, scope: !4)
7935f70200SMichael Kruse!16 = !DILocalVariable(name: "N", line: 1, arg: 2, scope: !4, file: !5, type: !10)
8035f70200SMichael Kruse!17 = !{i64 0}
8135f70200SMichael Kruse!18 = !DILocalVariable(name: "i", line: 2, scope: !19, file: !5, type: !10)
8235f70200SMichael Kruse!19 = distinct !DILexicalBlock(line: 2, column: 0, file: !1, scope: !4)
8335f70200SMichael Kruse!20 = !DILocation(line: 2, scope: !19)
8435f70200SMichael Kruse!21 = !DILocation(line: 3, scope: !19)
8535f70200SMichael Kruse!22 = !DILocation(line: 4, scope: !4)
86