mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-10 14:10:58 +00:00
4eeaa0da04
Currently each Function points to a DISubprogram and DISubprogram has a scope field. For member functions the scope is a DICompositeType. DIScopes point to the DICompileUnit to facilitate type uniquing. Distinct DISubprograms (with isDefinition: true) are not part of the type hierarchy and cannot be uniqued. This change removes the subprograms list from DICompileUnit and instead adds a pointer to the owning compile unit to distinct DISubprograms. This would make it easy for ThinLTO to strip unneeded DISubprograms and their transitively referenced debug info. Motivation ---------- Materializing DISubprograms is currently the most expensive operation when doing a ThinLTO build of clang. We want the DISubprogram to be stored in a separate Bitcode block (or the same block as the function body) so we can avoid having to expensively deserialize all DISubprograms together with the global metadata. If a function has been inlined into another subprogram we need to store a reference the block containing the inlined subprogram. Attached to https://llvm.org/bugs/show_bug.cgi?id=27284 is a python script that updates LLVM IR testcases to the new format. http://reviews.llvm.org/D19034 <rdar://problem/25256815> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266446 91177308-0d34-0410-b5e6-96231b3b80d8
47 lines
2.0 KiB
LLVM
47 lines
2.0 KiB
LLVM
; RUN: llc -mtriple=i686-windows-msvc < %s | FileCheck %s --check-prefix=ASM
|
|
; RUN: llc -mtriple=i686-windows-msvc < %s -filetype=obj | llvm-readobj -codeview - | FileCheck %s --check-prefix=OBJ
|
|
target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
|
|
target triple = "i686-pc-windows-msvc18.0.0"
|
|
|
|
define double @f(double %p1) !dbg !4 {
|
|
entry:
|
|
%sub = fsub double -0.000000e+00, %p1, !dbg !16
|
|
tail call void @llvm.dbg.value(metadata double %sub, i64 0, metadata !10, metadata !14), !dbg !15
|
|
ret double %sub
|
|
}
|
|
|
|
; ASM: .cv_def_range Lfunc_begin0 Lfunc_end0, "A\021\200\000\000\000"
|
|
; OBJ: DefRangeRegister {
|
|
; OBJ: Register: 128
|
|
; OBJ: MayHaveNoName: 0
|
|
; OBJ: LocalVariableAddrRange {
|
|
; OBJ: OffsetStart: .text+0x0
|
|
; OBJ: ISectStart: 0x0
|
|
; OBJ: Range: 0x7
|
|
; OBJ: }
|
|
; OBJ: }
|
|
|
|
; Function Attrs: nounwind readnone
|
|
declare void @llvm.dbg.value(metadata, i64, metadata, metadata)
|
|
|
|
!llvm.dbg.cu = !{!0}
|
|
!llvm.module.flags = !{!11, !12}
|
|
!llvm.ident = !{!13}
|
|
|
|
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 (trunk 261537) (llvm/trunk 261463)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
|
|
!1 = !DIFile(filename: "<stdin>", directory: "/")
|
|
!2 = !{}
|
|
!4 = distinct !DISubprogram(name: "f", linkageName: "f", scope: !5, file: !5, line: 2, type: !6, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !9)
|
|
!5 = !DIFile(filename: "t.ii", directory: "/")
|
|
!6 = !DISubroutineType(types: !7)
|
|
!7 = !{null, !8}
|
|
!8 = !DIBasicType(name: "double", size: 64, align: 64, encoding: DW_ATE_float)
|
|
!9 = !{!10}
|
|
!10 = !DILocalVariable(name: "p1", arg: 1, scope: !4, file: !5, line: 2, type: !8)
|
|
!11 = !{i32 2, !"CodeView", i32 1}
|
|
!12 = !{i32 2, !"Debug Info Version", i32 3}
|
|
!13 = !{!"clang version 3.9.0 (trunk 261537) (llvm/trunk 261463)"}
|
|
!14 = !DIExpression()
|
|
!15 = !DILocation(line: 2, scope: !4)
|
|
!16 = !DILocation(line: 3, scope: !4)
|