ignore-debug-info.ll 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. ; RUN: opt < %s -S -inline -inline-threshold=2 | FileCheck %s
  2. ; RUN: opt < %s -S -strip-debug -inline -inline-threshold=2 | FileCheck %s
  3. ;
  4. ; The purpose of this test is to check that debug info doesn't influence
  5. ; inlining decisions.
  6. 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"
  7. target triple = "x86_64-unknown-linux-gnu"
  8. declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
  9. declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1
  10. define <4 x float> @inner_vectors(<4 x float> %a, <4 x float> %b) {
  11. entry:
  12. call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !DILocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !DIExpression()), !dbg !DILocation(scope: !6)
  13. %mul = fmul <4 x float> %a, <float 3.000000e+00, float 3.000000e+00, float 3.000000e+00, float 3.000000e+00>
  14. call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !DILocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !DIExpression()), !dbg !DILocation(scope: !6)
  15. %mul1 = fmul <4 x float> %b, <float 5.000000e+00, float 5.000000e+00, float 5.000000e+00, float 5.000000e+00>
  16. call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !DILocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !DIExpression()), !dbg !DILocation(scope: !6)
  17. %add = fadd <4 x float> %mul, %mul1
  18. ret <4 x float> %add
  19. }
  20. define float @outer_vectors(<4 x float> %a, <4 x float> %b) {
  21. ; CHECK-LABEL: @outer_vectors(
  22. ; CHECK-NOT: call <4 x float> @inner_vectors(
  23. ; CHECK: ret float
  24. entry:
  25. call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !DILocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !DIExpression()), !dbg !DILocation(scope: !6)
  26. call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !DILocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !DIExpression()), !dbg !DILocation(scope: !6)
  27. %call = call <4 x float> @inner_vectors(<4 x float> %a, <4 x float> %b)
  28. call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !DILocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !DIExpression()), !dbg !DILocation(scope: !6)
  29. %vecext = extractelement <4 x float> %call, i32 0
  30. %vecext1 = extractelement <4 x float> %call, i32 1
  31. %add = fadd float %vecext, %vecext1
  32. %vecext2 = extractelement <4 x float> %call, i32 2
  33. %add3 = fadd float %add, %vecext2
  34. %vecext4 = extractelement <4 x float> %call, i32 3
  35. %add5 = fadd float %add3, %vecext4
  36. ret float %add5
  37. }
  38. attributes #0 = { nounwind readnone }
  39. !llvm.dbg.cu = !{!0}
  40. !llvm.module.flags = !{!3, !4}
  41. !llvm.ident = !{!5}
  42. !0 = !DICompileUnit(language: DW_LANG_C_plus_plus, isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !{!6}, globals: !2, imports: !2)
  43. !1 = !DIFile(filename: "test.c", directory: "")
  44. !2 = !{}
  45. !3 = !{i32 2, !"Dwarf Version", i32 4}
  46. !4 = !{i32 1, !"Debug Info Version", i32 3}
  47. !5 = !{!""}
  48. !6 = !DISubprogram()