2012-12-01 01:22:49 +00:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-macosx -enable-misched \
|
|
|
|
; RUN: -verify-machineinstrs | FileCheck %s
|
|
|
|
;
|
|
|
|
; Test RegisterPressure handling of DBG_VALUE.
|
|
|
|
;
|
|
|
|
; CHECK: %entry
|
|
|
|
; CHECK: DEBUG_VALUE: callback
|
|
|
|
; CHECK: ret
|
|
|
|
|
|
|
|
%struct.btCompoundLeafCallback = type { i32, i32 }
|
|
|
|
|
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!
Note: I accidentally committed a bogus older version of this patch previously.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218787 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-01 18:55:02 +00:00
|
|
|
declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
|
2012-12-01 01:22:49 +00:00
|
|
|
|
|
|
|
define void @test() unnamed_addr uwtable ssp align 2 {
|
|
|
|
entry:
|
|
|
|
%callback = alloca %struct.btCompoundLeafCallback, align 8
|
|
|
|
br i1 undef, label %if.end, label %if.then
|
|
|
|
|
|
|
|
if.then: ; preds = %entry
|
|
|
|
unreachable
|
|
|
|
|
|
|
|
if.end: ; preds = %entry
|
2014-10-03 20:01:09 +00:00
|
|
|
call void @llvm.dbg.declare(metadata !{%struct.btCompoundLeafCallback* %callback}, metadata !3, metadata !{metadata !"0x102"})
|
2012-12-01 01:22:49 +00:00
|
|
|
%m = getelementptr inbounds %struct.btCompoundLeafCallback* %callback, i64 0, i32 1
|
|
|
|
store i32 0, i32* undef, align 8
|
|
|
|
%cmp12447 = icmp sgt i32 undef, 0
|
|
|
|
br i1 %cmp12447, label %for.body.lr.ph, label %invoke.cont44
|
|
|
|
|
|
|
|
for.body.lr.ph: ; preds = %if.end
|
|
|
|
unreachable
|
|
|
|
|
|
|
|
invoke.cont44: ; preds = %if.end
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
!llvm.dbg.cu = !{!0}
|
2013-11-22 21:49:45 +00:00
|
|
|
!llvm.module.flags = !{!8}
|
2012-12-01 01:22:49 +00:00
|
|
|
|
2014-10-03 20:01:09 +00:00
|
|
|
!0 = metadata !{metadata !"0x11\004\00clang version 3.3 (trunk 168984) (llvm/trunk 168983)\001\00\000\00\000", metadata !6, null, null, metadata !1, null, null} ; [ DW_TAG_compile_unit ] [MultiSource/Benchmarks/Bullet/MultiSource/Benchmarks/Bullet/btCompoundCollisionAlgorithm.cpp] [DW_LANG_C_plus_plus]
|
2014-07-25 16:05:18 +00:00
|
|
|
!1 = metadata !{metadata !2}
|
2014-10-03 20:01:09 +00:00
|
|
|
!2 = metadata !{metadata !"0x2e\00test\00test\00\000\000\001\000\006\00256\001\001", metadata !6, metadata !5, metadata !7, null, void ()* @test, null, null, null} ; [ DW_TAG_subprogram ] [def] [test]
|
|
|
|
!3 = metadata !{metadata !"0x100\00callback\00214\000", null, null, metadata !4} ; [ DW_TAG_auto_variable ] [callback] [line 214]
|
|
|
|
!4 = metadata !{metadata !"0x13\00btCompoundLeafCallback\0090\00512\0064\000\000\000", metadata !6, null, null, null, null, null, null} ; [ DW_TAG_structure_type ] [btCompoundLeafCallback] [line 90, size 512, align 64, offset 0] [def] [from ]
|
|
|
|
!5 = metadata !{metadata !"0x29", metadata !6} ; [ DW_TAG_file_type ]
|
2013-03-17 21:13:55 +00:00
|
|
|
!6 = metadata !{metadata !"MultiSource/Benchmarks/Bullet/btCompoundCollisionAlgorithm.cpp", metadata !"MultiSource/Benchmarks/Bullet"}
|
2014-10-03 20:01:09 +00:00
|
|
|
!7 = metadata !{metadata !"0x15\00\000\000\000\000\000\000", i32 0, null, null, metadata !9, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
|
|
|
|
!8 = metadata !{i32 1, metadata !"Debug Info Version", i32 2}
|
2014-07-25 16:05:18 +00:00
|
|
|
!9 = metadata !{null}
|