summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/ObjCARC/contract.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Transforms/ObjCARC/contract.ll')
-rw-r--r--llvm/test/Transforms/ObjCARC/contract.ll90
1 files changed, 45 insertions, 45 deletions
diff --git a/llvm/test/Transforms/ObjCARC/contract.ll b/llvm/test/Transforms/ObjCARC/contract.ll
index 6ad46f2c85c..7cf3f5ea886 100644
--- a/llvm/test/Transforms/ObjCARC/contract.ll
+++ b/llvm/test/Transforms/ObjCARC/contract.ll
@@ -2,11 +2,11 @@
target datalayout = "e-p:64:64:64"
-declare i8* @objc_retain(i8*)
-declare void @objc_release(i8*)
-declare i8* @objc_autorelease(i8*)
-declare i8* @objc_autoreleaseReturnValue(i8*)
-declare i8* @objc_retainAutoreleasedReturnValue(i8*)
+declare i8* @llvm.objc.retain(i8*)
+declare void @llvm.objc.release(i8*)
+declare i8* @llvm.objc.autorelease(i8*)
+declare i8* @llvm.objc.autoreleaseReturnValue(i8*)
+declare i8* @llvm.objc.retainAutoreleasedReturnValue(i8*)
declare void @use_pointer(i8*)
declare i8* @returner()
@@ -17,7 +17,7 @@ declare void @callee()
; CHECK: }
define void @test0(i8* %x) nounwind {
entry:
- %0 = call i8* @objc_retain(i8* %x) nounwind
+ %0 = call i8* @llvm.objc.retain(i8* %x) nounwind
call void @use_pointer(i8* %x)
ret void
}
@@ -27,7 +27,7 @@ entry:
; CHECK: }
define void @test1(i8* %x) nounwind {
entry:
- %0 = call i8* @objc_autorelease(i8* %x) nounwind
+ %0 = call i8* @llvm.objc.autorelease(i8* %x) nounwind
call void @use_pointer(i8* %x)
ret void
}
@@ -35,12 +35,12 @@ entry:
; Merge objc_retain and objc_autorelease into objc_retainAutorelease.
; CHECK-LABEL: define void @test2(
-; CHECK: tail call i8* @objc_retainAutorelease(i8* %x) [[NUW:#[0-9]+]]
+; CHECK: tail call i8* @llvm.objc.retainAutorelease(i8* %x) [[NUW:#[0-9]+]]
; CHECK: }
define void @test2(i8* %x) nounwind {
entry:
- %0 = tail call i8* @objc_retain(i8* %x) nounwind
- call i8* @objc_autorelease(i8* %0) nounwind
+ %0 = tail call i8* @llvm.objc.retain(i8* %x) nounwind
+ call i8* @llvm.objc.autorelease(i8* %0) nounwind
call void @use_pointer(i8* %x)
ret void
}
@@ -48,26 +48,26 @@ entry:
; Same as test2 but the value is returned. Do an RV optimization.
; CHECK-LABEL: define i8* @test2b(
-; CHECK: tail call i8* @objc_retainAutoreleaseReturnValue(i8* %x) [[NUW]]
+; CHECK: tail call i8* @llvm.objc.retainAutoreleaseReturnValue(i8* %x) [[NUW]]
; CHECK: }
define i8* @test2b(i8* %x) nounwind {
entry:
- %0 = tail call i8* @objc_retain(i8* %x) nounwind
- tail call i8* @objc_autoreleaseReturnValue(i8* %0) nounwind
+ %0 = tail call i8* @llvm.objc.retain(i8* %x) nounwind
+ tail call i8* @llvm.objc.autoreleaseReturnValue(i8* %0) nounwind
ret i8* %x
}
; Merge a retain,autorelease pair around a call.
; CHECK-LABEL: define void @test3(
-; CHECK: tail call i8* @objc_retainAutorelease(i8* %x) [[NUW]]
+; CHECK: tail call i8* @llvm.objc.retainAutorelease(i8* %x) [[NUW]]
; CHECK: @use_pointer(i8* %0)
; CHECK: }
define void @test3(i8* %x, i64 %n) {
entry:
- tail call i8* @objc_retain(i8* %x) nounwind
+ tail call i8* @llvm.objc.retain(i8* %x) nounwind
call void @use_pointer(i8* %x)
- call i8* @objc_autorelease(i8* %x) nounwind
+ call i8* @llvm.objc.autorelease(i8* %x) nounwind
ret void
}
@@ -76,34 +76,34 @@ entry:
; CHECK-LABEL: define void @test4(
; CHECK-NEXT: entry:
-; CHECK-NEXT: @objc_retainAutorelease(i8* %x) [[NUW]]
+; CHECK-NEXT: @llvm.objc.retainAutorelease(i8* %x) [[NUW]]
; CHECK-NEXT: @use_pointer
-; CHECK-NEXT: @objc_release
+; CHECK-NEXT: @llvm.objc.release
; CHECK-NEXT: ret void
; CHECK-NEXT: }
define void @test4(i8* %x, i64 %n) {
entry:
- tail call i8* @objc_retain(i8* %x) nounwind
+ tail call i8* @llvm.objc.retain(i8* %x) nounwind
call void @use_pointer(i8* %x)
- call i8* @objc_autorelease(i8* %x) nounwind
- tail call void @objc_release(i8* %x) nounwind
+ call i8* @llvm.objc.autorelease(i8* %x) nounwind
+ tail call void @llvm.objc.release(i8* %x) nounwind
ret void
}
; Don't merge retain and autorelease if they're not control-equivalent.
; CHECK-LABEL: define void @test5(
-; CHECK: tail call i8* @objc_retain(i8* %p) [[NUW]]
+; CHECK: tail call i8* @llvm.objc.retain(i8* %p) [[NUW]]
; CHECK: true:
-; CHECK: call i8* @objc_autorelease(i8* %0) [[NUW]]
+; CHECK: call i8* @llvm.objc.autorelease(i8* %0) [[NUW]]
; CHECK: }
define void @test5(i8* %p, i1 %a) {
entry:
- tail call i8* @objc_retain(i8* %p) nounwind
+ tail call i8* @llvm.objc.retain(i8* %p) nounwind
br i1 %a, label %true, label %false
true:
- call i8* @objc_autorelease(i8* %p) nounwind
+ call i8* @llvm.objc.autorelease(i8* %p) nounwind
call void @use_pointer(i8* %p)
ret void
@@ -120,13 +120,13 @@ false:
; Those entrypoints don't exist yet though.
; CHECK-LABEL: define i8* @test6(
-; CHECK: call i8* @objc_retainAutoreleasedReturnValue(i8* %p) [[NUW]]
-; CHECK: %t = tail call i8* @objc_autoreleaseReturnValue(i8* %1) [[NUW]]
+; CHECK: call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %p) [[NUW]]
+; CHECK: %t = tail call i8* @llvm.objc.autoreleaseReturnValue(i8* %1) [[NUW]]
; CHECK: }
define i8* @test6() {
%p = call i8* @returner()
- tail call i8* @objc_retainAutoreleasedReturnValue(i8* %p) nounwind
- %t = tail call i8* @objc_autoreleaseReturnValue(i8* %p) nounwind
+ tail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %p) nounwind
+ %t = tail call i8* @llvm.objc.autoreleaseReturnValue(i8* %p) nounwind
call void @use_pointer(i8* %t)
ret i8* %t
}
@@ -134,15 +134,15 @@ define i8* @test6() {
; Don't spoil the RV optimization.
; CHECK: define i8* @test7(i8* %p)
-; CHECK: tail call i8* @objc_retain(i8* %p)
+; CHECK: tail call i8* @llvm.objc.retain(i8* %p)
; CHECK: call void @use_pointer(i8* %1)
-; CHECK: tail call i8* @objc_autoreleaseReturnValue(i8* %1)
+; CHECK: tail call i8* @llvm.objc.autoreleaseReturnValue(i8* %1)
; CHECK: ret i8* %2
; CHECK-NEXT: }
define i8* @test7(i8* %p) {
- %1 = tail call i8* @objc_retain(i8* %p)
+ %1 = tail call i8* @llvm.objc.retain(i8* %p)
call void @use_pointer(i8* %p)
- %2 = tail call i8* @objc_autoreleaseReturnValue(i8* %p)
+ %2 = tail call i8* @llvm.objc.autoreleaseReturnValue(i8* %p)
ret i8* %p
}
@@ -156,7 +156,7 @@ entry:
br i1 %x, label %return, label %if.then
if.then: ; preds = %entry
- %p = call i8* @objc_retain(i8* %c) nounwind
+ %p = call i8* @llvm.objc.retain(i8* %c) nounwind
br label %return
return: ; preds = %if.then, %entry
@@ -164,12 +164,12 @@ return: ; preds = %if.then, %entry
ret i8* %retval
}
-; Kill calls to @clang.arc.use(...)
+; Kill calls to @llvm.objc.clang.arc.use(...)
; CHECK-LABEL: define void @test9(
; CHECK-NOT: clang.arc.use
; CHECK: }
define void @test9(i8* %a, i8* %b) {
- call void (...) @clang.arc.use(i8* %a, i8* %b) nounwind
+ call void (...) @llvm.objc.clang.arc.use(i8* %a, i8* %b) nounwind
ret void
}
@@ -178,10 +178,10 @@ define void @test9(i8* %a, i8* %b) {
; is a return value.
; CHECK: define void @test10()
-; CHECK: tail call i8* @objc_retainAutoreleasedReturnValue(i8* %p)
+; CHECK: tail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %p)
define void @test10() {
%p = call i8* @returner()
- tail call i8* @objc_retain(i8* %p) nounwind
+ tail call i8* @llvm.objc.retain(i8* %p) nounwind
ret void
}
@@ -190,11 +190,11 @@ define void @test10() {
; CHECK-LABEL: define void @test11(
; CHECK-NEXT: %y = call i8* @returner()
-; CHECK-NEXT: tail call i8* @objc_retainAutoreleasedReturnValue(i8* %y) [[NUW]]
+; CHECK-NEXT: tail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %y) [[NUW]]
; CHECK-NEXT: ret void
define void @test11() {
%y = call i8* @returner()
- tail call i8* @objc_retain(i8* %y) nounwind
+ tail call i8* @llvm.objc.retain(i8* %y) nounwind
ret void
}
@@ -202,11 +202,11 @@ define void @test11() {
; argument is not a return value.
; CHECK-LABEL: define void @test12(
-; CHECK-NEXT: tail call i8* @objc_retain(i8* %y) [[NUW]]
+; CHECK-NEXT: tail call i8* @llvm.objc.retain(i8* %y) [[NUW]]
; CHECK-NEXT: ret void
; CHECK-NEXT: }
define void @test12(i8* %y) {
- tail call i8* @objc_retain(i8* %y) nounwind
+ tail call i8* @llvm.objc.retain(i8* %y) nounwind
ret void
}
@@ -216,17 +216,17 @@ define void @test12(i8* %y) {
; CHECK-LABEL: define void @test13(
; CHECK-NEXT: %y = call i8* @returner()
; CHECK-NEXT: call void @callee()
-; CHECK-NEXT: tail call i8* @objc_retain(i8* %y) [[NUW]]
+; CHECK-NEXT: tail call i8* @llvm.objc.retain(i8* %y) [[NUW]]
; CHECK-NEXT: ret void
; CHECK-NEXT: }
define void @test13() {
%y = call i8* @returner()
call void @callee()
- tail call i8* @objc_retain(i8* %y) nounwind
+ tail call i8* @llvm.objc.retain(i8* %y) nounwind
ret void
}
-declare void @clang.arc.use(...) nounwind
+declare void @llvm.objc.clang.arc.use(...) nounwind
; CHECK: attributes [[NUW]] = { nounwind }
OpenPOWER on IntegriCloud