debug_info.ll 4.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. ; RUN: opt < %s -basicaa -slp-vectorizer -dce -S -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck %s
  2. target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
  3. target triple = "x86_64-apple-macosx10.7.0"
  4. ; int depth(double *A, int m) {
  5. ; double y0 = 0; double y1 = 1;
  6. ; for (int i=0; i < m; i++) {
  7. ; y0 = A[4];
  8. ; y1 = A[5];
  9. ; }
  10. ; A[8] = y0; A[8+1] = y1;
  11. ; }
  12. ;CHECK: @depth
  13. ;CHECK: getelementptr inbounds {{.*}}, !dbg ![[LOC:[0-9]+]]
  14. ;CHECK: bitcast double* {{.*}}, !dbg ![[LOC]]
  15. ;CHECK: load <2 x double>, <2 x double>* {{.*}}, !dbg ![[LOC]]
  16. ;CHECK: store <2 x double> {{.*}}, !dbg ![[LOC2:[0-9]+]]
  17. ;CHECK: ret
  18. ;CHECK: ![[LOC]] = !DILocation(line: 4, scope:
  19. ;CHECK: ![[LOC2]] = !DILocation(line: 7, scope:
  20. define i32 @depth(double* nocapture %A, i32 %m) #0 {
  21. entry:
  22. tail call void @llvm.dbg.value(metadata double* %A, i64 0, metadata !12, metadata !DIExpression()), !dbg !19
  23. tail call void @llvm.dbg.value(metadata i32 %m, i64 0, metadata !13, metadata !DIExpression()), !dbg !19
  24. tail call void @llvm.dbg.value(metadata i32 00, i64 0, metadata !14, metadata !DIExpression()), !dbg !21
  25. tail call void @llvm.dbg.value(metadata i32 02, i64 0, metadata !15, metadata !DIExpression()), !dbg !21
  26. tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !16, metadata !DIExpression()), !dbg !23
  27. %cmp8 = icmp sgt i32 %m, 0, !dbg !23
  28. br i1 %cmp8, label %for.body.lr.ph, label %for.end, !dbg !23
  29. for.body.lr.ph: ; preds = %entry
  30. %arrayidx = getelementptr inbounds double, double* %A, i64 4, !dbg !24
  31. %0 = load double, double* %arrayidx, align 8, !dbg !24
  32. %arrayidx1 = getelementptr inbounds double, double* %A, i64 5, !dbg !29
  33. %1 = load double, double* %arrayidx1, align 8, !dbg !29
  34. br label %for.end, !dbg !23
  35. for.end: ; preds = %for.body.lr.ph, %entry
  36. %y1.0.lcssa = phi double [ %1, %for.body.lr.ph ], [ 1.000000e+00, %entry ]
  37. %y0.0.lcssa = phi double [ %0, %for.body.lr.ph ], [ 0.000000e+00, %entry ]
  38. %arrayidx2 = getelementptr inbounds double, double* %A, i64 8, !dbg !30
  39. store double %y0.0.lcssa, double* %arrayidx2, align 8, !dbg !30
  40. %arrayidx3 = getelementptr inbounds double, double* %A, i64 9, !dbg !30
  41. store double %y1.0.lcssa, double* %arrayidx3, align 8, !dbg !30
  42. ret i32 undef, !dbg !31
  43. }
  44. ; Function Attrs: nounwind readnone
  45. declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1
  46. attributes #0 = { nounwind ssp uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
  47. attributes #1 = { nounwind readnone }
  48. !llvm.dbg.cu = !{!0}
  49. !llvm.module.flags = !{!18, !32}
  50. !0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 187335) (llvm/trunk 187335:187340M)", isOptimized: true, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
  51. !1 = !DIFile(filename: "file.c", directory: "/Users/nadav")
  52. !2 = !{}
  53. !3 = !{!4}
  54. !4 = !DISubprogram(name: "depth", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1, file: !1, scope: !5, type: !6, function: i32 (double*, i32)* @depth, variables: !11)
  55. !5 = !DIFile(filename: "file.c", directory: "/Users/nadav")
  56. !6 = !DISubroutineType(types: !7)
  57. !7 = !{!8, !9, !8}
  58. !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
  59. !9 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !10)
  60. !10 = !DIBasicType(tag: DW_TAG_base_type, name: "double", size: 64, align: 64, encoding: DW_ATE_float)
  61. !11 = !{!12, !13, !14, !15, !16}
  62. !12 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "A", line: 1, arg: 1, scope: !4, file: !5, type: !9)
  63. !13 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "m", line: 1, arg: 2, scope: !4, file: !5, type: !8)
  64. !14 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "y0", line: 2, scope: !4, file: !5, type: !10)
  65. !15 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "y1", line: 2, scope: !4, file: !5, type: !10)
  66. !16 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "i", line: 3, scope: !17, file: !5, type: !8)
  67. !17 = distinct !DILexicalBlock(line: 3, column: 0, file: !1, scope: !4)
  68. !18 = !{i32 2, !"Dwarf Version", i32 2}
  69. !19 = !DILocation(line: 1, scope: !4)
  70. !20 = !{double 0.000000e+00}
  71. !21 = !DILocation(line: 2, scope: !4)
  72. !22 = !{double 1.000000e+00}
  73. !23 = !DILocation(line: 3, scope: !17)
  74. !24 = !DILocation(line: 4, scope: !25)
  75. !25 = distinct !DILexicalBlock(line: 3, column: 0, file: !1, scope: !17)
  76. !29 = !DILocation(line: 5, scope: !25)
  77. !30 = !DILocation(line: 7, scope: !4)
  78. !31 = !DILocation(line: 8, scope: !4)
  79. !32 = !{i32 1, !"Debug Info Version", i32 3}