annotate llvm/test/Transforms/ObjCARC/weak-dce.ll @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
1 ; RUN: opt -S -basic-aa -objc-arc < %s | FileCheck %s
150
anatofuz
parents:
diff changeset
2 ; rdar://11434915
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 ; Delete the weak calls and replace them with just the net retain.
anatofuz
parents:
diff changeset
5
anatofuz
parents:
diff changeset
6 ; CHECK: define void @test0(i8* %p) {
anatofuz
parents:
diff changeset
7 ; CHECK-NEXT: call i8* @llvm.objc.retain(i8* %p)
anatofuz
parents:
diff changeset
8 ; CHECK-NEXT: ret void
anatofuz
parents:
diff changeset
9
anatofuz
parents:
diff changeset
10 define void @test0(i8* %p) {
anatofuz
parents:
diff changeset
11 %weakBlock = alloca i8*, align 8
anatofuz
parents:
diff changeset
12 %tmp7 = call i8* @llvm.objc.initWeak(i8** %weakBlock, i8* %p) nounwind
anatofuz
parents:
diff changeset
13 %tmp26 = call i8* @llvm.objc.loadWeakRetained(i8** %weakBlock) nounwind
anatofuz
parents:
diff changeset
14 call void @llvm.objc.destroyWeak(i8** %weakBlock) nounwind
anatofuz
parents:
diff changeset
15 ret void
anatofuz
parents:
diff changeset
16 }
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 ; CHECK: define i8* @test1(i8* %p) {
anatofuz
parents:
diff changeset
19 ; CHECK-NEXT: call i8* @llvm.objc.retain(i8* %p)
anatofuz
parents:
diff changeset
20 ; CHECK-NEXT: ret i8* %p
anatofuz
parents:
diff changeset
21
anatofuz
parents:
diff changeset
22 define i8* @test1(i8* %p) {
anatofuz
parents:
diff changeset
23 %weakBlock = alloca i8*, align 8
anatofuz
parents:
diff changeset
24 %tmp7 = call i8* @llvm.objc.initWeak(i8** %weakBlock, i8* %p) nounwind
anatofuz
parents:
diff changeset
25 %tmp26 = call i8* @llvm.objc.loadWeakRetained(i8** %weakBlock) nounwind
anatofuz
parents:
diff changeset
26 call void @llvm.objc.destroyWeak(i8** %weakBlock) nounwind
anatofuz
parents:
diff changeset
27 ret i8* %tmp26
anatofuz
parents:
diff changeset
28 }
anatofuz
parents:
diff changeset
29
anatofuz
parents:
diff changeset
30 ; CHECK: define i8* @test2(i8* %p, i8* %q) {
anatofuz
parents:
diff changeset
31 ; CHECK-NEXT: call i8* @llvm.objc.retain(i8* %q)
anatofuz
parents:
diff changeset
32 ; CHECK-NEXT: ret i8* %q
anatofuz
parents:
diff changeset
33
anatofuz
parents:
diff changeset
34 define i8* @test2(i8* %p, i8* %q) {
anatofuz
parents:
diff changeset
35 %weakBlock = alloca i8*, align 8
anatofuz
parents:
diff changeset
36 %tmp7 = call i8* @llvm.objc.initWeak(i8** %weakBlock, i8* %p) nounwind
anatofuz
parents:
diff changeset
37 %tmp19 = call i8* @llvm.objc.storeWeak(i8** %weakBlock, i8* %q) nounwind
anatofuz
parents:
diff changeset
38 %tmp26 = call i8* @llvm.objc.loadWeakRetained(i8** %weakBlock) nounwind
anatofuz
parents:
diff changeset
39 call void @llvm.objc.destroyWeak(i8** %weakBlock) nounwind
anatofuz
parents:
diff changeset
40 ret i8* %tmp26
anatofuz
parents:
diff changeset
41 }
anatofuz
parents:
diff changeset
42
anatofuz
parents:
diff changeset
43 declare i8* @llvm.objc.initWeak(i8**, i8*)
anatofuz
parents:
diff changeset
44 declare void @llvm.objc.destroyWeak(i8**)
anatofuz
parents:
diff changeset
45 declare i8* @llvm.objc.loadWeakRetained(i8**)
anatofuz
parents:
diff changeset
46 declare i8* @llvm.objc.storeWeak(i8** %weakBlock, i8* %q)