Suppress partial retain+release elimination when there's a

possibility that it will span multiple CFG diamonds/triangles which
could have different controlling predicates.  rdar://10282956


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142222 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2011-10-17 18:48:25 +00:00
parent 3c5e60994f
commit 90b8bcd33a
2 changed files with 55 additions and 2 deletions
+31
View File
@@ -86,6 +86,37 @@ alt_return:
ret void
}
; Don't do partial elimination into two different CFG diamonds.
; CHECK: define void @test1b(
; CHECK: entry:
; CHECK: tail call i8* @objc_retain(i8* %x) nounwind
; CHECK-NOT: @objc_
; CHECK: if.end5:
; CHECK: tail call void @objc_release(i8* %x) nounwind, !clang.imprecise_release !0
; CHECK-NOT: @objc_
; CHECK: }
define void @test1b(i8* %x, i1 %p, i1 %q) {
entry:
tail call i8* @objc_retain(i8* %x) nounwind
br i1 %p, label %if.then, label %if.end
if.then: ; preds = %entry
tail call void @callee()
br label %if.end
if.end: ; preds = %if.then, %entry
br i1 %q, label %if.then3, label %if.end5
if.then3: ; preds = %if.end
tail call void @use_pointer(i8* %x)
br label %if.end5
if.end5: ; preds = %if.then3, %if.end
tail call void @objc_release(i8* %x) nounwind, !clang.imprecise_release !0
ret void
}
; Like test0 but the pointer is passed to an intervening call,
; so the optimization is not safe.