2014-01-30 09:39:17 +08:00
; RUN: %llc_dwarf -march=x86 -asm-verbose < %s | grep DW_TAG_formal_parameter
2010-04-28 09:39:28 +08:00
%struct.Pt = type { double , double }
%struct.Rect = type { %struct.Pt , %struct.Pt }
define double @foo ( %struct.Rect * byval %my_r0 ) nounwind ssp {
entry:
%retval = alloca double ; <double*> [#uses=2]
%0 = alloca double ; <double*> [#uses=2]
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
Move the complex address expression out of DIVariable and into an extra
argument of the llvm.dbg.declare/llvm.dbg.value intrinsics.
Previously, DIVariable was a variable-length field that has an optional
reference to a Metadata array consisting of a variable number of
complex address expressions. In the case of OpPiece expressions this is
wasting a lot of storage in IR, because when an aggregate type is, e.g.,
SROA'd into all of its n individual members, the IR will contain n copies
of the DIVariable, all alike, only differing in the complex address
reference at the end.
By making the complex address into an extra argument of the
dbg.value/dbg.declare intrinsics, all of the pieces can reference the
same variable and the complex address expressions can be uniqued across
the CU, too.
Down the road, this will allow us to move other flags, such as
"indirection" out of the DIVariable, too.
The new intrinsics look like this:
declare void @llvm.dbg.declare(metadata %storage, metadata %var, metadata %expr)
declare void @llvm.dbg.value(metadata %storage, i64 %offset, metadata %var, metadata %expr)
This patch adds a new LLVM-local tag to DIExpressions, so we can detect
and pretty-print DIExpression metadata nodes.
What this patch doesn't do:
This patch does not touch the "Indirect" field in DIVariable; but moving
that into the expression would be a natural next step.
http://reviews.llvm.org/D4919
rdar://problem/17994491
Thanks to dblaikie and dexonsmith for reviewing this patch!
llvm-svn: 218778
2014-10-02 01:55:39 +08:00
call void @llvm.dbg.declare ( metadata ! { %struct.Rect * %my_r0 } , metadata !0 , metadata ! { } ) , !dbg !15
2010-04-28 09:39:28 +08:00
%1 = getelementptr inbounds %struct.Rect * %my_r0 , i32 0 , i32 0 , !dbg !16 ; <%struct.Pt*> [#uses=1]
%2 = getelementptr inbounds %struct.Pt * %1 , i32 0 , i32 0 , !dbg !16 ; <double*> [#uses=1]
%3 = load double * %2 , align 8 , !dbg !16 ; <double> [#uses=1]
store double %3 , double * %0 , align 8 , !dbg !16
%4 = load double * %0 , align 8 , !dbg !16 ; <double> [#uses=1]
store double %4 , double * %retval , align 8 , !dbg !16
br label %return , !dbg !16
return: ; preds = %entry
%retval1 = load double * %retval , !dbg !16 ; <double> [#uses=1]
ret double %retval1 , !dbg !16
}
Move the complex address expression out of DIVariable and into an extra
argument of the llvm.dbg.declare/llvm.dbg.value intrinsics.
Previously, DIVariable was a variable-length field that has an optional
reference to a Metadata array consisting of a variable number of
complex address expressions. In the case of OpPiece expressions this is
wasting a lot of storage in IR, because when an aggregate type is, e.g.,
SROA'd into all of its n individual members, the IR will contain n copies
of the DIVariable, all alike, only differing in the complex address
reference at the end.
By making the complex address into an extra argument of the
dbg.value/dbg.declare intrinsics, all of the pieces can reference the
same variable and the complex address expressions can be uniqued across
the CU, too.
Down the road, this will allow us to move other flags, such as
"indirection" out of the DIVariable, too.
The new intrinsics look like this:
declare void @llvm.dbg.declare(metadata %storage, metadata %var, metadata %expr)
declare void @llvm.dbg.value(metadata %storage, i64 %offset, metadata %var, metadata %expr)
This patch adds a new LLVM-local tag to DIExpressions, so we can detect
and pretty-print DIExpression metadata nodes.
What this patch doesn't do:
This patch does not touch the "Indirect" field in DIVariable; but moving
that into the expression would be a natural next step.
http://reviews.llvm.org/D4919
rdar://problem/17994491
Thanks to dblaikie and dexonsmith for reviewing this patch!
llvm-svn: 218778
2014-10-02 01:55:39 +08:00
declare void @llvm.dbg.declare ( metadata , metadata , metadata ) nounwind readnone
2010-04-28 09:39:28 +08:00
2013-03-08 08:23:31 +08:00
!llvm.dbg.cu = ! { !3 }
2013-11-23 05:49:45 +08:00
!llvm.module.flags = ! { !21 }
2013-03-08 08:23:31 +08:00
!0 = metadata ! { i32 786689 , metadata !1 , metadata !"my_r0" , metadata !2 , i32 11 , metadata !7 , i32 0 , null } ; [ DW_TAG_arg_variable ]
2013-07-30 02:12:58 +08:00
!1 = metadata ! { i32 786478 , metadata !19 , metadata !2 , metadata !"foo" , metadata !"foo" , metadata !"foo" , i32 11 , metadata !4 , i1 false , i1 true , i32 0 , i32 0 , null , i32 0 , i1 false , double ( %struct.Rect * ) * @foo , null , null , null , i32 0 } ; [ DW_TAG_subprogram ]
2013-03-28 10:44:59 +08:00
!2 = metadata ! { i32 786473 , metadata !19 } ; [ DW_TAG_file_type ]
2013-07-30 02:12:58 +08:00
!3 = metadata ! { i32 786449 , metadata !19 , i32 1 , metadata !"4.2.1 (Based on Apple Inc. build 5658) (LLVM build)" , i1 false , metadata !"" , i32 0 , metadata !20 , metadata !20 , metadata !18 , null , null , metadata !"" } ; [ DW_TAG_compile_unit ]
2013-08-27 06:39:55 +08:00
!4 = metadata ! { i32 786453 , metadata !19 , metadata !2 , metadata !"" , i32 0 , i64 0 , i64 0 , i64 0 , i32 0 , null , metadata !5 , i32 0 , null , null , null } ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
2010-04-28 09:39:28 +08:00
!5 = metadata ! { metadata !6 , metadata !7 }
2013-03-28 10:44:59 +08:00
!6 = metadata ! { i32 786468 , metadata !19 , metadata !2 , metadata !"double" , i32 0 , i64 64 , i64 64 , i64 0 , i32 0 , i32 4 } ; [ DW_TAG_base_type ]
2013-08-27 06:39:55 +08:00
!7 = metadata ! { i32 786451 , metadata !19 , metadata !2 , metadata !"Rect" , i32 6 , i64 256 , i64 64 , i64 0 , i32 0 , null , metadata !8 , i32 0 , null , null , null } ; [ DW_TAG_structure_type ] [Rect] [line 6, size 256, align 64, offset 0] [def] [from ]
2010-04-28 09:39:28 +08:00
!8 = metadata ! { metadata !9 , metadata !14 }
2013-03-28 10:44:59 +08:00
!9 = metadata ! { i32 786445 , metadata !19 , metadata !7 , metadata !"P1" , i32 7 , i64 128 , i64 64 , i64 0 , i32 0 , metadata !10 } ; [ DW_TAG_member ]
2013-08-27 06:39:55 +08:00
!10 = metadata ! { i32 786451 , metadata !19 , metadata !2 , metadata !"Pt" , i32 1 , i64 128 , i64 64 , i64 0 , i32 0 , null , metadata !11 , i32 0 , null , null , null } ; [ DW_TAG_structure_type ] [Pt] [line 1, size 128, align 64, offset 0] [def] [from ]
2010-04-28 09:39:28 +08:00
!11 = metadata ! { metadata !12 , metadata !13 }
2013-03-28 10:44:59 +08:00
!12 = metadata ! { i32 786445 , metadata !19 , metadata !10 , metadata !"x" , i32 2 , i64 64 , i64 64 , i64 0 , i32 0 , metadata !6 } ; [ DW_TAG_member ]
!13 = metadata ! { i32 786445 , metadata !19 , metadata !10 , metadata !"y" , i32 3 , i64 64 , i64 64 , i64 64 , i32 0 , metadata !6 } ; [ DW_TAG_member ]
!14 = metadata ! { i32 786445 , metadata !19 , metadata !7 , metadata !"P2" , i32 8 , i64 128 , i64 64 , i64 128 , i32 0 , metadata !10 } ; [ DW_TAG_member ]
2010-04-28 09:39:28 +08:00
!15 = metadata ! { i32 11 , i32 0 , metadata !1 , null }
!16 = metadata ! { i32 12 , i32 0 , metadata !17 , null }
2013-07-30 02:12:58 +08:00
!17 = metadata ! { i32 786443 , metadata !19 , metadata !1 , i32 11 , i32 0 , i32 0 } ; [ DW_TAG_lexical_block ]
2013-03-18 05:13:55 +08:00
!18 = metadata ! { metadata !1 }
!19 = metadata ! { metadata !"b2.c" , metadata !"/tmp/" }
2013-07-30 02:12:58 +08:00
!20 = metadata ! { i32 0 }
2013-11-23 05:49:45 +08:00
!21 = metadata ! { i32 1 , metadata !"Debug Info Version" , i32 1 }