diff options
author | Dan Gohman <gohman@apple.com> | 2012-03-14 23:05:06 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2012-03-14 23:05:06 +0000 |
commit | 8b11fdd8bb78840937ceebdfe44397dd8d2697fd (patch) | |
tree | 5945f329e54af25e443cbfcc238cef4776fa1bfe /test/Transforms | |
parent | 4ec692317bc38588d01edb7584953c9aca4a9467 (diff) | |
download | external_llvm-8b11fdd8bb78840937ceebdfe44397dd8d2697fd.zip external_llvm-8b11fdd8bb78840937ceebdfe44397dd8d2697fd.tar.gz external_llvm-8b11fdd8bb78840937ceebdfe44397dd8d2697fd.tar.bz2 |
When an invoke is marked with metadata indicating its unwind edge
should be ignored by ARC optimization, don't insert new ARC runtime
calls in the unwind destination.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152748 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/ObjCARC/invoke.ll | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/Transforms/ObjCARC/invoke.ll b/test/Transforms/ObjCARC/invoke.ll index cf971e4..9e26209 100644 --- a/test/Transforms/ObjCARC/invoke.ll +++ b/test/Transforms/ObjCARC/invoke.ll @@ -2,6 +2,7 @@ declare i8* @objc_retain(i8*) declare void @objc_release(i8*) +declare i8* @objc_retainAutoreleasedReturnValue(i8*) declare i8* @objc_msgSend(i8*, i8*, ...) declare void @use_pointer(i8*) declare void @callee() @@ -68,6 +69,41 @@ done: ret void } +; The optimizer should ignore invoke unwind paths consistently. +; PR12265 + +; CHECK: define void @test2() { +; CHECK: invoke.cont: +; CHECK-NEXT: call i8* @objc_retain +; CHEK-NOT: @objc +; CHECK: finally.cont: +; CHECK-NEXT: call void @objc_release +; CHEK-NOT: @objc +; CHECK: finally.rethrow: +; CHEK-NOT: @objc +; CHECK: } +define void @test2() { +entry: + %call = invoke i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* ()*)() + to label %invoke.cont unwind label %finally.rethrow, !clang.arc.no_objc_arc_exceptions !0 + +invoke.cont: ; preds = %entry + %tmp1 = tail call i8* @objc_retainAutoreleasedReturnValue(i8* %call) nounwind + call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void ()*)(), !clang.arc.no_objc_arc_exceptions !0 + invoke void @use_pointer(i8* %call) + to label %finally.cont unwind label %finally.rethrow, !clang.arc.no_objc_arc_exceptions !0 + +finally.cont: ; preds = %invoke.cont + tail call void @objc_release(i8* %call) nounwind, !clang.imprecise_release !0 + ret void + +finally.rethrow: ; preds = %invoke.cont, %entry + %tmp2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*) + catch i8* null + unreachable +} + declare i32 @__gxx_personality_v0(...) +declare i32 @__objc_personality_v0(...) !0 = metadata !{} |