[llvm] 417850f - [ObjCARC] Regenerate test checks (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 31 06:55:16 PDT 2022
Author: Nikita Popov
Date: 2022-10-31T14:55:05+01:00
New Revision: 417850fd0735ff1803d78e2d96cc317241f9aef5
URL: https://github.com/llvm/llvm-project/commit/417850fd0735ff1803d78e2d96cc317241f9aef5
DIFF: https://github.com/llvm/llvm-project/commit/417850fd0735ff1803d78e2d96cc317241f9aef5.diff
LOG: [ObjCARC] Regenerate test checks (NFC)
Added:
Modified:
llvm/test/Transforms/ObjCARC/cfg-hazards.ll
llvm/test/Transforms/ObjCARC/contract-storestrong-funclet.ll
llvm/test/Transforms/ObjCARC/opt-catchswitch.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/ObjCARC/cfg-hazards.ll b/llvm/test/Transforms/ObjCARC/cfg-hazards.ll
index 9c132c10ef161..8b6d6048fdc02 100644
--- a/llvm/test/Transforms/ObjCARC/cfg-hazards.ll
+++ b/llvm/test/Transforms/ObjCARC/cfg-hazards.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -passes=objc-arc < %s | FileCheck %s
; rdar://9503416
@@ -10,14 +11,22 @@ declare void @llvm.objc.release(i8*)
declare void @callee()
declare void @block_callee(void ()*)
-; CHECK-LABEL: define void @test0(
-; CHECK: call i8* @llvm.objc.retain
-; CHECK: for.body:
-; CHECK-NOT: @objc
-; CHECK: for.end:
-; CHECK: call void @llvm.objc.release
-; CHECK: }
define void @test0(i8* %digits) {
+; CHECK-LABEL: @test0(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP1:%.*]] = tail call i8* @llvm.objc.retain(i8* [[DIGITS:%.*]]) #[[ATTR0:[0-9]+]]
+; CHECK-NEXT: call void @use_pointer(i8* [[DIGITS]])
+; CHECK-NEXT: br label [[FOR_BODY:%.*]]
+; CHECK: for.body:
+; CHECK-NEXT: [[UPCDIGITINDEX_01:%.*]] = phi i64 [ 2, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ]
+; CHECK-NEXT: call void @use_pointer(i8* [[DIGITS]])
+; CHECK-NEXT: [[INC]] = add i64 [[UPCDIGITINDEX_01]], 1
+; CHECK-NEXT: [[CMP:%.*]] = icmp ult i64 [[INC]], 12
+; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_END:%.*]]
+; CHECK: for.end:
+; CHECK-NEXT: call void @llvm.objc.release(i8* [[DIGITS]]) #[[ATTR0]], !clang.imprecise_release !0
+; CHECK-NEXT: ret void
+;
entry:
%tmp1 = call i8* @llvm.objc.retain(i8* %digits) nounwind
call void @use_pointer(i8* %digits)
@@ -35,14 +44,22 @@ for.end: ; preds = %for.body
ret void
}
-; CHECK-LABEL: define void @test1(
-; CHECK: call i8* @llvm.objc.retain
-; CHECK: for.body:
-; CHECK-NOT: @objc
-; CHECK: for.end:
-; CHECK: void @llvm.objc.release
-; CHECK: }
define void @test1(i8* %digits) {
+; CHECK-LABEL: @test1(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP1:%.*]] = tail call i8* @llvm.objc.retain(i8* [[DIGITS:%.*]]) #[[ATTR0]]
+; CHECK-NEXT: br label [[FOR_BODY:%.*]]
+; CHECK: for.body:
+; CHECK-NEXT: [[UPCDIGITINDEX_01:%.*]] = phi i64 [ 2, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ]
+; CHECK-NEXT: call void @use_pointer(i8* [[DIGITS]])
+; CHECK-NEXT: call void @use_pointer(i8* [[DIGITS]])
+; CHECK-NEXT: [[INC]] = add i64 [[UPCDIGITINDEX_01]], 1
+; CHECK-NEXT: [[CMP:%.*]] = icmp ult i64 [[INC]], 12
+; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_END:%.*]]
+; CHECK: for.end:
+; CHECK-NEXT: call void @llvm.objc.release(i8* [[DIGITS]]) #[[ATTR0]], !clang.imprecise_release !0
+; CHECK-NEXT: ret void
+;
entry:
%tmp1 = call i8* @llvm.objc.retain(i8* %digits) nounwind
br label %for.body
@@ -60,14 +77,22 @@ for.end: ; preds = %for.body
ret void
}
-; CHECK-LABEL: define void @test2(
-; CHECK: call i8* @llvm.objc.retain
-; CHECK: for.body:
-; CHECK-NOT: @objc
-; CHECK: for.end:
-; CHECK: void @llvm.objc.release
-; CHECK: }
define void @test2(i8* %digits) {
+; CHECK-LABEL: @test2(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP1:%.*]] = tail call i8* @llvm.objc.retain(i8* [[DIGITS:%.*]]) #[[ATTR0]]
+; CHECK-NEXT: br label [[FOR_BODY:%.*]]
+; CHECK: for.body:
+; CHECK-NEXT: [[UPCDIGITINDEX_01:%.*]] = phi i64 [ 2, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ]
+; CHECK-NEXT: call void @use_pointer(i8* [[DIGITS]])
+; CHECK-NEXT: [[INC]] = add i64 [[UPCDIGITINDEX_01]], 1
+; CHECK-NEXT: [[CMP:%.*]] = icmp ult i64 [[INC]], 12
+; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_END:%.*]]
+; CHECK: for.end:
+; CHECK-NEXT: call void @use_pointer(i8* [[DIGITS]])
+; CHECK-NEXT: call void @llvm.objc.release(i8* [[DIGITS]]) #[[ATTR0]], !clang.imprecise_release !0
+; CHECK-NEXT: ret void
+;
entry:
%tmp1 = call i8* @llvm.objc.retain(i8* %digits) nounwind
br label %for.body
@@ -86,17 +111,19 @@ for.end: ; preds = %for.body
}
; Delete nested retain+release pairs around loops.
-
-; CHECK: define void @test3(i8* %a) #0 {
-; CHECK-NEXT: entry:
-; CHECK-NEXT: tail call i8* @llvm.objc.retain(i8* %a) [[NUW:#[0-9]+]]
-; CHECK-NEXT: br label %loop
-; CHECK-NOT: @llvm.objc.
-; CHECK: exit:
-; CHECK-NEXT: call void @llvm.objc.release(i8* %a)
-; CHECK-NEXT: ret void
-; CHECK-NEXT: }
define void @test3(i8* %a) nounwind {
+; CHECK-LABEL: @test3(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[OUTER:%.*]] = tail call i8* @llvm.objc.retain(i8* [[A:%.*]]) #[[ATTR0]]
+; CHECK-NEXT: br label [[LOOP:%.*]]
+; CHECK: loop:
+; CHECK-NEXT: call void @callee()
+; CHECK-NEXT: store i8 0, i8* [[A]], align 1
+; CHECK-NEXT: br i1 undef, label [[LOOP]], label [[EXIT:%.*]]
+; CHECK: exit:
+; CHECK-NEXT: call void @llvm.objc.release(i8* [[A]]) #[[ATTR0]], !clang.imprecise_release !0
+; CHECK-NEXT: ret void
+;
entry:
%outer = call i8* @llvm.objc.retain(i8* %a) nounwind
%inner = call i8* @llvm.objc.retain(i8* %a) nounwind
@@ -113,16 +140,22 @@ exit:
ret void
}
-; CHECK: define void @test4(i8* %a) #0 {
-; CHECK-NEXT: entry:
-; CHECK-NEXT: tail call i8* @llvm.objc.retain(i8* %a) [[NUW]]
-; CHECK-NEXT: br label %loop
-; CHECK-NOT: @llvm.objc.
-; CHECK: exit:
-; CHECK-NEXT: call void @llvm.objc.release(i8* %a)
-; CHECK-NEXT: ret void
-; CHECK-NEXT: }
define void @test4(i8* %a) nounwind {
+; CHECK-LABEL: @test4(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[OUTER:%.*]] = tail call i8* @llvm.objc.retain(i8* [[A:%.*]]) #[[ATTR0]]
+; CHECK-NEXT: br label [[LOOP:%.*]]
+; CHECK: loop:
+; CHECK-NEXT: br label [[MORE:%.*]]
+; CHECK: more:
+; CHECK-NEXT: call void @callee()
+; CHECK-NEXT: call void @callee()
+; CHECK-NEXT: store i8 0, i8* [[A]], align 1
+; CHECK-NEXT: br i1 undef, label [[LOOP]], label [[EXIT:%.*]]
+; CHECK: exit:
+; CHECK-NEXT: call void @llvm.objc.release(i8* [[A]]) #[[ATTR0]], !clang.imprecise_release !0
+; CHECK-NEXT: ret void
+;
entry:
%outer = call i8* @llvm.objc.retain(i8* %a) nounwind
%inner = call i8* @llvm.objc.retain(i8* %a) nounwind
@@ -143,18 +176,23 @@ exit:
ret void
}
-; CHECK: define void @test5(i8* %a) #0 {
-; CHECK-NEXT: entry:
-; CHECK-NEXT: tail call i8* @llvm.objc.retain(i8* %a) [[NUW]]
-; CHECK-NEXT: call void @callee()
-; CHECK-NEXT: br label %loop
-; CHECK-NOT: @llvm.objc.
-; CHECK: exit:
-; CHECK-NEXT: call void @use_pointer(i8* %a)
-; CHECK-NEXT: call void @llvm.objc.release(i8* %a)
-; CHECK-NEXT: ret void
-; CHECK-NEXT: }
define void @test5(i8* %a) nounwind {
+; CHECK-LABEL: @test5(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[OUTER:%.*]] = tail call i8* @llvm.objc.retain(i8* [[A:%.*]]) #[[ATTR0]]
+; CHECK-NEXT: call void @callee()
+; CHECK-NEXT: br label [[LOOP:%.*]]
+; CHECK: loop:
+; CHECK-NEXT: br i1 undef, label [[TRUE:%.*]], label [[MORE:%.*]]
+; CHECK: true:
+; CHECK-NEXT: br label [[MORE]]
+; CHECK: more:
+; CHECK-NEXT: br i1 undef, label [[EXIT:%.*]], label [[LOOP]]
+; CHECK: exit:
+; CHECK-NEXT: call void @use_pointer(i8* [[A]])
+; CHECK-NEXT: call void @llvm.objc.release(i8* [[A]]) #[[ATTR0]], !clang.imprecise_release !0
+; CHECK-NEXT: ret void
+;
entry:
%outer = tail call i8* @llvm.objc.retain(i8* %a) nounwind
%inner = tail call i8* @llvm.objc.retain(i8* %a) nounwind
@@ -177,17 +215,23 @@ exit:
ret void
}
-; CHECK: define void @test6(i8* %a) #0 {
-; CHECK-NEXT: entry:
-; CHECK-NEXT: tail call i8* @llvm.objc.retain(i8* %a) [[NUW]]
-; CHECK-NEXT: br label %loop
-; CHECK-NOT: @llvm.objc.
-; CHECK: exit:
-; CHECK-NEXT: call void @use_pointer(i8* %a)
-; CHECK-NEXT: call void @llvm.objc.release(i8* %a)
-; CHECK-NEXT: ret void
-; CHECK-NEXT: }
define void @test6(i8* %a) nounwind {
+; CHECK-LABEL: @test6(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[OUTER:%.*]] = tail call i8* @llvm.objc.retain(i8* [[A:%.*]]) #[[ATTR0]]
+; CHECK-NEXT: br label [[LOOP:%.*]]
+; CHECK: loop:
+; CHECK-NEXT: br i1 undef, label [[TRUE:%.*]], label [[MORE:%.*]]
+; CHECK: true:
+; CHECK-NEXT: call void @callee()
+; CHECK-NEXT: br label [[MORE]]
+; CHECK: more:
+; CHECK-NEXT: br i1 undef, label [[EXIT:%.*]], label [[LOOP]]
+; CHECK: exit:
+; CHECK-NEXT: call void @use_pointer(i8* [[A]])
+; CHECK-NEXT: call void @llvm.objc.release(i8* [[A]]) #[[ATTR0]], !clang.imprecise_release !0
+; CHECK-NEXT: ret void
+;
entry:
%outer = tail call i8* @llvm.objc.retain(i8* %a) nounwind
%inner = tail call i8* @llvm.objc.retain(i8* %a) nounwind
@@ -210,17 +254,23 @@ exit:
ret void
}
-; CHECK: define void @test7(i8* %a) #0 {
-; CHECK-NEXT: entry:
-; CHECK-NEXT: tail call i8* @llvm.objc.retain(i8* %a) [[NUW]]
-; CHECK-NEXT: call void @callee()
-; CHECK-NEXT: br label %loop
-; CHECK-NOT: @llvm.objc.
-; CHECK: exit:
-; CHECK-NEXT: call void @llvm.objc.release(i8* %a)
-; CHECK-NEXT: ret void
-; CHECK-NEXT: }
define void @test7(i8* %a) nounwind {
+; CHECK-LABEL: @test7(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[OUTER:%.*]] = tail call i8* @llvm.objc.retain(i8* [[A:%.*]]) #[[ATTR0]]
+; CHECK-NEXT: call void @callee()
+; CHECK-NEXT: br label [[LOOP:%.*]]
+; CHECK: loop:
+; CHECK-NEXT: br i1 undef, label [[TRUE:%.*]], label [[MORE:%.*]]
+; CHECK: true:
+; CHECK-NEXT: call void @use_pointer(i8* [[A]])
+; CHECK-NEXT: br label [[MORE]]
+; CHECK: more:
+; CHECK-NEXT: br i1 undef, label [[EXIT:%.*]], label [[LOOP]]
+; CHECK: exit:
+; CHECK-NEXT: call void @llvm.objc.release(i8* [[A]]) #[[ATTR0]], !clang.imprecise_release !0
+; CHECK-NEXT: ret void
+;
entry:
%outer = tail call i8* @llvm.objc.retain(i8* %a) nounwind
%inner = tail call i8* @llvm.objc.retain(i8* %a) nounwind
@@ -243,16 +293,23 @@ exit:
ret void
}
-; CHECK: define void @test8(i8* %a) #0 {
-; CHECK-NEXT: entry:
-; CHECK-NEXT: tail call i8* @llvm.objc.retain(i8* %a) [[NUW]]
-; CHECK-NEXT: br label %loop
-; CHECK-NOT: @llvm.objc.
-; CHECK: exit:
-; CHECK-NEXT: call void @llvm.objc.release(i8* %a)
-; CHECK-NEXT: ret void
-; CHECK-NEXT: }
define void @test8(i8* %a) nounwind {
+; CHECK-LABEL: @test8(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[OUTER:%.*]] = tail call i8* @llvm.objc.retain(i8* [[A:%.*]]) #[[ATTR0]]
+; CHECK-NEXT: br label [[LOOP:%.*]]
+; CHECK: loop:
+; CHECK-NEXT: br i1 undef, label [[TRUE:%.*]], label [[MORE:%.*]]
+; CHECK: true:
+; CHECK-NEXT: call void @callee()
+; CHECK-NEXT: call void @use_pointer(i8* [[A]])
+; CHECK-NEXT: br label [[MORE]]
+; CHECK: more:
+; CHECK-NEXT: br i1 undef, label [[EXIT:%.*]], label [[LOOP]]
+; CHECK: exit:
+; CHECK-NEXT: call void @llvm.objc.release(i8* [[A]]) #[[ATTR0]], !clang.imprecise_release !0
+; CHECK-NEXT: ret void
+;
entry:
%outer = tail call i8* @llvm.objc.retain(i8* %a) nounwind
%inner = tail call i8* @llvm.objc.retain(i8* %a) nounwind
@@ -275,14 +332,20 @@ exit:
ret void
}
-; CHECK: define void @test9(i8* %a) #0 {
-; CHECK-NEXT: entry:
-; CHECK-NEXT: br label %loop
-; CHECK-NOT: @llvm.objc.
-; CHECK: exit:
-; CHECK-NEXT: ret void
-; CHECK-NEXT: }
define void @test9(i8* %a) nounwind {
+; CHECK-LABEL: @test9(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: br label [[LOOP:%.*]]
+; CHECK: loop:
+; CHECK-NEXT: br i1 undef, label [[TRUE:%.*]], label [[MORE:%.*]]
+; CHECK: true:
+; CHECK-NEXT: call void @use_pointer(i8* [[A:%.*]])
+; CHECK-NEXT: br label [[MORE]]
+; CHECK: more:
+; CHECK-NEXT: br i1 undef, label [[EXIT:%.*]], label [[LOOP]]
+; CHECK: exit:
+; CHECK-NEXT: ret void
+;
entry:
%outer = tail call i8* @llvm.objc.retain(i8* %a) nounwind
%inner = tail call i8* @llvm.objc.retain(i8* %a) nounwind
@@ -304,14 +367,20 @@ exit:
ret void
}
-; CHECK: define void @test10(i8* %a) #0 {
-; CHECK-NEXT: entry:
-; CHECK-NEXT: br label %loop
-; CHECK-NOT: @llvm.objc.
-; CHECK: exit:
-; CHECK-NEXT: ret void
-; CHECK-NEXT: }
define void @test10(i8* %a) nounwind {
+; CHECK-LABEL: @test10(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: br label [[LOOP:%.*]]
+; CHECK: loop:
+; CHECK-NEXT: br i1 undef, label [[TRUE:%.*]], label [[MORE:%.*]]
+; CHECK: true:
+; CHECK-NEXT: call void @callee()
+; CHECK-NEXT: br label [[MORE]]
+; CHECK: more:
+; CHECK-NEXT: br i1 undef, label [[EXIT:%.*]], label [[LOOP]]
+; CHECK: exit:
+; CHECK-NEXT: ret void
+;
entry:
%outer = tail call i8* @llvm.objc.retain(i8* %a) nounwind
%inner = tail call i8* @llvm.objc.retain(i8* %a) nounwind
@@ -333,14 +402,19 @@ exit:
ret void
}
-; CHECK: define void @test11(i8* %a) #0 {
-; CHECK-NEXT: entry:
-; CHECK-NEXT: br label %loop
-; CHECK-NOT: @llvm.objc.
-; CHECK: exit:
-; CHECK-NEXT: ret void
-; CHECK-NEXT: }
define void @test11(i8* %a) nounwind {
+; CHECK-LABEL: @test11(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: br label [[LOOP:%.*]]
+; CHECK: loop:
+; CHECK-NEXT: br i1 undef, label [[TRUE:%.*]], label [[MORE:%.*]]
+; CHECK: true:
+; CHECK-NEXT: br label [[MORE]]
+; CHECK: more:
+; CHECK-NEXT: br i1 undef, label [[EXIT:%.*]], label [[LOOP]]
+; CHECK: exit:
+; CHECK-NEXT: ret void
+;
entry:
%outer = tail call i8* @llvm.objc.retain(i8* %a) nounwind
%inner = tail call i8* @llvm.objc.retain(i8* %a) nounwind
@@ -363,18 +437,23 @@ exit:
; Don't delete anything if they're not balanced.
-; CHECK: define void @test12(i8* %a) #0 {
-; CHECK-NEXT: entry:
-; CHECK-NEXT: %outer = tail call i8* @llvm.objc.retain(i8* %a) [[NUW]]
-; CHECK-NEXT: %inner = tail call i8* @llvm.objc.retain(i8* %a) [[NUW]]
-; CHECK-NEXT: br label %loop
-; CHECK-NOT: @llvm.objc.
-; CHECK: exit:
-; CHECK-NEXT: call void @llvm.objc.release(i8* %a) [[NUW]]
-; CHECK-NEXT: call void @llvm.objc.release(i8* %a) [[NUW]], !clang.imprecise_release !0
-; CHECK-NEXT: ret void
-; CHECK-NEXT: }
define void @test12(i8* %a) nounwind {
+; CHECK-LABEL: @test12(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[OUTER:%.*]] = tail call i8* @llvm.objc.retain(i8* [[A:%.*]]) #[[ATTR0]]
+; CHECK-NEXT: [[INNER:%.*]] = tail call i8* @llvm.objc.retain(i8* [[A]]) #[[ATTR0]]
+; CHECK-NEXT: br label [[LOOP:%.*]]
+; CHECK: loop:
+; CHECK-NEXT: br i1 undef, label [[TRUE:%.*]], label [[MORE:%.*]]
+; CHECK: true:
+; CHECK-NEXT: ret void
+; CHECK: more:
+; CHECK-NEXT: br i1 undef, label [[EXIT:%.*]], label [[LOOP]]
+; CHECK: exit:
+; CHECK-NEXT: call void @llvm.objc.release(i8* [[A]]) #[[ATTR0]]
+; CHECK-NEXT: call void @llvm.objc.release(i8* [[A]]) #[[ATTR0]], !clang.imprecise_release !0
+; CHECK-NEXT: ret void
+;
entry:
%outer = tail call i8* @llvm.objc.retain(i8* %a) nounwind
%inner = tail call i8* @llvm.objc.retain(i8* %a) nounwind
@@ -400,17 +479,24 @@ exit:
; by an alloca.
; rdar://12969722
-; CHECK: define void @test13(i8* %a) [[NUW]] {
-; CHECK: entry:
-; CHECK: tail call i8* @llvm.objc.retain(i8* %a) [[NUW]]
-; CHECK: loop:
-; CHECK: tail call i8* @llvm.objc.retain(i8* %a) [[NUW]]
-; CHECK: call void @block_callee
-; CHECK: call void @llvm.objc.release(i8* %reloaded_a) [[NUW]]
-; CHECK: exit:
-; CHECK: call void @llvm.objc.release(i8* %a) [[NUW]]
-; CHECK: }
define void @test13(i8* %a) nounwind {
+; CHECK-LABEL: @test13(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[BLOCK:%.*]] = alloca i8*, align 8
+; CHECK-NEXT: [[A1:%.*]] = tail call i8* @llvm.objc.retain(i8* [[A:%.*]]) #[[ATTR0]]
+; CHECK-NEXT: br label [[LOOP:%.*]]
+; CHECK: loop:
+; CHECK-NEXT: [[A2:%.*]] = tail call i8* @llvm.objc.retain(i8* [[A]]) #[[ATTR0]]
+; CHECK-NEXT: store i8* [[A]], i8** [[BLOCK]], align 8
+; CHECK-NEXT: [[CASTED_BLOCK:%.*]] = bitcast i8** [[BLOCK]] to void ()*
+; CHECK-NEXT: call void @block_callee(void ()* [[CASTED_BLOCK]])
+; CHECK-NEXT: [[RELOADED_A:%.*]] = load i8*, i8** [[BLOCK]], align 8
+; CHECK-NEXT: call void @llvm.objc.release(i8* [[RELOADED_A]]) #[[ATTR0]], !clang.imprecise_release !0
+; CHECK-NEXT: br i1 undef, label [[LOOP]], label [[EXIT:%.*]]
+; CHECK: exit:
+; CHECK-NEXT: call void @llvm.objc.release(i8* [[A]]) #[[ATTR0]], !clang.imprecise_release !0
+; CHECK-NEXT: ret void
+;
entry:
%block = alloca i8*
%a1 = tail call i8* @llvm.objc.retain(i8* %a) nounwind
@@ -424,7 +510,7 @@ loop:
%reloaded_a = load i8*, i8** %block, align 8
call void @llvm.objc.release(i8* %reloaded_a) nounwind, !clang.imprecise_release !0
br i1 undef, label %loop, label %exit
-
+
exit:
call void @llvm.objc.release(i8* %a) nounwind, !clang.imprecise_release !0
ret void
@@ -432,12 +518,34 @@ exit:
; The retain call in the entry block shouldn't be moved to the loop body.
-; CHECK: define void @test14(i8* %[[VAL0:.*]],
-; CHECK: %[[V1:.*]] = tail call i8* @llvm.objc.retain(i8* %[[VAL0]])
-; CHECK: %[[CMP:.*]] = icmp eq i8* %[[VAL0]], null
-; CHECK: br i1 %[[CMP]], label %{{.*}}, label %{{.*}}
-
define void @test14(i8* %val0, i8 %val1) {
+; CHECK-LABEL: @test14(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[V1:%.*]] = tail call i8* @llvm.objc.retain(i8* [[VAL0:%.*]]) #[[ATTR0]]
+; CHECK-NEXT: [[CMP:%.*]] = icmp eq i8* [[VAL0]], null
+; CHECK-NEXT: br i1 [[CMP]], label [[IF_END27:%.*]], label [[IF_THEN:%.*]]
+; CHECK: if.then:
+; CHECK-NEXT: [[TOBOOL:%.*]] = icmp eq i8 [[VAL1:%.*]], 1
+; CHECK-NEXT: br label [[FOR_BODY:%.*]]
+; CHECK: for.cond:
+; CHECK-NEXT: [[CMP6:%.*]] = icmp eq i8 [[VAL1]], 2
+; CHECK-NEXT: br i1 [[CMP6]], label [[FOR_BODY]], label [[FOR_END_LOOPEXIT:%.*]]
+; CHECK: for.body:
+; CHECK-NEXT: call void @callee()
+; CHECK-NEXT: [[TOBOOL9:%.*]] = icmp eq i8 [[VAL1]], 0
+; CHECK-NEXT: br i1 [[TOBOOL9]], label [[FOR_COND:%.*]], label [[IF_THEN10:%.*]]
+; CHECK: if.then10:
+; CHECK-NEXT: br label [[FOR_END:%.*]]
+; CHECK: for.end.loopexit:
+; CHECK-NEXT: br label [[FOR_END]]
+; CHECK: for.end:
+; CHECK-NEXT: call void @callee()
+; CHECK-NEXT: call void @use_pointer(i8* [[V1]])
+; CHECK-NEXT: br label [[IF_END27]]
+; CHECK: if.end27:
+; CHECK-NEXT: call void @llvm.objc.release(i8* [[V1]]) #[[ATTR0]], !clang.imprecise_release !0
+; CHECK-NEXT: ret void
+;
entry:
%v1 = tail call i8* @llvm.objc.retain(i8* %val0)
%cmp = icmp eq i8* %val0, null
@@ -472,6 +580,5 @@ if.end27:
ret void
}
-; CHECK: attributes [[NUW]] = { nounwind }
!0 = !{}
diff --git a/llvm/test/Transforms/ObjCARC/contract-storestrong-funclet.ll b/llvm/test/Transforms/ObjCARC/contract-storestrong-funclet.ll
index 40e22a5e787d9..1bbb312e89d09 100644
--- a/llvm/test/Transforms/ObjCARC/contract-storestrong-funclet.ll
+++ b/llvm/test/Transforms/ObjCARC/contract-storestrong-funclet.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -mtriple=i686-unknown-windows-msvc -passes=objc-arc-contract -S -o - %s | FileCheck %s
declare void @f()
@@ -9,6 +10,17 @@ declare dllimport void @llvm.objc.release(i8*)
@x = external global i8*
define void @g(i8* %p) personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
+; CHECK-LABEL: @g(
+; CHECK-NEXT: invoke void @f()
+; CHECK-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[EHCLEANUP:%.*]]
+; CHECK: invoke.cont:
+; CHECK-NEXT: tail call void @llvm.objc.storeStrong(i8** @x, i8* [[P:%.*]]) #[[ATTR0:[0-9]+]]
+; CHECK-NEXT: ret void
+; CHECK: ehcleanup:
+; CHECK-NEXT: [[TMP1:%.*]] = cleanuppad within none []
+; CHECK-NEXT: tail call void @llvm.objc.storeStrong(i8** @x, i8* [[P]]) #[[ATTR0]] [ "funclet"(token [[TMP1]]) ]
+; CHECK-NEXT: cleanupret from [[TMP1]] unwind to caller
+;
invoke void @f() to label %invoke.cont unwind label %ehcleanup
invoke.cont:
@@ -26,12 +38,3 @@ ehcleanup:
tail call void @llvm.objc.release(i8* %tmp1) nounwind [ "funclet"(token %1) ]
cleanupret from %1 unwind to caller
}
-
-; CHECK-LABEL: invoke.cont:
-; CHECK: tail call void @llvm.objc.storeStrong(i8** @x, i8* %p) #0{{$}}
-; CHECK: ret void
-
-; CHECK-LABEL: ehcleanup:
-; CHECK: %1 = cleanuppad within none []
-; CHECK: tail call void @llvm.objc.storeStrong(i8** @x, i8* %p) #0 [ "funclet"(token %1) ]
-; CHECK: cleanupret from %1 unwind to caller
diff --git a/llvm/test/Transforms/ObjCARC/opt-catchswitch.ll b/llvm/test/Transforms/ObjCARC/opt-catchswitch.ll
index 28cf7d11ca31d..015ecbbaf7f14 100644
--- a/llvm/test/Transforms/ObjCARC/opt-catchswitch.ll
+++ b/llvm/test/Transforms/ObjCARC/opt-catchswitch.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -passes=objc-arc < %s | FileCheck %s
target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
@@ -13,6 +14,26 @@ declare dllimport i8* @llvm.objc.retainAutoreleasedReturnValue(i8* returned)
declare dllimport void @llvm.objc.release(i8*)
define i8* @g(i8* %p, i8* %q) local_unnamed_addr personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
+; CHECK-LABEL: @g(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP0:%.*]] = tail call i8* @llvm.objc.retain(i8* [[P:%.*]]) #[[ATTR0:[0-9]+]]
+; CHECK-NEXT: [[V1:%.*]] = call i8* @f(i8* null, i8* null)
+; CHECK-NEXT: [[CALL:%.*]] = invoke i8* @f(i8* [[P]], i8* [[Q:%.*]])
+; CHECK-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[CATCH_DISPATCH:%.*]], !clang.arc.no_objc_arc_exceptions !0
+; CHECK: catch.dispatch:
+; CHECK-NEXT: [[TMP1:%.*]] = catchswitch within none [label %catch] unwind to caller
+; CHECK: catch:
+; CHECK-NEXT: [[TMP2:%.*]] = catchpad within [[TMP1]] [i8* null, i32 64, i8* null]
+; CHECK-NEXT: catchret from [[TMP2]] to label [[CLEANUP:%.*]]
+; CHECK: invoke.cont:
+; CHECK-NEXT: [[TMP3:%.*]] = tail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* [[CALL]]) #[[ATTR0]]
+; CHECK-NEXT: br label [[CLEANUP]]
+; CHECK: cleanup:
+; CHECK-NEXT: [[RETVAL_0:%.*]] = phi i8* [ [[CALL]], [[INVOKE_CONT]] ], [ null, [[CATCH:%.*]] ]
+; CHECK-NEXT: tail call void @llvm.objc.release(i8* [[P]]) #[[ATTR0]], !clang.imprecise_release !0
+; CHECK-NEXT: [[TMP4:%.*]] = tail call i8* @llvm.objc.autoreleaseReturnValue(i8* [[RETVAL_0]]) #[[ATTR0]]
+; CHECK-NEXT: ret i8* [[RETVAL_0]]
+;
entry:
%0 = tail call i8* @llvm.objc.retain(i8* %p) #0
; the following call prevents ARC optimizer from removing the retain/release
@@ -20,7 +41,7 @@ entry:
%v1 = call i8* @f(i8* null, i8* null)
%1 = tail call i8* @llvm.objc.retain(i8* %q) #0
%call = invoke i8* @f(i8* %p, i8* %q)
- to label %invoke.cont unwind label %catch.dispatch, !clang.arc.no_objc_arc_exceptions !0
+ to label %invoke.cont unwind label %catch.dispatch, !clang.arc.no_objc_arc_exceptions !0
catch.dispatch:
%2 = catchswitch within none [label %catch] unwind to caller
@@ -41,18 +62,6 @@ cleanup:
ret i8* %retval.0
}
-; CHECK-LABEL: entry:
-; CHECK-NEXT: %0 = tail call i8* @llvm.objc.retain(i8* %p) #0
-; CHECK-NEXT: call i8* @f(i8* null, i8* null)
-; CHECK-NEXT: %call = invoke i8* @f(i8* %p, i8* %q)
-; CHECK-NEXT: to label %invoke.cont unwind label %catch.dispatch
-
-; CHECK-LABEL: catch.dispatch:
-; CHECK-NEXT: %1 = catchswitch within none [label %catch] unwind to caller
-
-; CHECK-LABEL: cleanup:
-; CHECK: tail call void @llvm.objc.release(i8* %p) #0
-
attributes #0 = { nounwind }
!0 = !{}
More information about the llvm-commits
mailing list