diff options
author | Adrian Prantl <aprantl@apple.com> | 2014-10-01 18:55:02 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2014-10-01 18:55:02 +0000 |
commit | 87b7eb9d0f9555835f35350c20d68957c8f1724c (patch) | |
tree | 583ed6fd55e4175d63d0f7172206cbcf1170131f /llvm/test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll | |
parent | 08a83be3eabb0ab202f4610ec154e69f5952387e (diff) | |
download | bcm5719-llvm-87b7eb9d0f9555835f35350c20d68957c8f1724c.tar.gz bcm5719-llvm-87b7eb9d0f9555835f35350c20d68957c8f1724c.zip |
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.
llvm-svn: 218787
Diffstat (limited to 'llvm/test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll')
-rw-r--r-- | llvm/test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll b/llvm/test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll index 79e300cb6b4..84d4c077df7 100644 --- a/llvm/test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll +++ b/llvm/test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll @@ -41,10 +41,10 @@ entry: %tmp2 = bitcast %struct._class_t* %tmp to i8*, !dbg !37 ; CHECK: call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)(i8* %tmp2, i8* %tmp1) %call = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)(i8* %tmp2, i8* %tmp1), !dbg !37, !clang.arc.no_objc_arc_exceptions !38 - call void @llvm.dbg.value(metadata !{i8* %call}, i64 0, metadata !12), !dbg !37 + call void @llvm.dbg.value(metadata !{i8* %call}, i64 0, metadata !12, metadata !{}), !dbg !37 ; CHECK: call i8* @objc_retain(i8* %call) [[NUW:#[0-9]+]] %tmp3 = call i8* @objc_retain(i8* %call) nounwind, !dbg !39 - call void @llvm.dbg.value(metadata !{i8* %call}, i64 0, metadata !25), !dbg !39 + call void @llvm.dbg.value(metadata !{i8* %call}, i64 0, metadata !25, metadata !{}), !dbg !39 invoke fastcc void @ThrowFunc(i8* %call) to label %eh.cont unwind label %lpad, !dbg !40, !clang.arc.no_objc_arc_exceptions !38 @@ -58,7 +58,7 @@ lpad: ; preds = %entry catch i8* null, !dbg !40 %tmp5 = extractvalue { i8*, i32 } %tmp4, 0, !dbg !40 %exn.adjusted = call i8* @objc_begin_catch(i8* %tmp5) nounwind, !dbg !44 - call void @llvm.dbg.value(metadata !45, i64 0, metadata !21), !dbg !46 + call void @llvm.dbg.value(metadata !45, i64 0, metadata !21, metadata !{}), !dbg !46 call void @objc_end_catch(), !dbg !49, !clang.arc.no_objc_arc_exceptions !38 ; CHECK: call void @objc_release(i8* %call) call void @objc_release(i8* %call) nounwind, !dbg !42, !clang.imprecise_release !38 @@ -72,7 +72,7 @@ if.end: ; preds = %lpad, %eh.cont ret i32 0, !dbg !54 } -declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone +declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone declare i8* @objc_msgSend(i8*, i8*, ...) nonlazybind @@ -87,7 +87,7 @@ declare void @objc_exception_rethrow() define internal fastcc void @ThrowFunc(i8* %obj) uwtable noinline ssp { entry: %tmp = call i8* @objc_retain(i8* %obj) nounwind - call void @llvm.dbg.value(metadata !{i8* %obj}, i64 0, metadata !32), !dbg !55 + call void @llvm.dbg.value(metadata !{i8* %obj}, i64 0, metadata !32, metadata !{}), !dbg !55 %tmp1 = load %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_1", align 8, !dbg !56 %tmp2 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_5", align 8, !dbg !56, !invariant.load !38 %tmp3 = bitcast %struct._class_t* %tmp1 to i8*, !dbg !56 @@ -102,7 +102,7 @@ declare void @objc_release(i8*) nonlazybind declare void @NSLog(i8*, ...) -declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone +declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone ; CHECK: attributes #0 = { ssp uwtable } ; CHECK: attributes #1 = { nounwind readnone } |