[llvm-bugs] [Bug 32154] New: ISel is dropping constant llvm.dbg.value

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Mar 6 09:30:54 PST 2017


https://bugs.llvm.org/show_bug.cgi?id=32154

            Bug ID: 32154
           Summary: ISel is dropping constant llvm.dbg.value
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: DebugInfo
          Assignee: unassignedbugs at nondot.org
          Reporter: aprantl at apple.com
                CC: llvm-bugs at lists.llvm.org

Compiled with -O1 -g (r296116)

  float pi() __attribute__ ((noinline));
  float pi() { return 3.14f; }
  void barrier();
  void foo(float f) {
    barrier();
    f = pi();
  }

source_filename = "t.c"
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx"

; Function Attrs: noinline norecurse nounwind readnone ssp uwtable
define float @pi() local_unnamed_addr #0 !dbg !7 {
entry:
  ret float 0x40091EB860000000, !dbg !11
}

; Function Attrs: nounwind ssp uwtable
define void @foo(float %f) local_unnamed_addr #1 !dbg !12 {
entry:
  tail call void @llvm.dbg.value(metadata float %f, i64 0, metadata !16,
metadata !17), !dbg !18
  tail call void (...) @barrier() #4, !dbg !19
  tail call void @llvm.dbg.value(metadata float 0x40091EB860000000, i64 0,
metadata !16, metadata !17), !dbg !18
  ret void, !dbg !20
}

declare void @barrier(...) local_unnamed_addr

; Function Attrs: nounwind readnone
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #3

attributes #0 = { noinline norecurse nounwind readnone ssp uwtable}
attributes #1 = { nounwind ssp uwtable }
attributes #3 = { nounwind readnone }
attributes #4 = { nounwind }

!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4, !5}
!llvm.ident = !{!6}

!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang
version 5.0.0 (trunk 296116) (llvm/trunk 296134)", isOptimized: true,
runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "t.c", directory: "/tmp")
!2 = !{}
!3 = !{i32 2, !"Dwarf Version", i32 4}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !{i32 1, !"PIC Level", i32 2}
!6 = !{!"clang version 5.0.0 (trunk 296116) (llvm/trunk 296134)"}
!7 = distinct !DISubprogram(name: "pi", scope: !1, file: !1, line: 2, type: !8,
isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: true, unit: !0,
variables: !2)
!8 = !DISubroutineType(types: !9)
!9 = !{!10}
!10 = !DIBasicType(name: "float", size: 32, encoding: DW_ATE_float)
!11 = !DILocation(line: 2, column: 16, scope: !7)
!12 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 4, type:
!13, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped,
isOptimized: true, unit: !0, variables: !15)
!13 = !DISubroutineType(types: !14)
!14 = !{null, !10}
!15 = !{!16}
!16 = !DILocalVariable(name: "f", arg: 1, scope: !12, file: !1, line: 4, type:
!10)
!17 = !DIExpression()
!18 = !DILocation(line: 4, column: 18, scope: !12)
!19 = !DILocation(line: 5, column: 5, scope: !12)
!20 = !DILocation(line: 7, column: 3, scope: !12)



# *** IR Dump After Tail Duplication ***:
# Machine code for function foo: IsSSA, TracksLiveness

BB#0: derived from LLVM BB %entry
        DBG_VALUE %XMM0, %noreg, !"f", <!17>; line no:4
        %vreg1<def> = MOV32r0 %EFLAGS<imp-def,dead>; GR32:%vreg1 dbg:t.c:5:5
        %vreg2<def> = COPY %vreg1:sub_8bit; GR8:%vreg2 GR32:%vreg1 dbg:t.c:5:5
        %AL<def> = COPY %vreg2; GR8:%vreg2 dbg:t.c:5:5
        TCRETURNdi64 <ga:@barrier>, 0, <regmask %BH %BL %BP %BPL %BX %EBP %EBX
%RBP %RBX %R12 %R13 %R14 %R15 %R12B %R13B %R14B %R15B %R12D %R13D %R14D %R15D
%R12W %R13W %R14W %R15W>, %RSP<imp-use>, %AL<imp-use>; dbg:t.c:5:5

# End machine code for function foo.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170306/4925f07a/attachment-0001.html>


More information about the llvm-bugs mailing list