mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-26 21:32:10 +00:00
Catch more CHECK that can be converted to CHECK-LABEL in Transforms for easier debugging. No functionality change.
This conversion was done with the following bash script: find test/Transforms -name "*.ll" | \ while read NAME; do echo "$NAME" if ! grep -q "^; *RUN: *llc" $NAME; then TEMP=`mktemp -t temp` cp $NAME $TEMP sed -n "s/^define [^@]*@\([A-Za-z0-9_]*\)(.*$/\1/p" < $NAME | \ while read FUNC; do sed -i '' "s/;\(.*\)\([A-Za-z0-9_]*\):\( *\)define\([^@]*\)@$FUNC\([( ]*\)\$/;\1\2-LABEL:\3define\4@$FUNC(/g" $TEMP done mv $TEMP $NAME fi done git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186269 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
39f4e8d9cc
commit
15bfd6d3ad
@ -10,28 +10,28 @@ declare i64 @llvm.bswap.i64(i64)
|
||||
|
||||
declare i80 @llvm.bswap.i80(i80)
|
||||
|
||||
; CHECK: define i16 @W
|
||||
; CHECK-LABEL: define i16 @W(
|
||||
define i16 @W() {
|
||||
; CHECK: ret i16 256
|
||||
%Z = call i16 @llvm.bswap.i16( i16 1 ) ; <i16> [#uses=1]
|
||||
ret i16 %Z
|
||||
}
|
||||
|
||||
; CHECK: define i32 @X
|
||||
; CHECK-LABEL: define i32 @X(
|
||||
define i32 @X() {
|
||||
; CHECK: ret i32 16777216
|
||||
%Z = call i32 @llvm.bswap.i32( i32 1 ) ; <i32> [#uses=1]
|
||||
ret i32 %Z
|
||||
}
|
||||
|
||||
; CHECK: define i64 @Y
|
||||
; CHECK-LABEL: define i64 @Y(
|
||||
define i64 @Y() {
|
||||
; CHECK: ret i64 72057594037927936
|
||||
%Z = call i64 @llvm.bswap.i64( i64 1 ) ; <i64> [#uses=1]
|
||||
ret i64 %Z
|
||||
}
|
||||
|
||||
; CHECK: define i80 @Z
|
||||
; CHECK-LABEL: define i80 @Z(
|
||||
define i80 @Z() {
|
||||
; CHECK: ret i80 -450681596205739728166896
|
||||
; 0xA0908070605040302010
|
||||
|
@ -13,7 +13,7 @@ define internal zeroext i32 @test1(i32 %DEADARG1) nounwind {
|
||||
}
|
||||
|
||||
; This checks if the struct doesn't get non-packed
|
||||
; CHECK: define internal <{ i32, i32 }> @test2
|
||||
; CHECK-LABEL: define internal <{ i32, i32 }> @test2(
|
||||
define internal <{ i32, i32 }> @test2(i32 %DEADARG1) {
|
||||
ret <{ i32, i32 }> <{ i32 1, i32 2 }>
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ define void @test1(%t* noalias %pp) {
|
||||
%x = load i32* inttoptr (i32 12345 to i32*)
|
||||
store i32 %x, i32* %p
|
||||
ret void
|
||||
; CHECK: define void @test1
|
||||
; CHECK-LABEL: define void @test1(
|
||||
; CHECK: store
|
||||
; CHECK-NOT: store
|
||||
; CHECK: ret void
|
||||
@ -21,7 +21,7 @@ define void @test3() {
|
||||
store i32 1, i32* @g; <-- This is dead.
|
||||
store i32 42, i32* @g
|
||||
ret void
|
||||
; CHECK: define void @test3
|
||||
; CHECK-LABEL: define void @test3(
|
||||
; CHECK: store
|
||||
; CHECK-NOT: store
|
||||
; CHECK: ret void
|
||||
@ -32,7 +32,7 @@ define void @test4(i32* %p) {
|
||||
%x = load i32* @g; <-- %p and @g could alias
|
||||
store i32 %x, i32* %p
|
||||
ret void
|
||||
; CHECK: define void @test4
|
||||
; CHECK-LABEL: define void @test4(
|
||||
; CHECK: store
|
||||
; CHECK: store
|
||||
; CHECK: ret void
|
||||
|
@ -7,7 +7,7 @@ define void @test1(i32* noalias %p) {
|
||||
call void @test1f()
|
||||
store i32 2, i32 *%p
|
||||
ret void
|
||||
; CHECK: define void @test1
|
||||
; CHECK-LABEL: define void @test1(
|
||||
; CHECK-NOT: store
|
||||
; CHECK-NEXT: call void
|
||||
; CHECK-NEXT: store i32 2
|
||||
|
@ -16,4 +16,4 @@ xxx:
|
||||
br label %lbl_1215
|
||||
}
|
||||
|
||||
; CHECK: define i32 @fn
|
||||
; CHECK-LABEL: define i32 @fn(
|
||||
|
@ -1,7 +1,7 @@
|
||||
; RUN: opt -gvn -S < %s | FileCheck %s
|
||||
|
||||
define i32 @f1(i32 %x) {
|
||||
; CHECK: define i32 @f1(
|
||||
; CHECK-LABEL: define i32 @f1(
|
||||
bb0:
|
||||
%cmp = icmp eq i32 %x, 0
|
||||
br i1 %cmp, label %bb2, label %bb1
|
||||
@ -16,7 +16,7 @@ bb2:
|
||||
}
|
||||
|
||||
define i32 @f2(i32 %x) {
|
||||
; CHECK: define i32 @f2(
|
||||
; CHECK-LABEL: define i32 @f2(
|
||||
bb0:
|
||||
%cmp = icmp ne i32 %x, 0
|
||||
br i1 %cmp, label %bb1, label %bb2
|
||||
@ -31,7 +31,7 @@ bb2:
|
||||
}
|
||||
|
||||
define i32 @f3(i32 %x) {
|
||||
; CHECK: define i32 @f3(
|
||||
; CHECK-LABEL: define i32 @f3(
|
||||
bb0:
|
||||
switch i32 %x, label %bb1 [ i32 0, label %bb2]
|
||||
bb1:
|
||||
@ -46,7 +46,7 @@ bb2:
|
||||
|
||||
declare void @g(i1)
|
||||
define void @f4(i8 * %x) {
|
||||
; CHECK: define void @f4(
|
||||
; CHECK-LABEL: define void @f4(
|
||||
bb0:
|
||||
%y = icmp eq i8* null, %x
|
||||
br i1 %y, label %bb2, label %bb1
|
||||
|
@ -11,7 +11,7 @@ define i8 @test() {
|
||||
call void @use(i8* %a)
|
||||
%b = load i8* %a
|
||||
ret i8 %b
|
||||
; CHECK: define i8 @test
|
||||
; CHECK-LABEL: define i8 @test(
|
||||
; CHECK: call void @use(i8* %a)
|
||||
; CHECK-NEXT: ret i8 1
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
; Check that the mere presence of a blockaddress doesn't prevent -globalopt
|
||||
; from promoting @f to fastcc.
|
||||
|
||||
; CHECK: define{{.*}}fastcc{{.*}}@f
|
||||
; CHECK-LABEL: define{{.*}}fastcc{{.*}}@f(
|
||||
define internal i8* @f() {
|
||||
ret i8* blockaddress(@f, %L1)
|
||||
L1:
|
||||
|
@ -16,7 +16,7 @@ define void @foo1() {
|
||||
@G2 = linkonce_odr constant i32 42
|
||||
|
||||
define void @foo2() {
|
||||
; CHECK: define void @foo2
|
||||
; CHECK-LABEL: define void @foo2(
|
||||
; CHECK-NEXT: store
|
||||
store i32 1, i32* @G2
|
||||
ret void
|
||||
|
@ -17,7 +17,7 @@ define void @bar(i32* byval %x) {
|
||||
}
|
||||
|
||||
define void @foo(i32* %x) {
|
||||
; CHECK: define void @foo
|
||||
; CHECK-LABEL: define void @foo(
|
||||
; CHECK: store i32 %1, i32* %x
|
||||
call void @bar(i32* byval %x)
|
||||
ret void
|
||||
|
@ -128,7 +128,7 @@ end4:
|
||||
define void @outer2(i32 %z, i1 %b) {
|
||||
; Ensure that after inlining, none of the blocks with a call to @f actually
|
||||
; make it through inlining.
|
||||
; CHECK: define void @outer2
|
||||
; CHECK-LABEL: define void @outer2(
|
||||
; CHECK-NOT: call
|
||||
; CHECK: ret void
|
||||
|
||||
@ -164,7 +164,7 @@ define void @PR12470_outer() {
|
||||
; This previously crashed during inliner cleanup and folding inner return
|
||||
; instructions. Check that we don't crash and we produce a function with a single
|
||||
; return instruction due to merging the returns of the inlined function.
|
||||
; CHECK: define void @PR12470_outer
|
||||
; CHECK-LABEL: define void @PR12470_outer(
|
||||
; CHECK-NOT: call
|
||||
; CHECK: ret void
|
||||
; CHECK-NOT: ret void
|
||||
|
@ -6,7 +6,7 @@ define internal i32 @callee1(i32 %A, i32 %B) {
|
||||
}
|
||||
|
||||
define i32 @caller1() {
|
||||
; CHECK: define i32 @caller1
|
||||
; CHECK-LABEL: define i32 @caller1(
|
||||
; CHECK-NEXT: ret i32 3
|
||||
|
||||
%X = call i32 @callee1( i32 10, i32 3 )
|
||||
|
@ -15,7 +15,7 @@ entry:
|
||||
|
||||
define i32 @g() {
|
||||
entry:
|
||||
; CHECK: define i32 @g
|
||||
; CHECK-LABEL: define i32 @g(
|
||||
; CHECK: call i32 @f()
|
||||
; CHECK-NOT: call i32 @a()
|
||||
%call = call i32 @f()
|
||||
@ -32,7 +32,7 @@ entry:
|
||||
|
||||
define i32 @i() {
|
||||
entry:
|
||||
; CHECK: define i32 @i
|
||||
; CHECK-LABEL: define i32 @i(
|
||||
; CHECK: call i32 @b()
|
||||
; CHECK-NOT: call i32 @h()
|
||||
%call = call i32 @h() returns_twice
|
||||
|
@ -6,7 +6,7 @@ target triple = "i386-apple-darwin10.0"
|
||||
; rdar://10853263
|
||||
|
||||
; Make sure that the callee is still here.
|
||||
; CHECK: define i32 @callee
|
||||
; CHECK-LABEL: define i32 @callee(
|
||||
define i32 @callee(i32 %param) {
|
||||
%yyy = alloca [100000 x i8]
|
||||
%r = bitcast [100000 x i8]* %yyy to i8*
|
||||
@ -14,7 +14,7 @@ define i32 @callee(i32 %param) {
|
||||
ret i32 4
|
||||
}
|
||||
|
||||
; CHECK: define i32 @caller
|
||||
; CHECK-LABEL: define i32 @caller(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NOT: alloca
|
||||
; CHECK: ret
|
||||
|
@ -2,7 +2,7 @@
|
||||
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32"
|
||||
target triple = "i386-apple-darwin10.0.0"
|
||||
|
||||
; CHECK: define void @fu1
|
||||
; CHECK-LABEL: define void @fu1(
|
||||
define void @fu1(i32 %parm) nounwind ssp {
|
||||
%1 = alloca i32, align 4
|
||||
; CHECK: alloca double*
|
||||
@ -33,7 +33,7 @@ define void @fu1(i32 %parm) nounwind ssp {
|
||||
|
||||
declare void @bar(double*)
|
||||
|
||||
; CHECK: define void @fu2
|
||||
; CHECK-LABEL: define void @fu2(
|
||||
define void @fu2(i32 %parm) nounwind ssp {
|
||||
%1 = alloca i32, align 4
|
||||
%ptr = alloca double*, align 4
|
||||
|
@ -9,4 +9,4 @@ entry:
|
||||
%or4 = or i32 or (i32 zext (i1 icmp eq (i32* @g, i32* null) to i32), i32 1), %xor
|
||||
ret i32 %or4
|
||||
}
|
||||
; CHECK: define i32 @function
|
||||
; CHECK-LABEL: define i32 @function(
|
||||
|
@ -6,7 +6,7 @@ target triple = "x86_64-apple-macosx10.7.0"
|
||||
; Check transforms involving atomic operations
|
||||
|
||||
define i32* @test1(i8** %p) {
|
||||
; CHECK: define i32* @test1
|
||||
; CHECK-LABEL: define i32* @test1(
|
||||
; CHECK: load atomic i8** %p monotonic, align 8
|
||||
%c = bitcast i8** %p to i32**
|
||||
%r = load atomic i32** %c monotonic, align 8
|
||||
@ -14,7 +14,7 @@ define i32* @test1(i8** %p) {
|
||||
}
|
||||
|
||||
define i32 @test2(i32* %p) {
|
||||
; CHECK: define i32 @test2
|
||||
; CHECK-LABEL: define i32 @test2(
|
||||
; CHECK: %x = load atomic i32* %p seq_cst, align 4
|
||||
; CHECK: shl i32 %x, 1
|
||||
%x = load atomic i32* %p seq_cst, align 4
|
||||
|
@ -3,7 +3,7 @@
|
||||
declare void @bar({i32, i32} %a)
|
||||
declare i32 @baz(i32 %a)
|
||||
|
||||
; CHECK: define i32 @foo
|
||||
; CHECK-LABEL: define i32 @foo(
|
||||
; CHECK-NOT: extractvalue
|
||||
define i32 @foo(i32 %a, i32 %b) {
|
||||
; Instcombine should fold various combinations of insertvalue and extractvalue
|
||||
@ -39,7 +39,7 @@ define i32 @foo(i32 %a, i32 %b) {
|
||||
ret i32 %v5
|
||||
}
|
||||
|
||||
; CHECK: define i32 @extract2gep
|
||||
; CHECK-LABEL: define i32 @extract2gep(
|
||||
; CHECK-NEXT: [[GEP:%[a-z0-9]+]] = getelementptr inbounds {{.*}}* %pair, i32 0, i32 1
|
||||
; CHECK-NEXT: [[LOAD:%[A-Za-z0-9]+]] = load i32* [[GEP]]
|
||||
; CHECK-NEXT: store
|
||||
@ -67,7 +67,7 @@ end:
|
||||
ret i32 %E
|
||||
}
|
||||
|
||||
; CHECK: define i32 @doubleextract2gep
|
||||
; CHECK-LABEL: define i32 @doubleextract2gep(
|
||||
; CHECK-NEXT: [[GEP:%[a-z0-9]+]] = getelementptr inbounds {{.*}}* %arg, i32 0, i32 1, i32 1
|
||||
; CHECK-NEXT: [[LOAD:%[A-Za-z0-9]+]] = load i32* [[GEP]]
|
||||
; CHECK-NEXT: ret i32 [[LOAD]]
|
||||
|
@ -990,7 +990,7 @@ define i1 @icmp_add_and_shr_ne_0(i32 %X) {
|
||||
}
|
||||
|
||||
; PR16244
|
||||
; CHECK: define i1 @test71
|
||||
; CHECK-LABEL: define i1 @test71(
|
||||
; CHECK-NEXT: ret i1 false
|
||||
define i1 @test71(i8* %x) {
|
||||
%a = getelementptr i8* %x, i64 8
|
||||
|
@ -6,7 +6,7 @@ declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32,
|
||||
define void @test1(i8* %a) {
|
||||
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %a, i8* %a, i32 100, i32 1, i1 false)
|
||||
ret void
|
||||
; CHECK: define void @test1
|
||||
; CHECK-LABEL: define void @test1(
|
||||
; CHECK-NEXT: ret void
|
||||
}
|
||||
|
||||
@ -15,13 +15,13 @@ define void @test1(i8* %a) {
|
||||
define void @test2(i8* %a) {
|
||||
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %a, i8* %a, i32 100, i32 1, i1 true)
|
||||
ret void
|
||||
; CHECK: define void @test2
|
||||
; CHECK-LABEL: define void @test2(
|
||||
; CHECK-NEXT: call void @llvm.memcpy
|
||||
}
|
||||
|
||||
define void @test3(i8* %d, i8* %s) {
|
||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %d, i8* %s, i64 17179869184, i32 4, i1 false)
|
||||
ret void
|
||||
; CHECK: define void @test3
|
||||
; CHECK-LABEL: define void @test3(
|
||||
; CHECK-NEXT: call void @llvm.memcpy
|
||||
}
|
||||
|
@ -14,14 +14,14 @@ target triple = "i386-apple-macosx10.7.2"
|
||||
@.str2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
|
||||
|
||||
define void @test1(%struct.__sFILE* %stream) nounwind {
|
||||
; CHECK: define void @test1
|
||||
; CHECK-LABEL: define void @test1(
|
||||
; CHECK: call i32 @"fwrite$UNIX2003"
|
||||
%call = tail call i32 (%struct.__sFILE*, i8*, ...)* @fprintf(%struct.__sFILE* %stream, i8* getelementptr inbounds ([13 x i8]* @.str, i32 0, i32 0)) nounwind
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @test2(%struct.__sFILE* %stream, i8* %str) nounwind ssp {
|
||||
; CHECK: define void @test2
|
||||
; CHECK-LABEL: define void @test2(
|
||||
; CHECK: call i32 @"fputs$UNIX2003"
|
||||
%call = tail call i32 (%struct.__sFILE*, i8*, ...)* @fprintf(%struct.__sFILE* %stream, i8* getelementptr inbounds ([3 x i8]* @.str2, i32 0, i32 0), i8* %str) nounwind
|
||||
ret void
|
||||
|
@ -155,7 +155,7 @@ declare <4 x i32> @llvm.x86.sse41.pmovzxwd(<8 x i16>) nounwind readnone
|
||||
|
||||
define <4 x float> @dead_shuffle_elt(<4 x float> %x, <2 x float> %y) nounwind {
|
||||
entry:
|
||||
; CHECK: define <4 x float> @dead_shuffle_elt
|
||||
; CHECK-LABEL: define <4 x float> @dead_shuffle_elt(
|
||||
; CHECK: shufflevector <2 x float> %y, <2 x float> undef, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
|
||||
%shuffle.i = shufflevector <2 x float> %y, <2 x float> %y, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
|
||||
%shuffle9.i = shufflevector <4 x float> %x, <4 x float> %shuffle.i, <4 x i32> <i32 4, i32 5, i32 2, i32 3>
|
||||
|
@ -8,7 +8,7 @@
|
||||
@.str = private constant [2 x i8] c"y\00"
|
||||
|
||||
define i32 @foo() nounwind {
|
||||
; CHECK: define i32 @foo
|
||||
; CHECK-LABEL: define i32 @foo(
|
||||
; CHECK: call i32 @strcmp
|
||||
; CHECK: ret i32 %temp1
|
||||
|
||||
@ -20,7 +20,7 @@ entry:
|
||||
}
|
||||
|
||||
define i32 @bar() nounwind {
|
||||
; CHECK: define i32 @bar
|
||||
; CHECK-LABEL: define i32 @bar(
|
||||
; CHECK: ret i32 0
|
||||
|
||||
entry:
|
||||
|
@ -27,29 +27,29 @@
|
||||
; MERGE: @j = global
|
||||
@j = global i32 0
|
||||
|
||||
; NOARGS: define internal void @main
|
||||
; LIST: define internal void @main
|
||||
; EMPTYFILE: define internal void @main
|
||||
; LIST2: define internal void @main
|
||||
; MERGE: define internal void @main
|
||||
; NOARGS-LABEL: define internal void @main(
|
||||
; LIST-LABEL: define internal void @main(
|
||||
; EMPTYFILE-LABEL: define internal void @main(
|
||||
; LIST2-LABEL: define internal void @main(
|
||||
; MERGE-LABEL: define internal void @main(
|
||||
define void @main() {
|
||||
ret void
|
||||
}
|
||||
|
||||
; NOARGS: define internal void @foo
|
||||
; LIST: define void @foo
|
||||
; EMPTYFILE: define internal void @foo
|
||||
; LIST2: define void @foo
|
||||
; MERGE: define void @foo
|
||||
; NOARGS-LABEL: define internal void @foo(
|
||||
; LIST-LABEL: define void @foo(
|
||||
; EMPTYFILE-LABEL: define internal void @foo(
|
||||
; LIST2-LABEL: define void @foo(
|
||||
; MERGE-LABEL: define void @foo(
|
||||
define void @foo() {
|
||||
ret void
|
||||
}
|
||||
|
||||
; NOARGS: define internal void @bar
|
||||
; LIST: define internal void @bar
|
||||
; EMPTYFILE: define internal void @bar
|
||||
; LIST2: define void @bar
|
||||
; MERGE: define void @bar
|
||||
; NOARGS-LABEL: define internal void @bar(
|
||||
; LIST-LABEL: define internal void @bar(
|
||||
; EMPTYFILE-LABEL: define internal void @bar(
|
||||
; LIST2-LABEL: define void @bar(
|
||||
; MERGE-LABEL: define void @bar(
|
||||
define void @bar() {
|
||||
ret void
|
||||
}
|
||||
|
@ -1,16 +1,16 @@
|
||||
; RUN: opt < %s -internalize -internalize-public-api-list foo -S | FileCheck %s
|
||||
|
||||
; CHECK: define void @foo
|
||||
; CHECK-LABEL: define void @foo(
|
||||
define void @foo() {
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define internal void @zed
|
||||
; CHECK-LABEL: define internal void @zed(
|
||||
define void @zed() {
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define available_externally void @bar
|
||||
; CHECK-LABEL: define available_externally void @bar(
|
||||
define available_externally void @bar() {
|
||||
ret void
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ loop:
|
||||
|
||||
end:
|
||||
ret i32 %val
|
||||
; CHECK: define i32 @test1(
|
||||
; CHECK-LABEL: define i32 @test1(
|
||||
; CHECK: load atomic
|
||||
; CHECK-NEXT: br label %loop
|
||||
}
|
||||
@ -33,7 +33,7 @@ loop:
|
||||
|
||||
end:
|
||||
ret i32 %val
|
||||
; CHECK: define i32 @test2(
|
||||
; CHECK-LABEL: define i32 @test2(
|
||||
; CHECK: load atomic
|
||||
; CHECK-NEXT: %exitcond = icmp ne
|
||||
; CHECK-NEXT: br i1 %exitcond, label %end, label %loop
|
||||
@ -54,7 +54,7 @@ loop:
|
||||
|
||||
end:
|
||||
ret i32 %vala
|
||||
; CHECK: define i32 @test3(
|
||||
; CHECK-LABEL: define i32 @test3(
|
||||
; CHECK: load atomic i32* %x unordered
|
||||
; CHECK-NEXT: br label %loop
|
||||
}
|
||||
@ -73,7 +73,7 @@ loop:
|
||||
|
||||
end:
|
||||
ret i32 %vala
|
||||
; CHECK: define i32 @test4(
|
||||
; CHECK-LABEL: define i32 @test4(
|
||||
; CHECK: load atomic i32* %y monotonic
|
||||
; CHECK-NEXT: store atomic
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ Out: ; preds = %Loop
|
||||
|
||||
; This loop invariant instruction should be constant folded, not hoisted.
|
||||
define i32 @test3(i1 %c) {
|
||||
; CHECK: define i32 @test3
|
||||
; CHECK-LABEL: define i32 @test3(
|
||||
; CHECK: call void @foo2(i32 6)
|
||||
%A = load i32* @X ; <i32> [#uses=2]
|
||||
br label %Loop
|
||||
|
@ -4,7 +4,7 @@ declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone
|
||||
declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone
|
||||
|
||||
define i32 @tak(i32 %x, i32 %y, i32 %z) nounwind ssp {
|
||||
; CHECK: define i32 @tak
|
||||
; CHECK-LABEL: define i32 @tak(
|
||||
; CHECK: entry
|
||||
; CHECK-NEXT: call void @llvm.dbg.value(metadata !{i32 %x}
|
||||
|
||||
@ -43,7 +43,7 @@ return: ; preds = %if.end
|
||||
define void @FindFreeHorzSeg(i64 %startCol, i64 %row, i64* %rowStart) {
|
||||
; Ensure that the loop increment basic block is rotated into the tail of the
|
||||
; body, even though it contains a debug intrinsic call.
|
||||
; CHECK: define void @FindFreeHorzSeg
|
||||
; CHECK-LABEL: define void @FindFreeHorzSeg(
|
||||
; CHECK: %dec = add
|
||||
; CHECK-NEXT: tail call void @llvm.dbg.value
|
||||
; CHECK-NEXT: br i1 %tobool, label %for.cond, label %for.end
|
||||
|
@ -29,7 +29,7 @@ for.end: ; preds = %for.cond
|
||||
}
|
||||
|
||||
; Should only end up with one phi.
|
||||
; CHECK: define void @test
|
||||
; CHECK-LABEL: define void @test(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: br label %for.body
|
||||
; CHECK: for.body:
|
||||
|
@ -6,7 +6,7 @@
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
|
||||
define void @Z4() nounwind {
|
||||
; CHECK: define void @Z4
|
||||
; CHECK-LABEL: define void @Z4(
|
||||
bb:
|
||||
br label %bb3
|
||||
|
||||
|
@ -22,7 +22,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
|
||||
; Foo.A[i] = Foo.B[i] + a;
|
||||
; return Foo.A[a];
|
||||
; }
|
||||
; CHECK: define i32 @noAlias01
|
||||
; CHECK-LABEL: define i32 @noAlias01(
|
||||
; CHECK: add nsw <4 x i32>
|
||||
; CHECK: ret
|
||||
|
||||
@ -70,7 +70,7 @@ for.end: ; preds = %for.cond
|
||||
; Foo.A[i] = Foo.B[i+10] + a;
|
||||
; return Foo.A[a];
|
||||
; }
|
||||
; CHECK: define i32 @noAlias02
|
||||
; CHECK-LABEL: define i32 @noAlias02(
|
||||
; CHECK: add nsw <4 x i32>
|
||||
; CHECK: ret
|
||||
|
||||
@ -119,7 +119,7 @@ for.end: ; preds = %for.cond
|
||||
; Foo.A[i+10] = Foo.B[i] + a;
|
||||
; return Foo.A[a];
|
||||
; }
|
||||
; CHECK: define i32 @noAlias03
|
||||
; CHECK-LABEL: define i32 @noAlias03(
|
||||
; CHECK: add nsw <4 x i32>
|
||||
; CHECK: ret
|
||||
|
||||
@ -168,7 +168,7 @@ for.end: ; preds = %for.cond
|
||||
; *(PA+i) = *(PB+i) + a;
|
||||
; return *(PA+a);
|
||||
; }
|
||||
; CHECK: define i32 @noAlias04
|
||||
; CHECK-LABEL: define i32 @noAlias04(
|
||||
; CHECK-NOT: add nsw <4 x i32>
|
||||
; CHECK: ret
|
||||
;
|
||||
@ -222,7 +222,7 @@ for.end: ; preds = %for.cond
|
||||
; Bar.A[N][i] = Bar.B[N][i] + a;
|
||||
; return Bar.A[N][a];
|
||||
; }
|
||||
; CHECK: define i32 @noAlias05
|
||||
; CHECK-LABEL: define i32 @noAlias05(
|
||||
; CHECK: add nsw <4 x i32>
|
||||
; CHECK: ret
|
||||
|
||||
@ -278,7 +278,7 @@ for.end: ; preds = %for.cond
|
||||
; Bar.A[N][i] = Bar.A[N+1][i] + a;
|
||||
; return Bar.A[N][a];
|
||||
; }
|
||||
; CHECK: define i32 @noAlias06
|
||||
; CHECK-LABEL: define i32 @noAlias06(
|
||||
; CHECK: add nsw <4 x i32>
|
||||
; CHECK: ret
|
||||
|
||||
@ -335,7 +335,7 @@ for.end: ; preds = %for.cond
|
||||
; Foo.A[SIZE-i-1] = Foo.B[SIZE-i-1] + a;
|
||||
; return Foo.A[a];
|
||||
; }
|
||||
; CHECK: define i32 @noAlias07
|
||||
; CHECK-LABEL: define i32 @noAlias07(
|
||||
; CHECK: sub nsw <4 x i32>
|
||||
; CHECK: ret
|
||||
|
||||
@ -387,7 +387,7 @@ for.end: ; preds = %for.cond
|
||||
; Foo.A[SIZE-i-1] = Foo.B[SIZE-i-10] + a;
|
||||
; return Foo.A[a];
|
||||
; }
|
||||
; CHECK: define i32 @noAlias08
|
||||
; CHECK-LABEL: define i32 @noAlias08(
|
||||
; CHECK: sub nsw <4 x i32>
|
||||
; CHECK: ret
|
||||
|
||||
@ -439,7 +439,7 @@ for.end: ; preds = %for.cond
|
||||
; Foo.A[SIZE-i-10] = Foo.B[SIZE-i-1] + a;
|
||||
; return Foo.A[a];
|
||||
; }
|
||||
; CHECK: define i32 @noAlias09
|
||||
; CHECK-LABEL: define i32 @noAlias09(
|
||||
; CHECK: sub nsw <4 x i32>
|
||||
; CHECK: ret
|
||||
|
||||
@ -491,7 +491,7 @@ for.end: ; preds = %for.cond
|
||||
; *(PA+SIZE-i-1) = *(PB+SIZE-i-1) + a;
|
||||
; return *(PA+a);
|
||||
; }
|
||||
; CHECK: define i32 @noAlias10
|
||||
; CHECK-LABEL: define i32 @noAlias10(
|
||||
; CHECK-NOT: sub nsw <4 x i32>
|
||||
; CHECK: ret
|
||||
;
|
||||
@ -551,7 +551,7 @@ for.end: ; preds = %for.cond
|
||||
; Bar.A[N][SIZE-i-1] = Bar.B[N][SIZE-i-1] + a;
|
||||
; return Bar.A[N][a];
|
||||
; }
|
||||
; CHECK: define i32 @noAlias11
|
||||
; CHECK-LABEL: define i32 @noAlias11(
|
||||
; CHECK: sub nsw <4 x i32>
|
||||
; CHECK: ret
|
||||
|
||||
@ -611,7 +611,7 @@ for.end: ; preds = %for.cond
|
||||
; Bar.A[N][SIZE-i-1] = Bar.A[N+1][SIZE-i-1] + a;
|
||||
; return Bar.A[N][a];
|
||||
; }
|
||||
; CHECK: define i32 @noAlias12
|
||||
; CHECK-LABEL: define i32 @noAlias12(
|
||||
; CHECK: sub nsw <4 x i32>
|
||||
; CHECK: ret
|
||||
|
||||
@ -672,7 +672,7 @@ for.end: ; preds = %for.cond
|
||||
; Foo.A[i] = Foo.A[i+4] + a;
|
||||
; return Foo.A[a];
|
||||
; }
|
||||
; CHECK: define i32 @noAlias13
|
||||
; CHECK-LABEL: define i32 @noAlias13(
|
||||
; CHECK: add nsw <4 x i32>
|
||||
; CHECK: ret
|
||||
|
||||
@ -721,7 +721,7 @@ for.end: ; preds = %for.cond
|
||||
; Foo.A[SIZE-i-1] = Foo.A[SIZE-i-5] + a;
|
||||
; return Foo.A[a];
|
||||
; }
|
||||
; CHECK: define i32 @noAlias14
|
||||
; CHECK-LABEL: define i32 @noAlias14(
|
||||
; CHECK: sub nsw <4 x i32>
|
||||
; CHECK: ret
|
||||
|
||||
@ -777,7 +777,7 @@ for.end: ; preds = %for.cond
|
||||
; Foo.A[i] = Foo.B[SIZE-i-1] + a;
|
||||
; return Foo.A[a];
|
||||
; }
|
||||
; CHECK: define i32 @mayAlias01
|
||||
; CHECK-LABEL: define i32 @mayAlias01(
|
||||
; CHECK-NOT: add nsw <4 x i32>
|
||||
; CHECK: ret
|
||||
|
||||
@ -827,7 +827,7 @@ for.end: ; preds = %for.cond
|
||||
; Foo.A[SIZE-i-1] = Foo.B[i] + a;
|
||||
; return Foo.A[a];
|
||||
; }
|
||||
; CHECK: define i32 @mayAlias02
|
||||
; CHECK-LABEL: define i32 @mayAlias02(
|
||||
; CHECK-NOT: add nsw <4 x i32>
|
||||
; CHECK: ret
|
||||
|
||||
@ -877,7 +877,7 @@ for.end: ; preds = %for.cond
|
||||
; *(PA+i) = *(PB+SIZE-i-1) + a;
|
||||
; return *(PA+a);
|
||||
; }
|
||||
; CHECK: define i32 @mayAlias03
|
||||
; CHECK-LABEL: define i32 @mayAlias03(
|
||||
; CHECK-NOT: add nsw <4 x i32>
|
||||
; CHECK: ret
|
||||
|
||||
@ -934,7 +934,7 @@ for.end: ; preds = %for.cond
|
||||
; Foo.A[i+10] = Foo.B[SIZE-i-1] + a;
|
||||
; return Foo.A[a];
|
||||
; }
|
||||
; CHECK: define i32 @mustAlias01
|
||||
; CHECK-LABEL: define i32 @mustAlias01(
|
||||
; CHECK-NOT: add nsw <4 x i32>
|
||||
; CHECK: ret
|
||||
|
||||
@ -984,7 +984,7 @@ for.end: ; preds = %for.cond
|
||||
; Foo.A[i] = Foo.B[SIZE-i-10] + a;
|
||||
; return Foo.A[a];
|
||||
; }
|
||||
; CHECK: define i32 @mustAlias02
|
||||
; CHECK-LABEL: define i32 @mustAlias02(
|
||||
; CHECK-NOT: add nsw <4 x i32>
|
||||
; CHECK: ret
|
||||
|
||||
@ -1033,7 +1033,7 @@ for.end: ; preds = %for.cond
|
||||
; Foo.A[i+10] = Foo.B[SIZE-i-10] + a;
|
||||
; return Foo.A[a];
|
||||
; }
|
||||
; CHECK: define i32 @mustAlias03
|
||||
; CHECK-LABEL: define i32 @mustAlias03(
|
||||
; CHECK-NOT: add nsw <4 x i32>
|
||||
; CHECK: ret
|
||||
|
||||
|
@ -27,7 +27,7 @@ declare i8* @returner()
|
||||
; Simple retain+release pair deletion, with some intervening control
|
||||
; flow and harmless instructions.
|
||||
|
||||
; CHECK: define void @test0(
|
||||
; CHECK-LABEL: define void @test0(
|
||||
; CHECK: entry:
|
||||
; CHECK: call void @llvm.arc.annotation.bottomup.bbstart(i8** @x, i8** @S_None)
|
||||
; CHECK: %0 = tail call i8* @objc_retain(i8* %a) #0, !llvm.arc.annotation.bottomup ![[ANN0:[0-9]+]], !llvm.arc.annotation.topdown ![[ANN1:[0-9]+]]
|
||||
|
@ -177,7 +177,7 @@ if.end5: ; preds = %if.then3, %if.end
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test1b_imprecise(
|
||||
; CHECK-LABEL: define void @test1b_imprecise(
|
||||
; CHECK: entry:
|
||||
; CHECK: tail call i8* @objc_retain(i8* %x) [[NUW:#[0-9]+]]
|
||||
; CHECK-NOT: @objc_
|
||||
@ -210,7 +210,7 @@ if.end5: ; preds = %if.then3, %if.end
|
||||
; Like test0 but the pointer is passed to an intervening call,
|
||||
; so the optimization is not safe.
|
||||
|
||||
; CHECK: define void @test2_precise(
|
||||
; CHECK-LABEL: define void @test2_precise(
|
||||
; CHECK: @objc_retain(i8* %a)
|
||||
; CHECK: @objc_release
|
||||
; CHECK: }
|
||||
@ -239,7 +239,7 @@ return:
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test2_imprecise(
|
||||
; CHECK-LABEL: define void @test2_imprecise(
|
||||
; CHECK: @objc_retain(i8* %a)
|
||||
; CHECK: @objc_release
|
||||
; CHECK: }
|
||||
@ -273,7 +273,7 @@ return:
|
||||
|
||||
; TODO: For now, assume this can't happen.
|
||||
|
||||
; CHECK: define void @test3_precise(
|
||||
; CHECK-LABEL: define void @test3_precise(
|
||||
; TODO: @objc_retain(i8* %a)
|
||||
; TODO: @objc_release
|
||||
; CHECK: }
|
||||
@ -293,7 +293,7 @@ return:
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test3_imprecise(
|
||||
; CHECK-LABEL: define void @test3_imprecise(
|
||||
; TODO: @objc_retain(i8* %a)
|
||||
; TODO: @objc_release
|
||||
; CHECK: }
|
||||
@ -319,7 +319,7 @@ return:
|
||||
; Like test0 but the retain is in a loop,
|
||||
; so the optimization is not safe.
|
||||
|
||||
; CHECK: define void @test4_precise(
|
||||
; CHECK-LABEL: define void @test4_precise(
|
||||
; TODO: @objc_retain(i8* %a)
|
||||
; TODO: @objc_release
|
||||
; CHECK: }
|
||||
@ -339,7 +339,7 @@ return:
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test4_imprecise(
|
||||
; CHECK-LABEL: define void @test4_imprecise(
|
||||
; TODO: @objc_retain(i8* %a)
|
||||
; TODO: @objc_release
|
||||
; CHECK: }
|
||||
@ -363,7 +363,7 @@ return:
|
||||
; Like test0 but the pointer is conditionally passed to an intervening call,
|
||||
; so the optimization is not safe.
|
||||
|
||||
; CHECK: define void @test5a(
|
||||
; CHECK-LABEL: define void @test5a(
|
||||
; CHECK: @objc_retain(i8*
|
||||
; CHECK: @objc_release
|
||||
; CHECK: }
|
||||
@ -379,7 +379,7 @@ entry:
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test5b(
|
||||
; CHECK-LABEL: define void @test5b(
|
||||
; CHECK: @objc_retain(i8*
|
||||
; CHECK: @objc_release
|
||||
; CHECK: }
|
||||
@ -399,7 +399,7 @@ entry:
|
||||
; retain+release pair deletion, where the release happens on two different
|
||||
; flow paths.
|
||||
|
||||
; CHECK: define void @test6a(
|
||||
; CHECK-LABEL: define void @test6a(
|
||||
; CHECK: entry:
|
||||
; CHECK: tail call i8* @objc_retain(
|
||||
; CHECK: t:
|
||||
@ -433,7 +433,7 @@ return:
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test6b(
|
||||
; CHECK-LABEL: define void @test6b(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: }
|
||||
define void @test6b(i32* %x, i1 %p) nounwind {
|
||||
@ -461,7 +461,7 @@ return:
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test6c(
|
||||
; CHECK-LABEL: define void @test6c(
|
||||
; CHECK: entry:
|
||||
; CHECK: tail call i8* @objc_retain(
|
||||
; CHECK: t:
|
||||
@ -495,7 +495,7 @@ return:
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test6d(
|
||||
; CHECK-LABEL: define void @test6d(
|
||||
; CHECK: entry:
|
||||
; CHECK: tail call i8* @objc_retain(
|
||||
; CHECK: t:
|
||||
@ -533,7 +533,7 @@ return:
|
||||
; retain+release pair deletion, where the retain happens on two different
|
||||
; flow paths.
|
||||
|
||||
; CHECK: define void @test7(
|
||||
; CHECK-LABEL: define void @test7(
|
||||
; CHECK: entry:
|
||||
; CHECK-NOT: objc_
|
||||
; CHECK: t:
|
||||
@ -567,7 +567,7 @@ return:
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test7b(
|
||||
; CHECK-LABEL: define void @test7b(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: }
|
||||
define void @test7b(i32* %x, i1 %p) nounwind {
|
||||
@ -596,7 +596,7 @@ return:
|
||||
|
||||
; Like test7, but there's a retain/retainBlock mismatch. Don't delete!
|
||||
|
||||
; CHECK: define void @test7c
|
||||
; CHECK-LABEL: define void @test7c(
|
||||
; CHECK: t:
|
||||
; CHECK: call i8* @objc_retainBlock
|
||||
; CHECK: f:
|
||||
@ -631,7 +631,7 @@ return:
|
||||
; retain+release pair deletion, where the retain and release both happen on
|
||||
; different flow paths. Wild!
|
||||
|
||||
; CHECK: define void @test8a(
|
||||
; CHECK-LABEL: define void @test8a(
|
||||
; CHECK: entry:
|
||||
; CHECK: t:
|
||||
; CHECK: @objc_retain
|
||||
@ -679,7 +679,7 @@ return:
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test8b(
|
||||
; CHECK-LABEL: define void @test8b(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: }
|
||||
define void @test8b(i32* %x, i1 %p, i1 %q) nounwind {
|
||||
@ -717,7 +717,7 @@ return:
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test8c(
|
||||
; CHECK-LABEL: define void @test8c(
|
||||
; CHECK: entry:
|
||||
; CHECK: t:
|
||||
; CHECK: @objc_retain
|
||||
@ -765,7 +765,7 @@ return:
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test8d(
|
||||
; CHECK-LABEL: define void @test8d(
|
||||
; CHECK: entry:
|
||||
; CHECK: t:
|
||||
; CHECK: @objc_retain
|
||||
@ -815,7 +815,7 @@ return:
|
||||
|
||||
; Trivial retain+release pair deletion.
|
||||
|
||||
; CHECK: define void @test9(
|
||||
; CHECK-LABEL: define void @test9(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: }
|
||||
define void @test9(i8* %x) nounwind {
|
||||
@ -827,7 +827,7 @@ entry:
|
||||
|
||||
; Retain+release pair, but on an unknown pointer relationship. Don't delete!
|
||||
|
||||
; CHECK: define void @test9b
|
||||
; CHECK-LABEL: define void @test9b(
|
||||
; CHECK: @objc_retain(i8* %x)
|
||||
; CHECK: @objc_release(i8* %s)
|
||||
; CHECK: }
|
||||
@ -841,7 +841,7 @@ entry:
|
||||
|
||||
; Trivial retain+release pair with intervening calls - don't delete!
|
||||
|
||||
; CHECK: define void @test10(
|
||||
; CHECK-LABEL: define void @test10(
|
||||
; CHECK: @objc_retain(i8* %x)
|
||||
; CHECK: @callee
|
||||
; CHECK: @use_pointer
|
||||
@ -860,7 +860,7 @@ entry:
|
||||
; Also, add a tail keyword, since objc_retain can never be passed
|
||||
; a stack argument.
|
||||
|
||||
; CHECK: define void @test11(
|
||||
; CHECK-LABEL: define void @test11(
|
||||
; CHECK: tail call i8* @objc_retain(i8* %x) [[NUW]]
|
||||
; CHECK: call i8* @objc_autorelease(i8* %0) [[NUW]]
|
||||
; CHECK: }
|
||||
@ -874,7 +874,7 @@ entry:
|
||||
|
||||
; Same as test11 but with no use_pointer call. Delete the pair!
|
||||
|
||||
; CHECK: define void @test11a(
|
||||
; CHECK-LABEL: define void @test11a(
|
||||
; CHECK: entry:
|
||||
; CHECK-NEXT: ret void
|
||||
; CHECK: }
|
||||
@ -889,7 +889,7 @@ entry:
|
||||
; since if the frontend emitted code for an __autoreleasing variable, we may
|
||||
; want it to be in the autorelease pool.
|
||||
|
||||
; CHECK: define i8* @test11b(
|
||||
; CHECK-LABEL: define i8* @test11b(
|
||||
; CHECK: tail call i8* @objc_retain(i8* %x) [[NUW]]
|
||||
; CHECK: call i8* @objc_autorelease(i8* %0) [[NUW]]
|
||||
; CHECK: }
|
||||
@ -903,7 +903,7 @@ entry:
|
||||
; Trivial retain,release pair with intervening call, but it's dominated
|
||||
; by another retain - delete!
|
||||
|
||||
; CHECK: define void @test12(
|
||||
; CHECK-LABEL: define void @test12(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: @objc_retain(i8* %x)
|
||||
; CHECK-NOT: @objc_
|
||||
@ -920,7 +920,7 @@ entry:
|
||||
|
||||
; Trivial retain,autorelease pair. Don't delete!
|
||||
|
||||
; CHECK: define void @test13(
|
||||
; CHECK-LABEL: define void @test13(
|
||||
; CHECK: tail call i8* @objc_retain(i8* %x) [[NUW]]
|
||||
; CHECK: tail call i8* @objc_retain(i8* %x) [[NUW]]
|
||||
; CHECK: @use_pointer(i8* %x)
|
||||
@ -937,7 +937,7 @@ entry:
|
||||
|
||||
; Delete the retain+release pair.
|
||||
|
||||
; CHECK: define void @test13b
|
||||
; CHECK-LABEL: define void @test13b(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: @objc_retain(i8* %x)
|
||||
; CHECK-NEXT: @use_pointer
|
||||
@ -957,7 +957,7 @@ entry:
|
||||
; Don't delete the retain+release pair because there's an
|
||||
; autoreleasePoolPop in the way.
|
||||
|
||||
; CHECK: define void @test13c
|
||||
; CHECK-LABEL: define void @test13c(
|
||||
; CHECK: @objc_retain(i8* %x)
|
||||
; CHECK: @objc_autoreleasePoolPop
|
||||
; CHECK: @objc_retain(i8* %x)
|
||||
@ -978,7 +978,7 @@ entry:
|
||||
; Like test13c, but there's an autoreleasePoolPush in the way, but that
|
||||
; doesn't matter.
|
||||
|
||||
; CHECK: define void @test13d
|
||||
; CHECK-LABEL: define void @test13d(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: @objc_retain(i8* %x)
|
||||
; CHECK-NEXT: @objc_autoreleasePoolPush
|
||||
@ -1000,7 +1000,7 @@ entry:
|
||||
; Trivial retain,release pair with intervening call, but it's post-dominated
|
||||
; by another release - delete!
|
||||
|
||||
; CHECK: define void @test14(
|
||||
; CHECK-LABEL: define void @test14(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: @use_pointer
|
||||
; CHECK-NEXT: @use_pointer
|
||||
@ -1020,7 +1020,7 @@ entry:
|
||||
; Trivial retain,autorelease pair with intervening call, but it's post-dominated
|
||||
; by another release. Don't delete anything.
|
||||
|
||||
; CHECK: define void @test15(
|
||||
; CHECK-LABEL: define void @test15(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: @objc_retain(i8* %x)
|
||||
; CHECK-NEXT: @use_pointer
|
||||
@ -1040,7 +1040,7 @@ entry:
|
||||
; Trivial retain,autorelease pair, post-dominated
|
||||
; by another release. Delete the retain and release.
|
||||
|
||||
; CHECK: define void @test15b
|
||||
; CHECK-LABEL: define void @test15b(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: @objc_retain
|
||||
; CHECK-NEXT: @objc_autorelease
|
||||
@ -1055,7 +1055,7 @@ entry:
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test15c
|
||||
; CHECK-LABEL: define void @test15c(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: @objc_autorelease
|
||||
; CHECK-NEXT: ret void
|
||||
@ -1070,7 +1070,7 @@ entry:
|
||||
|
||||
; Retain+release pairs in diamonds, all dominated by a retain.
|
||||
|
||||
; CHECK: define void @test16a(
|
||||
; CHECK-LABEL: define void @test16a(
|
||||
; CHECK: @objc_retain(i8* %x)
|
||||
; CHECK-NOT: @objc
|
||||
; CHECK: }
|
||||
@ -1104,7 +1104,7 @@ purple:
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test16b(
|
||||
; CHECK-LABEL: define void @test16b(
|
||||
; CHECK: @objc_retain(i8* %x)
|
||||
; CHECK-NOT: @objc
|
||||
; CHECK: }
|
||||
@ -1138,7 +1138,7 @@ purple:
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test16c(
|
||||
; CHECK-LABEL: define void @test16c(
|
||||
; CHECK: @objc_retain(i8* %x)
|
||||
; CHECK-NOT: @objc
|
||||
; CHECK: }
|
||||
@ -1172,7 +1172,7 @@ purple:
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test16d(
|
||||
; CHECK-LABEL: define void @test16d(
|
||||
; CHECK: @objc_retain(i8* %x)
|
||||
; CHECK-NOT: @objc
|
||||
; CHECK: }
|
||||
@ -1209,7 +1209,7 @@ purple:
|
||||
|
||||
; Retain+release pairs in diamonds, all post-dominated by a release.
|
||||
|
||||
; CHECK: define void @test17(
|
||||
; CHECK-LABEL: define void @test17(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: purple:
|
||||
; CHECK: @objc_release
|
||||
@ -1246,7 +1246,7 @@ purple:
|
||||
|
||||
; Delete no-ops.
|
||||
|
||||
; CHECK: define void @test18(
|
||||
; CHECK-LABEL: define void @test18(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: }
|
||||
define void @test18() {
|
||||
@ -1258,7 +1258,7 @@ define void @test18() {
|
||||
|
||||
; Delete no-ops where undef can be assumed to be null.
|
||||
|
||||
; CHECK: define void @test18b
|
||||
; CHECK-LABEL: define void @test18b(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: }
|
||||
define void @test18b() {
|
||||
@ -1294,7 +1294,7 @@ entry:
|
||||
|
||||
; Bitcast insertion
|
||||
|
||||
; CHECK: define void @test20(
|
||||
; CHECK-LABEL: define void @test20(
|
||||
; CHECK: %tmp1 = tail call i8* @objc_retain(i8* %tmp) [[NUW]]
|
||||
; CHECK-NEXT: invoke
|
||||
; CHECK: }
|
||||
@ -1322,7 +1322,7 @@ if.end: ; preds = %invoke.cont23
|
||||
; Delete a redundant retain,autorelease when forwaring a call result
|
||||
; directly to a return value.
|
||||
|
||||
; CHECK: define i8* @test21(
|
||||
; CHECK-LABEL: define i8* @test21(
|
||||
; CHECK: call i8* @returner()
|
||||
; CHECK-NEXT: ret i8* %call
|
||||
; CHECK-NEXT: }
|
||||
@ -1336,7 +1336,7 @@ entry:
|
||||
|
||||
; Move an objc call up through a phi that has null operands.
|
||||
|
||||
; CHECK: define void @test22(
|
||||
; CHECK-LABEL: define void @test22(
|
||||
; CHECK: B:
|
||||
; CHECK: %1 = bitcast double* %p to i8*
|
||||
; CHECK: call void @objc_release(i8* %1)
|
||||
@ -1359,7 +1359,7 @@ C:
|
||||
|
||||
; Optimize objc_retainBlock.
|
||||
|
||||
; CHECK: define void @test23(
|
||||
; CHECK-LABEL: define void @test23(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: }
|
||||
%block0 = type { i64, i64, i8*, i8* }
|
||||
@ -1393,7 +1393,7 @@ entry:
|
||||
|
||||
; Don't optimize objc_retainBlock, because there's no copy_on_escape metadata.
|
||||
|
||||
; CHECK: define void @test23c(
|
||||
; CHECK-LABEL: define void @test23c(
|
||||
; CHECK: @objc_retainBlock
|
||||
; CHECK: @objc_release
|
||||
; CHECK: }
|
||||
@ -1408,7 +1408,7 @@ entry:
|
||||
|
||||
; Any call can decrement a retain count.
|
||||
|
||||
; CHECK: define void @test24(
|
||||
; CHECK-LABEL: define void @test24(
|
||||
; CHECK: @objc_retain(i8* %a)
|
||||
; CHECK: @objc_release
|
||||
; CHECK: }
|
||||
@ -1423,7 +1423,7 @@ define void @test24(i8* %r, i8* %a) {
|
||||
; Don't move a retain/release pair if the release can be moved
|
||||
; but the retain can't be moved to balance it.
|
||||
|
||||
; CHECK: define void @test25(
|
||||
; CHECK-LABEL: define void @test25(
|
||||
; CHECK: entry:
|
||||
; CHECK: call i8* @objc_retain(i8* %p)
|
||||
; CHECK: true:
|
||||
@ -1448,7 +1448,7 @@ done:
|
||||
; Don't move a retain/release pair if the retain can be moved
|
||||
; but the release can't be moved to balance it.
|
||||
|
||||
; CHECK: define void @test26(
|
||||
; CHECK-LABEL: define void @test26(
|
||||
; CHECK: entry:
|
||||
; CHECK: call i8* @objc_retain(i8* %p)
|
||||
; CHECK: true:
|
||||
@ -1472,7 +1472,7 @@ done:
|
||||
|
||||
; Don't sink the retain,release into the loop.
|
||||
|
||||
; CHECK: define void @test27(
|
||||
; CHECK-LABEL: define void @test27(
|
||||
; CHECK: entry:
|
||||
; CHECK: call i8* @objc_retain(i8* %p)
|
||||
; CHECK: loop:
|
||||
@ -1497,7 +1497,7 @@ done:
|
||||
|
||||
; Trivial code motion case: Triangle.
|
||||
|
||||
; CHECK: define void @test28(
|
||||
; CHECK-LABEL: define void @test28(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: true:
|
||||
; CHECK: call i8* @objc_retain(
|
||||
@ -1525,7 +1525,7 @@ done:
|
||||
; Trivial code motion case: Triangle, but no metadata. Don't move past
|
||||
; unrelated memory references!
|
||||
|
||||
; CHECK: define void @test28b
|
||||
; CHECK-LABEL: define void @test28b(
|
||||
; CHECK: call i8* @objc_retain(
|
||||
; CHECK: true:
|
||||
; CHECK-NOT: @objc_
|
||||
@ -1555,7 +1555,7 @@ done:
|
||||
; Trivial code motion case: Triangle, with metadata. Do move past
|
||||
; unrelated memory references! And preserve the metadata.
|
||||
|
||||
; CHECK: define void @test28c
|
||||
; CHECK-LABEL: define void @test28c(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: true:
|
||||
; CHECK: call i8* @objc_retain(
|
||||
@ -1583,7 +1583,7 @@ done:
|
||||
|
||||
; Like test28. but with two releases.
|
||||
|
||||
; CHECK: define void @test29(
|
||||
; CHECK-LABEL: define void @test29(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: true:
|
||||
; CHECK: call i8* @objc_retain(
|
||||
@ -1618,7 +1618,7 @@ ohno:
|
||||
; Basic case with the use and call in a diamond
|
||||
; with an extra release.
|
||||
|
||||
; CHECK: define void @test30(
|
||||
; CHECK-LABEL: define void @test30(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: true:
|
||||
; CHECK: call i8* @objc_retain(
|
||||
@ -1657,7 +1657,7 @@ ohno:
|
||||
|
||||
; Basic case with a mergeable release.
|
||||
|
||||
; CHECK: define void @test31(
|
||||
; CHECK-LABEL: define void @test31(
|
||||
; CHECK: call i8* @objc_retain(i8* %p)
|
||||
; CHECK: call void @callee()
|
||||
; CHECK: store
|
||||
@ -1686,7 +1686,7 @@ false:
|
||||
|
||||
; Don't consider bitcasts or getelementptrs direct uses.
|
||||
|
||||
; CHECK: define void @test32(
|
||||
; CHECK-LABEL: define void @test32(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: true:
|
||||
; CHECK: call i8* @objc_retain(
|
||||
@ -1715,7 +1715,7 @@ done:
|
||||
|
||||
; Do consider icmps to be direct uses.
|
||||
|
||||
; CHECK: define void @test33(
|
||||
; CHECK-LABEL: define void @test33(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: true:
|
||||
; CHECK: call i8* @objc_retain(
|
||||
@ -1745,7 +1745,7 @@ done:
|
||||
; Delete retain,release if there's just a possible dec and we have imprecise
|
||||
; releases.
|
||||
|
||||
; CHECK: define void @test34a(
|
||||
; CHECK-LABEL: define void @test34a(
|
||||
; CHECK: call i8* @objc_retain
|
||||
; CHECK: true:
|
||||
; CHECK: done:
|
||||
@ -1767,7 +1767,7 @@ done:
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test34b(
|
||||
; CHECK-LABEL: define void @test34b(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: }
|
||||
define void @test34b(i8* %p, i1 %x, i8* %y) {
|
||||
@ -1791,7 +1791,7 @@ done:
|
||||
; release.
|
||||
|
||||
; Precise.
|
||||
; CHECK: define void @test35a(
|
||||
; CHECK-LABEL: define void @test35a(
|
||||
; CHECK: entry:
|
||||
; CHECK: call i8* @objc_retain
|
||||
; CHECK: true:
|
||||
@ -1815,7 +1815,7 @@ done:
|
||||
}
|
||||
|
||||
; Imprecise.
|
||||
; CHECK: define void @test35b(
|
||||
; CHECK-LABEL: define void @test35b(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: }
|
||||
define void @test35b(i8* %p, i1 %x, i8* %y) {
|
||||
@ -1836,7 +1836,7 @@ done:
|
||||
|
||||
; Delete a retain,release if there's no actual use and we have precise release.
|
||||
|
||||
; CHECK: define void @test36a(
|
||||
; CHECK-LABEL: define void @test36a(
|
||||
; CHECK: @objc_retain
|
||||
; CHECK: call void @callee()
|
||||
; CHECK-NOT: @objc_
|
||||
@ -1854,7 +1854,7 @@ entry:
|
||||
|
||||
; Like test36, but with metadata.
|
||||
|
||||
; CHECK: define void @test36b(
|
||||
; CHECK-LABEL: define void @test36b(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: }
|
||||
define void @test36b(i8* %p) {
|
||||
@ -1868,7 +1868,7 @@ entry:
|
||||
|
||||
; Be aggressive about analyzing phis to eliminate possible uses.
|
||||
|
||||
; CHECK: define void @test38(
|
||||
; CHECK-LABEL: define void @test38(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: }
|
||||
define void @test38(i8* %p, i1 %u, i1 %m, i8* %z, i8* %y, i8* %x, i8* %w) {
|
||||
@ -1902,7 +1902,7 @@ g:
|
||||
|
||||
; Delete retain,release pairs around loops.
|
||||
|
||||
; CHECK: define void @test39(
|
||||
; CHECK-LABEL: define void @test39(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: }
|
||||
define void @test39(i8* %p) {
|
||||
@ -1920,7 +1920,7 @@ exit: ; preds = %loop
|
||||
|
||||
; Delete retain,release pairs around loops containing uses.
|
||||
|
||||
; CHECK: define void @test39b(
|
||||
; CHECK-LABEL: define void @test39b(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: }
|
||||
define void @test39b(i8* %p) {
|
||||
@ -1939,7 +1939,7 @@ exit: ; preds = %loop
|
||||
|
||||
; Delete retain,release pairs around loops containing potential decrements.
|
||||
|
||||
; CHECK: define void @test39c(
|
||||
; CHECK-LABEL: define void @test39c(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: }
|
||||
define void @test39c(i8* %p) {
|
||||
@ -1959,7 +1959,7 @@ exit: ; preds = %loop
|
||||
; Delete retain,release pairs around loops even if
|
||||
; the successors are in a different order.
|
||||
|
||||
; CHECK: define void @test40(
|
||||
; CHECK-LABEL: define void @test40(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: }
|
||||
define void @test40(i8* %p) {
|
||||
@ -1979,7 +1979,7 @@ exit: ; preds = %loop
|
||||
; Do the known-incremented retain+release elimination even if the pointer
|
||||
; is also autoreleased.
|
||||
|
||||
; CHECK: define void @test42(
|
||||
; CHECK-LABEL: define void @test42(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: call i8* @objc_retain(i8* %p)
|
||||
; CHECK-NEXT: call i8* @objc_autorelease(i8* %p)
|
||||
@ -2001,7 +2001,7 @@ entry:
|
||||
; Don't the known-incremented retain+release elimination if the pointer is
|
||||
; autoreleased and there's an autoreleasePoolPop.
|
||||
|
||||
; CHECK: define void @test43(
|
||||
; CHECK-LABEL: define void @test43(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: call i8* @objc_retain(i8* %p)
|
||||
; CHECK-NEXT: call i8* @objc_autorelease(i8* %p)
|
||||
@ -2027,7 +2027,7 @@ entry:
|
||||
; Do the known-incremented retain+release elimination if the pointer is
|
||||
; autoreleased and there's an autoreleasePoolPush.
|
||||
|
||||
; CHECK: define void @test43b
|
||||
; CHECK-LABEL: define void @test43b(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: call i8* @objc_retain(i8* %p)
|
||||
; CHECK-NEXT: call i8* @objc_autorelease(i8* %p)
|
||||
@ -2050,7 +2050,7 @@ entry:
|
||||
|
||||
; Do retain+release elimination for non-provenance pointers.
|
||||
|
||||
; CHECK: define void @test44(
|
||||
; CHECK-LABEL: define void @test44(
|
||||
; CHECK-NOT: objc_
|
||||
; CHECK: }
|
||||
define void @test44(i8** %pp) {
|
||||
@ -2063,7 +2063,7 @@ define void @test44(i8** %pp) {
|
||||
; Don't delete retain+release with an unknown-provenance
|
||||
; may-alias objc_release between them.
|
||||
|
||||
; CHECK: define void @test45(
|
||||
; CHECK-LABEL: define void @test45(
|
||||
; CHECK: call i8* @objc_retain(i8* %p)
|
||||
; CHECK: call void @objc_release(i8* %q)
|
||||
; CHECK: call void @use_pointer(i8* %p)
|
||||
@ -2081,7 +2081,7 @@ define void @test45(i8** %pp, i8** %qq) {
|
||||
|
||||
; Don't delete retain and autorelease here.
|
||||
|
||||
; CHECK: define void @test46(
|
||||
; CHECK-LABEL: define void @test46(
|
||||
; CHECK: tail call i8* @objc_retain(i8* %p) [[NUW]]
|
||||
; CHECK: true:
|
||||
; CHECK: call i8* @objc_autorelease(i8* %p) [[NUW]]
|
||||
@ -2102,7 +2102,7 @@ false:
|
||||
|
||||
; Delete no-op cast calls.
|
||||
|
||||
; CHECK: define i8* @test47(
|
||||
; CHECK-LABEL: define i8* @test47(
|
||||
; CHECK-NOT: call
|
||||
; CHECK: ret i8* %p
|
||||
; CHECK: }
|
||||
@ -2113,7 +2113,7 @@ define i8* @test47(i8* %p) nounwind {
|
||||
|
||||
; Delete no-op cast calls.
|
||||
|
||||
; CHECK: define i8* @test48(
|
||||
; CHECK-LABEL: define i8* @test48(
|
||||
; CHECK-NOT: call
|
||||
; CHECK: ret i8* %p
|
||||
; CHECK: }
|
||||
@ -2124,7 +2124,7 @@ define i8* @test48(i8* %p) nounwind {
|
||||
|
||||
; Delete no-op cast calls.
|
||||
|
||||
; CHECK: define i8* @test49(
|
||||
; CHECK-LABEL: define i8* @test49(
|
||||
; CHECK-NOT: call
|
||||
; CHECK: ret i8* %p
|
||||
; CHECK: }
|
||||
@ -2136,7 +2136,7 @@ define i8* @test49(i8* %p) nounwind {
|
||||
; Do delete retain+release with intervening stores of the address value if we
|
||||
; have imprecise release attached to objc_release.
|
||||
|
||||
; CHECK: define void @test50a(
|
||||
; CHECK-LABEL: define void @test50a(
|
||||
; CHECK-NEXT: call i8* @objc_retain
|
||||
; CHECK-NEXT: call void @callee
|
||||
; CHECK-NEXT: store
|
||||
@ -2151,7 +2151,7 @@ define void @test50a(i8* %p, i8** %pp) {
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test50b(
|
||||
; CHECK-LABEL: define void @test50b(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: }
|
||||
define void @test50b(i8* %p, i8** %pp) {
|
||||
@ -2166,7 +2166,7 @@ define void @test50b(i8* %p, i8** %pp) {
|
||||
; Don't delete retain+release with intervening stores through the
|
||||
; address value.
|
||||
|
||||
; CHECK: define void @test51a(
|
||||
; CHECK-LABEL: define void @test51a(
|
||||
; CHECK: call i8* @objc_retain(i8* %p)
|
||||
; CHECK: call void @objc_release(i8* %p)
|
||||
; CHECK: ret void
|
||||
@ -2179,7 +2179,7 @@ define void @test51a(i8* %p) {
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test51b(
|
||||
; CHECK-LABEL: define void @test51b(
|
||||
; CHECK: call i8* @objc_retain(i8* %p)
|
||||
; CHECK: call void @objc_release(i8* %p)
|
||||
; CHECK: ret void
|
||||
@ -2195,7 +2195,7 @@ define void @test51b(i8* %p) {
|
||||
; Don't delete retain+release with intervening use of a pointer of
|
||||
; unknown provenance.
|
||||
|
||||
; CHECK: define void @test52a(
|
||||
; CHECK-LABEL: define void @test52a(
|
||||
; CHECK: call i8* @objc_retain
|
||||
; CHECK: call void @callee()
|
||||
; CHECK: call void @use_pointer(i8* %z)
|
||||
@ -2212,7 +2212,7 @@ define void @test52a(i8** %zz, i8** %pp) {
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test52b(
|
||||
; CHECK-LABEL: define void @test52b(
|
||||
; CHECK: call i8* @objc_retain
|
||||
; CHECK: call void @callee()
|
||||
; CHECK: call void @use_pointer(i8* %z)
|
||||
@ -2234,7 +2234,7 @@ define void @test52b(i8** %zz, i8** %pp) {
|
||||
; Oops. That's wrong. Clang sometimes uses function types gratuitously.
|
||||
; See rdar://10551239.
|
||||
|
||||
; CHECK: define void @test53(
|
||||
; CHECK-LABEL: define void @test53(
|
||||
; CHECK: @objc_
|
||||
; CHECK: }
|
||||
define void @test53(void ()** %zz, i8** %pp) {
|
||||
@ -2249,7 +2249,7 @@ define void @test53(void ()** %zz, i8** %pp) {
|
||||
|
||||
; Convert autorelease to release if the value is unused.
|
||||
|
||||
; CHECK: define void @test54(
|
||||
; CHECK-LABEL: define void @test54(
|
||||
; CHECK: call i8* @returner()
|
||||
; CHECK-NEXT: call void @objc_release(i8* %t) [[NUW]], !clang.imprecise_release !0
|
||||
; CHECK-NEXT: ret void
|
||||
@ -2262,7 +2262,7 @@ define void @test54() {
|
||||
|
||||
; Nested retain+release pairs. Delete them both.
|
||||
|
||||
; CHECK: define void @test55(
|
||||
; CHECK-LABEL: define void @test55(
|
||||
; CHECK-NOT: @objc
|
||||
; CHECK: }
|
||||
define void @test55(i8* %x) {
|
||||
@ -2279,7 +2279,7 @@ entry:
|
||||
; can be partially eliminated. Plus an extra outer pair to
|
||||
; eliminate, for fun.
|
||||
|
||||
; CHECK: define void @test56(
|
||||
; CHECK-LABEL: define void @test56(
|
||||
; CHECK-NOT: @objc
|
||||
; CHECK: if.then:
|
||||
; CHECK-NEXT: %0 = tail call i8* @objc_retain(i8* %x) [[NUW]]
|
||||
@ -2313,7 +2313,7 @@ if.end: ; preds = %entry, %if.then
|
||||
; known unnecessary because the presence of the second one means that
|
||||
; the first one won't be deleting the object.
|
||||
|
||||
; CHECK: define void @test57(
|
||||
; CHECK-LABEL: define void @test57(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: call void @use_pointer(i8* %x)
|
||||
; CHECK-NEXT: call void @use_pointer(i8* %x)
|
||||
@ -2339,7 +2339,7 @@ entry:
|
||||
; An adjacent retain+release pair is sufficient even if it will be
|
||||
; removed itself.
|
||||
|
||||
; CHECK: define void @test58(
|
||||
; CHECK-LABEL: define void @test58(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: call void @use_pointer(i8* %x)
|
||||
; CHECK-NEXT: call void @use_pointer(i8* %x)
|
||||
@ -2358,7 +2358,7 @@ entry:
|
||||
|
||||
; Don't delete the second retain+release pair in an adjacent set.
|
||||
|
||||
; CHECK: define void @test59(
|
||||
; CHECK-LABEL: define void @test59(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: %0 = tail call i8* @objc_retain(i8* %x) [[NUW]]
|
||||
; CHECK-NEXT: call void @use_pointer(i8* %x)
|
||||
@ -2385,7 +2385,7 @@ entry:
|
||||
; We have a precise lifetime retain/release here. We can not remove them since
|
||||
; @something is not constant.
|
||||
|
||||
; CHECK: define void @test60a(
|
||||
; CHECK-LABEL: define void @test60a(
|
||||
; CHECK: call i8* @objc_retain
|
||||
; CHECK: call void @objc_release
|
||||
; CHECK: }
|
||||
@ -2399,7 +2399,7 @@ define void @test60a() {
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test60b(
|
||||
; CHECK-LABEL: define void @test60b(
|
||||
; CHECK: call i8* @objc_retain
|
||||
; CHECK-NOT: call i8* @objc_retain
|
||||
; CHECK-NOT: call i8* @objc_rrelease
|
||||
@ -2415,7 +2415,7 @@ define void @test60b() {
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test60c(
|
||||
; CHECK-LABEL: define void @test60c(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: }
|
||||
define void @test60c() {
|
||||
@ -2428,7 +2428,7 @@ define void @test60c() {
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test60d(
|
||||
; CHECK-LABEL: define void @test60d(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: }
|
||||
define void @test60d() {
|
||||
@ -2441,7 +2441,7 @@ define void @test60d() {
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test60e(
|
||||
; CHECK-LABEL: define void @test60e(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: }
|
||||
define void @test60e() {
|
||||
@ -2457,7 +2457,7 @@ define void @test60e() {
|
||||
; Constant pointers to objects don't need to be considered related to other
|
||||
; pointers.
|
||||
|
||||
; CHECK: define void @test61(
|
||||
; CHECK-LABEL: define void @test61(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: }
|
||||
define void @test61() {
|
||||
@ -2472,7 +2472,7 @@ define void @test61() {
|
||||
; Delete a retain matched by releases when one is inside the loop and the
|
||||
; other is outside the loop.
|
||||
|
||||
; CHECK: define void @test62(
|
||||
; CHECK-LABEL: define void @test62(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: }
|
||||
define void @test62(i8* %x, i1* %p) nounwind {
|
||||
@ -2496,7 +2496,7 @@ exit:
|
||||
; Like test62 but with no release in exit.
|
||||
; Don't delete anything!
|
||||
|
||||
; CHECK: define void @test63(
|
||||
; CHECK-LABEL: define void @test63(
|
||||
; CHECK: loop:
|
||||
; CHECK: tail call i8* @objc_retain(i8* %x)
|
||||
; CHECK: loop.more:
|
||||
@ -2522,7 +2522,7 @@ exit:
|
||||
; Like test62 but with no release in loop.more.
|
||||
; Don't delete anything!
|
||||
|
||||
; CHECK: define void @test64(
|
||||
; CHECK-LABEL: define void @test64(
|
||||
; CHECK: loop:
|
||||
; CHECK: tail call i8* @objc_retain(i8* %x)
|
||||
; CHECK: exit:
|
||||
@ -2547,7 +2547,7 @@ exit:
|
||||
|
||||
; Move an autorelease past a phi with a null.
|
||||
|
||||
; CHECK: define i8* @test65(
|
||||
; CHECK-LABEL: define i8* @test65(
|
||||
; CHECK: if.then:
|
||||
; CHECK: call i8* @objc_autorelease(
|
||||
; CHECK: return:
|
||||
@ -2570,7 +2570,7 @@ return: ; preds = %if.then, %entry
|
||||
|
||||
; Don't move an autorelease past an autorelease pool boundary.
|
||||
|
||||
; CHECK: define i8* @test65b(
|
||||
; CHECK-LABEL: define i8* @test65b(
|
||||
; CHECK: if.then:
|
||||
; CHECK-NOT: @objc_autorelease
|
||||
; CHECK: return:
|
||||
@ -2596,7 +2596,7 @@ return: ; preds = %if.then, %entry
|
||||
; Don't move an autoreleaseReuturnValue, which would break
|
||||
; the RV optimization.
|
||||
|
||||
; CHECK: define i8* @test65c(
|
||||
; CHECK-LABEL: define i8* @test65c(
|
||||
; CHECK: if.then:
|
||||
; CHECK-NOT: @objc_autorelease
|
||||
; CHECK: return:
|
||||
@ -2620,7 +2620,7 @@ return: ; preds = %if.then, %entry
|
||||
; An objc_retain can serve as a may-use for a different pointer.
|
||||
; rdar://11931823
|
||||
|
||||
; CHECK: define void @test66a(
|
||||
; CHECK-LABEL: define void @test66a(
|
||||
; CHECK: tail call i8* @objc_retain(i8* %cond) [[NUW]]
|
||||
; CHECK: tail call void @objc_release(i8* %call) [[NUW]]
|
||||
; CHECK: tail call i8* @objc_retain(i8* %tmp8) [[NUW]]
|
||||
@ -2643,7 +2643,7 @@ cond.end: ; preds = %cond.true, %entry
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test66b(
|
||||
; CHECK-LABEL: define void @test66b(
|
||||
; CHECK: tail call i8* @objc_retain(i8* %cond) [[NUW]]
|
||||
; CHECK: tail call void @objc_release(i8* %call) [[NUW]]
|
||||
; CHECK: tail call i8* @objc_retain(i8* %tmp8) [[NUW]]
|
||||
@ -2666,7 +2666,7 @@ cond.end: ; preds = %cond.true, %entry
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test66c(
|
||||
; CHECK-LABEL: define void @test66c(
|
||||
; CHECK: tail call i8* @objc_retain(i8* %cond) [[NUW]]
|
||||
; CHECK: tail call void @objc_release(i8* %call) [[NUW]]
|
||||
; CHECK: tail call i8* @objc_retain(i8* %tmp8) [[NUW]]
|
||||
@ -2689,7 +2689,7 @@ cond.end: ; preds = %cond.true, %entry
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test66d(
|
||||
; CHECK-LABEL: define void @test66d(
|
||||
; CHECK: tail call i8* @objc_retain(i8* %cond) [[NUW]]
|
||||
; CHECK: tail call void @objc_release(i8* %call) [[NUW]]
|
||||
; CHECK: tail call i8* @objc_retain(i8* %tmp8) [[NUW]]
|
||||
@ -3045,7 +3045,7 @@ declare i32 @objc_sync_exit(i8*)
|
||||
; Make sure that we understand that objc_sync_{enter,exit} are IC_User not
|
||||
; IC_Call/IC_CallOrUser.
|
||||
|
||||
; CHECK: define void @test67
|
||||
; CHECK-LABEL: define void @test67(
|
||||
; CHECK-NEXT: call i32 @objc_sync_enter(i8* %x)
|
||||
; CHECK-NEXT: call i32 @objc_sync_exit(i8* %x)
|
||||
; CHECK-NEXT: ret void
|
||||
|
@ -10,7 +10,7 @@ declare void @objc_release(i8*)
|
||||
declare void @callee()
|
||||
declare void @block_callee(void ()*)
|
||||
|
||||
; CHECK: define void @test0(
|
||||
; CHECK-LABEL: define void @test0(
|
||||
; CHECK: call i8* @objc_retain(
|
||||
; CHECK: for.body:
|
||||
; CHECK-NOT: @objc
|
||||
@ -35,7 +35,7 @@ for.end: ; preds = %for.body
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test1(
|
||||
; CHECK-LABEL: define void @test1(
|
||||
; CHECK: call i8* @objc_retain(
|
||||
; CHECK: for.body:
|
||||
; CHECK-NOT: @objc
|
||||
@ -60,7 +60,7 @@ for.end: ; preds = %for.body
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test2(
|
||||
; CHECK-LABEL: define void @test2(
|
||||
; CHECK: call i8* @objc_retain(
|
||||
; CHECK: for.body:
|
||||
; CHECK-NOT: @objc
|
||||
|
@ -8,7 +8,7 @@ declare void @use_pointer(i8*)
|
||||
|
||||
@x = external global i8*
|
||||
|
||||
; CHECK: define void @test0(
|
||||
; CHECK-LABEL: define void @test0(
|
||||
; CHECK: entry:
|
||||
; CHECK-NEXT: tail call void @objc_storeStrong(i8** @x, i8* %p) [[NUW:#[0-9]+]]
|
||||
; CHECK-NEXT: ret void
|
||||
@ -137,7 +137,7 @@ entry:
|
||||
|
||||
; Like test0, but there's no store, so don't form an objc_storeStrong.
|
||||
|
||||
; CHECK: define void @test7(
|
||||
; CHECK-LABEL: define void @test7(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: %0 = tail call i8* @objc_retain(i8* %p) [[NUW]]
|
||||
; CHECK-NEXT: %tmp = load i8** @x, align 8
|
||||
@ -154,7 +154,7 @@ entry:
|
||||
|
||||
; Like test0, but there's no retain, so don't form an objc_storeStrong.
|
||||
|
||||
; CHECK: define void @test8(
|
||||
; CHECK-LABEL: define void @test8(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: %tmp = load i8** @x, align 8
|
||||
; CHECK-NEXT: store i8* %p, i8** @x, align 8
|
||||
|
@ -18,7 +18,7 @@ declare i32 @__gxx_personality_sj0(...)
|
||||
|
||||
; Don't get in trouble on bugpointed code.
|
||||
|
||||
; CHECK: define void @test0(
|
||||
; CHECK-LABEL: define void @test0(
|
||||
define void @test0() {
|
||||
bb:
|
||||
%tmp = bitcast %4* undef to i8*
|
||||
@ -45,7 +45,7 @@ bb6: ; preds = %bb5, %bb4, %bb4, %b
|
||||
; When rewriting operands for a phi which has multiple operands
|
||||
; for the same block, use the exactly same value in each block.
|
||||
|
||||
; CHECK: define void @test1(
|
||||
; CHECK-LABEL: define void @test1(
|
||||
; CHECK: %0 = bitcast i8* %tmp3 to %0*
|
||||
; CHECK: br i1 undef, label %bb7, label %bb7
|
||||
; CHECK: bb7:
|
||||
|
@ -12,7 +12,7 @@ declare void @use_pointer(i8*)
|
||||
declare i8* @returner()
|
||||
declare void @callee()
|
||||
|
||||
; CHECK: define void @test0
|
||||
; CHECK-LABEL: define void @test0(
|
||||
; CHECK: call void @use_pointer(i8* %0)
|
||||
; CHECK: }
|
||||
define void @test0(i8* %x) nounwind {
|
||||
@ -22,7 +22,7 @@ entry:
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test1
|
||||
; CHECK-LABEL: define void @test1(
|
||||
; CHECK: call void @use_pointer(i8* %0)
|
||||
; CHECK: }
|
||||
define void @test1(i8* %x) nounwind {
|
||||
@ -34,7 +34,7 @@ entry:
|
||||
|
||||
; Merge objc_retain and objc_autorelease into objc_retainAutorelease.
|
||||
|
||||
; CHECK: define void @test2(
|
||||
; CHECK-LABEL: define void @test2(
|
||||
; CHECK: tail call i8* @objc_retainAutorelease(i8* %x) [[NUW:#[0-9]+]]
|
||||
; CHECK: }
|
||||
define void @test2(i8* %x) nounwind {
|
||||
@ -47,7 +47,7 @@ entry:
|
||||
|
||||
; Same as test2 but the value is returned. Do an RV optimization.
|
||||
|
||||
; CHECK: define i8* @test2b(
|
||||
; CHECK-LABEL: define i8* @test2b(
|
||||
; CHECK: tail call i8* @objc_retainAutoreleaseReturnValue(i8* %x) [[NUW]]
|
||||
; CHECK: }
|
||||
define i8* @test2b(i8* %x) nounwind {
|
||||
@ -59,7 +59,7 @@ entry:
|
||||
|
||||
; Merge a retain,autorelease pair around a call.
|
||||
|
||||
; CHECK: define void @test3(
|
||||
; CHECK-LABEL: define void @test3(
|
||||
; CHECK: tail call i8* @objc_retainAutorelease(i8* %x) [[NUW]]
|
||||
; CHECK: @use_pointer(i8* %0)
|
||||
; CHECK: }
|
||||
@ -74,7 +74,7 @@ entry:
|
||||
; Trivial retain,autorelease pair with intervening call, but it's post-dominated
|
||||
; by another release. The retain and autorelease can be merged.
|
||||
|
||||
; CHECK: define void @test4(
|
||||
; CHECK-LABEL: define void @test4(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: @objc_retainAutorelease(i8* %x) [[NUW]]
|
||||
; CHECK-NEXT: @use_pointer
|
||||
@ -92,7 +92,7 @@ entry:
|
||||
|
||||
; Don't merge retain and autorelease if they're not control-equivalent.
|
||||
|
||||
; CHECK: define void @test5(
|
||||
; CHECK-LABEL: define void @test5(
|
||||
; CHECK: tail call i8* @objc_retain(i8* %p) [[NUW]]
|
||||
; CHECK: true:
|
||||
; CHECK: call i8* @objc_autorelease(i8* %0) [[NUW]]
|
||||
@ -119,7 +119,7 @@ false:
|
||||
; into objc_retainAutoreleasedReturnValueAutoreleaseReturnValue?
|
||||
; Those entrypoints don't exist yet though.
|
||||
|
||||
; CHECK: define i8* @test6(
|
||||
; CHECK-LABEL: define i8* @test6(
|
||||
; CHECK: call i8* @objc_retainAutoreleasedReturnValue(i8* %p) [[NUW]]
|
||||
; CHECK: %t = tail call i8* @objc_autoreleaseReturnValue(i8* %1) [[NUW]]
|
||||
; CHECK: }
|
||||
@ -148,7 +148,7 @@ define i8* @test7(i8* %p) {
|
||||
|
||||
; Do the return value substitution for PHI nodes too.
|
||||
|
||||
; CHECK: define i8* @test8(
|
||||
; CHECK-LABEL: define i8* @test8(
|
||||
; CHECK: %retval = phi i8* [ %p, %if.then ], [ null, %entry ]
|
||||
; CHECK: }
|
||||
define i8* @test8(i1 %x, i8* %c) {
|
||||
@ -165,7 +165,7 @@ return: ; preds = %if.then, %entry
|
||||
}
|
||||
|
||||
; Kill calls to @clang.arc.use(...)
|
||||
; CHECK: define void @test9(
|
||||
; CHECK-LABEL: define void @test9(
|
||||
; CHECK-NOT: clang.arc.use
|
||||
; CHECK: }
|
||||
define void @test9(i8* %a, i8* %b) {
|
||||
@ -188,7 +188,7 @@ define void @test10() {
|
||||
; Convert objc_retain to objc_retainAutoreleasedReturnValue if its
|
||||
; argument is a return value.
|
||||
|
||||
; CHECK: define void @test11(
|
||||
; CHECK-LABEL: define void @test11(
|
||||
; CHECK-NEXT: %y = call i8* @returner()
|
||||
; CHECK-NEXT: tail call i8* @objc_retainAutoreleasedReturnValue(i8* %y) [[NUW]]
|
||||
; CHECK-NEXT: ret void
|
||||
@ -201,7 +201,7 @@ define void @test11() {
|
||||
; Don't convert objc_retain to objc_retainAutoreleasedReturnValue if its
|
||||
; argument is not a return value.
|
||||
|
||||
; CHECK: define void @test12(
|
||||
; CHECK-LABEL: define void @test12(
|
||||
; CHECK-NEXT: tail call i8* @objc_retain(i8* %y) [[NUW]]
|
||||
; CHECK-NEXT: ret void
|
||||
; CHECK-NEXT: }
|
||||
@ -213,7 +213,7 @@ define void @test12(i8* %y) {
|
||||
; Don't Convert objc_retain to objc_retainAutoreleasedReturnValue if it
|
||||
; isn't next to the call providing its return value.
|
||||
|
||||
; CHECK: define void @test13(
|
||||
; 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]]
|
||||
|
@ -11,7 +11,7 @@ declare i8* @objc_autoreleaseReturnValue(i8*)
|
||||
|
||||
; Don't delete the autorelease.
|
||||
|
||||
; CHECK: define %0* @test0(
|
||||
; CHECK-LABEL: define %0* @test0(
|
||||
; CHECK: @objc_retain
|
||||
; CHECK: .lr.ph:
|
||||
; CHECK-NOT: @objc_r
|
||||
@ -35,7 +35,7 @@ define %0* @test0(%0* %buffer) nounwind {
|
||||
|
||||
; Do delete the autorelease, even with the retain in a different block.
|
||||
|
||||
; CHECK: define %0* @test1(
|
||||
; CHECK-LABEL: define %0* @test1(
|
||||
; CHECK-NOT: @objc
|
||||
; CHECK: }
|
||||
define %0* @test1() nounwind {
|
||||
|
@ -9,7 +9,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
|
||||
; Don't optimize away the retainBlock, because the object's address "escapes"
|
||||
; with the objc_storeWeak call.
|
||||
|
||||
; CHECK: define void @test0(
|
||||
; CHECK-LABEL: define void @test0(
|
||||
; CHECK: %tmp7 = call i8* @objc_retainBlock(i8* %tmp6) [[NUW:#[0-9]+]], !clang.arc.copy_on_escape !0
|
||||
; CHECK: call void @objc_release(i8* %tmp7) [[NUW]], !clang.imprecise_release !0
|
||||
; CHECK: }
|
||||
@ -65,7 +65,7 @@ entry:
|
||||
; Like test0, but it makes a regular call instead of a storeWeak call,
|
||||
; so the optimization is valid.
|
||||
|
||||
; CHECK: define void @test1(
|
||||
; CHECK-LABEL: define void @test1(
|
||||
; CHECK-NOT: @objc_retainBlock
|
||||
; CHECK: }
|
||||
define void @test1() nounwind {
|
||||
|
@ -26,7 +26,7 @@ entry:
|
||||
; GVN should not be able to eliminate this redundant load, with ARC-specific
|
||||
; alias analysis.
|
||||
|
||||
; CHECK: define i8* @test1
|
||||
; CHECK-LABEL: define i8* @test1(
|
||||
; CHECK: load
|
||||
; CHECK: load
|
||||
; CHECK: ret i8* %t
|
||||
|
@ -6,7 +6,7 @@
|
||||
declare void @clang.arc.use(...) nounwind
|
||||
|
||||
; Kill calls to @clang.arc.use(...)
|
||||
; CHECK: define void @test0(
|
||||
; CHECK-LABEL: define void @test0(
|
||||
; CHECK-NOT: clang.arc.use
|
||||
; CHECK: }
|
||||
define void @test0(i8* %a, i8* %b) {
|
||||
|
@ -17,7 +17,7 @@ declare void @test0_helper(i8*, i8**)
|
||||
; FIXME: the fact that we re-order retains w.r.t. @clang.arc.use could
|
||||
; be problematic if we get run twice, e.g. under LTO.
|
||||
;
|
||||
; CHECK: define void @test0(
|
||||
; CHECK-LABEL: define void @test0(
|
||||
; CHECK: @objc_retain(i8* %x)
|
||||
; CHECK-NEXT: store i8* %y, i8** %temp0
|
||||
; CHECK-NEXT: @objc_retain(i8* %y)
|
||||
@ -65,7 +65,7 @@ entry:
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: define void @test0a(
|
||||
; CHECK-LABEL: define void @test0a(
|
||||
; CHECK: @objc_retain(i8* %x)
|
||||
; CHECK-NEXT: store i8* %y, i8** %temp0
|
||||
; CHECK-NEXT: @objc_retain(i8* %y)
|
||||
|
@ -10,7 +10,7 @@ declare i8* @returner()
|
||||
|
||||
; ARCOpt shouldn't try to move the releases to the block containing the invoke.
|
||||
|
||||
; CHECK: define void @test0(
|
||||
; CHECK-LABEL: define void @test0(
|
||||
; CHECK: invoke.cont:
|
||||
; CHECK: call void @objc_release(i8* %zipFile) [[NUW:#[0-9]+]], !clang.imprecise_release !0
|
||||
; CHECK: ret void
|
||||
@ -38,7 +38,7 @@ lpad: ; preds = %entry
|
||||
|
||||
; ARCOpt should move the release before the callee calls.
|
||||
|
||||
; CHECK: define void @test1(
|
||||
; CHECK-LABEL: define void @test1(
|
||||
; CHECK: invoke.cont:
|
||||
; CHECK: call void @objc_release(i8* %zipFile) [[NUW]], !clang.imprecise_release !0
|
||||
; CHECK: call void @callee()
|
||||
@ -108,7 +108,7 @@ finally.rethrow: ; preds = %invoke.cont, %entry
|
||||
|
||||
; Don't try to place code on invoke critical edges.
|
||||
|
||||
; CHECK: define void @test3(
|
||||
; CHECK-LABEL: define void @test3(
|
||||
; CHECK: if.end:
|
||||
; CHECK-NEXT: call void @objc_release(i8* %p) [[NUW]]
|
||||
; CHECK-NEXT: ret void
|
||||
@ -139,7 +139,7 @@ if.end:
|
||||
|
||||
; Like test3, but with ARC-relevant exception handling.
|
||||
|
||||
; CHECK: define void @test4(
|
||||
; CHECK-LABEL: define void @test4(
|
||||
; CHECK: lpad:
|
||||
; CHECK-NEXT: %r = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*)
|
||||
; CHECK-NEXT: cleanup
|
||||
@ -177,7 +177,7 @@ if.end:
|
||||
; Don't turn the retainAutoreleaseReturnValue into retain, because it's
|
||||
; for an invoke which we can assume codegen will put immediately prior.
|
||||
|
||||
; CHECK: define void @test5(
|
||||
; CHECK-LABEL: define void @test5(
|
||||
; CHECK: call i8* @objc_retainAutoreleasedReturnValue(i8* %z)
|
||||
; CHECK: }
|
||||
define void @test5() {
|
||||
@ -197,7 +197,7 @@ if.end:
|
||||
|
||||
; Like test5, but there's intervening code.
|
||||
|
||||
; CHECK: define void @test6(
|
||||
; CHECK-LABEL: define void @test6(
|
||||
; CHECK: call i8* @objc_retain(i8* %z)
|
||||
; CHECK: }
|
||||
define void @test6() {
|
||||
|
@ -25,7 +25,7 @@ declare void @__crasher_block_invoke1(i8* nocapture)
|
||||
|
||||
; Delete a nested retain+release pair.
|
||||
|
||||
; CHECK: define void @test0(
|
||||
; CHECK-LABEL: define void @test0(
|
||||
; CHECK: call i8* @objc_retain
|
||||
; CHECK-NOT: @objc_retain
|
||||
; CHECK: }
|
||||
@ -89,7 +89,7 @@ forcoll.empty:
|
||||
|
||||
; Delete a nested retain+release pair.
|
||||
|
||||
; CHECK: define void @test2(
|
||||
; CHECK-LABEL: define void @test2(
|
||||
; CHECK: call i8* @objc_retain
|
||||
; CHECK-NOT: @objc_retain
|
||||
; CHECK: }
|
||||
@ -154,7 +154,7 @@ forcoll.empty:
|
||||
|
||||
; Delete a nested retain+release pair.
|
||||
|
||||
; CHECK: define void @test4(
|
||||
; CHECK-LABEL: define void @test4(
|
||||
; CHECK: call i8* @objc_retain
|
||||
; CHECK-NOT: @objc_retain
|
||||
; CHECK: }
|
||||
@ -219,7 +219,7 @@ forcoll.empty:
|
||||
|
||||
; Delete a nested retain+release pair.
|
||||
|
||||
; CHECK: define void @test5(
|
||||
; CHECK-LABEL: define void @test5(
|
||||
; CHECK: call i8* @objc_retain
|
||||
; CHECK-NOT: @objc_retain
|
||||
; CHECK: }
|
||||
@ -287,7 +287,7 @@ forcoll.empty:
|
||||
; The optimizer currently can't do this, because isn't isn't sophisticated enough in
|
||||
; reasnoning about nesting.
|
||||
|
||||
; CHECK: define void @test6(
|
||||
; CHECK-LABEL: define void @test6(
|
||||
; CHECK: call i8* @objc_retain
|
||||
; CHECK: @objc_retain
|
||||
; CHECK: }
|
||||
@ -355,7 +355,7 @@ forcoll.empty:
|
||||
; The optimizer currently can't do this, because isn't isn't sophisticated enough in
|
||||
; reasnoning about nesting.
|
||||
|
||||
; CHECK: define void @test7(
|
||||
; CHECK-LABEL: define void @test7(
|
||||
; CHECK: call i8* @objc_retain
|
||||
; CHECK: @objc_retain
|
||||
; CHECK: }
|
||||
@ -422,7 +422,7 @@ forcoll.empty:
|
||||
|
||||
; Delete a nested retain+release pair.
|
||||
|
||||
; CHECK: define void @test8(
|
||||
; CHECK-LABEL: define void @test8(
|
||||
; CHECK: call i8* @objc_retain
|
||||
; CHECK-NOT: @objc_retain
|
||||
; CHECK: }
|
||||
@ -496,7 +496,7 @@ forcoll.empty:
|
||||
; The optimizer currently can't do this, because of a split loop backedge.
|
||||
; See test9b for the same testcase without a split backedge.
|
||||
|
||||
; CHECK: define void @test9(
|
||||
; CHECK-LABEL: define void @test9(
|
||||
; CHECK: call i8* @objc_retain
|
||||
; CHECK: call i8* @objc_retain
|
||||
; CHECK: call i8* @objc_retain
|
||||
@ -563,7 +563,7 @@ forcoll.empty:
|
||||
|
||||
; Like test9, but without a split backedge. TODO: optimize this.
|
||||
|
||||
; CHECK: define void @test9b(
|
||||
; CHECK-LABEL: define void @test9b(
|
||||
; CHECK: call i8* @objc_retain
|
||||
; CHECK: call i8* @objc_retain
|
||||
; CHECK: @objc_retain
|
||||
@ -629,7 +629,7 @@ forcoll.empty:
|
||||
; The optimizer currently can't do this, because of a split loop backedge.
|
||||
; See test10b for the same testcase without a split backedge.
|
||||
|
||||
; CHECK: define void @test10(
|
||||
; CHECK-LABEL: define void @test10(
|
||||
; CHECK: call i8* @objc_retain
|
||||
; CHECK: call i8* @objc_retain
|
||||
; CHECK: call i8* @objc_retain
|
||||
@ -697,7 +697,7 @@ forcoll.empty:
|
||||
|
||||
; Like test10, but without a split backedge. TODO: optimize this.
|
||||
|
||||
; CHECK: define void @test10b(
|
||||
; CHECK-LABEL: define void @test10b(
|
||||
; CHECK: call i8* @objc_retain
|
||||
; CHECK: call i8* @objc_retain
|
||||
; CHECK: @objc_retain
|
||||
@ -769,7 +769,7 @@ forcoll.empty:
|
||||
@__block_d_tmp = external hidden constant { i64, i64, i8*, i8*, i8*, i8* }
|
||||
@__block_d_tmp5 = external hidden constant { i64, i64, i8*, i8*, i8*, i8* }
|
||||
|
||||
; CHECK: define void @test11(
|
||||
; CHECK-LABEL: define void @test11(
|
||||
; CHECK: tail call i8* @objc_retain(i8* %call) [[NUW:#[0-9]+]]
|
||||
; CHECK: tail call i8* @objc_retain(i8* %call) [[NUW]]
|
||||
; CHECK: call void @objc_release(i8* %call) [[NUW]], !clang.imprecise_release !0
|
||||
|
@ -10,7 +10,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
|
||||
; metadata and eliminate the retainBlock+release pair here.
|
||||
; rdar://10803830.
|
||||
|
||||
; CHECK: define void @test0(
|
||||
; CHECK-LABEL: define void @test0(
|
||||
; CHECK-NOT: @objc
|
||||
; CHECK: }
|
||||
define void @test0() {
|
||||
@ -63,7 +63,7 @@ lpad: ; preds = %entry
|
||||
; shouldn't eliminate anything, but *CAN* strength reduce the objc_retainBlock
|
||||
; to an objc_retain.
|
||||
|
||||
; CHECK: define void @test0_no_metadata(
|
||||
; CHECK-LABEL: define void @test0_no_metadata(
|
||||
; CHECK: call i8* @objc_retain(
|
||||
; CHECK: invoke
|
||||
; CHECK: call void @objc_release(
|
||||
|
@ -5,7 +5,7 @@
|
||||
; in dubious ways.
|
||||
; rdar://10551239
|
||||
|
||||
; CHECK: define void @test0(
|
||||
; CHECK-LABEL: define void @test0(
|
||||
; CHECK: %otherBlock = phi void ()* [ %b1, %if.then ], [ null, %entry ]
|
||||
; CHECK-NEXT: call void @use_fptr(void ()* %otherBlock)
|
||||
; CHECK-NEXT: %tmp11 = bitcast void ()* %otherBlock to i8*
|
||||
|
@ -8,7 +8,7 @@ declare i8* @objc_retainAutoreleasedReturnValue(i8*)
|
||||
|
||||
; Clean up residue left behind after inlining.
|
||||
|
||||
; CHECK: define void @test0(
|
||||
; CHECK-LABEL: define void @test0(
|
||||
; CHECK: entry:
|
||||
; CHECK-NEXT: ret void
|
||||
; CHECK-NEXT: }
|
||||
@ -21,7 +21,7 @@ entry:
|
||||
|
||||
; Same as test0, but with slightly different use arrangements.
|
||||
|
||||
; CHECK: define void @test1(
|
||||
; CHECK-LABEL: define void @test1(
|
||||
; CHECK: entry:
|
||||
; CHECK-NEXT: ret void
|
||||
; CHECK-NEXT: }
|
||||
@ -34,7 +34,7 @@ entry:
|
||||
|
||||
; Delete a retainRV+autoreleaseRV even if the pointer is used.
|
||||
|
||||
; CHECK: define void @test24(
|
||||
; CHECK-LABEL: define void @test24(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: call void @use_pointer(i8* %p)
|
||||
; CHECK-NEXT: ret void
|
||||
|
@ -8,7 +8,7 @@
|
||||
@__block_descriptor_tmp = external hidden constant { i64, i64, i8*, i8*, i8*, i8* }
|
||||
@"\01L_OBJC_SELECTOR_REFERENCES_" = external hidden global i8*, section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip"
|
||||
|
||||
; CHECK: define void @test(
|
||||
; CHECK-LABEL: define void @test(
|
||||
; CHECK: %3 = call i8* @objc_retainBlock(i8* %2) [[NUW:#[0-9]+]]
|
||||
; CHECK: @objc_msgSend
|
||||
; CHECK-NEXT: @objc_release(i8* %3)
|
||||
@ -43,7 +43,7 @@ entry:
|
||||
; Same as test, but the objc_retainBlock has a clang.arc.copy_on_escape
|
||||
; tag so it's safe to delete.
|
||||
|
||||
; CHECK: define void @test_with_COE(
|
||||
; CHECK-LABEL: define void @test_with_COE(
|
||||
; CHECK-NOT: @objc_retainBlock
|
||||
; CHECK: @objc_msgSend
|
||||
; CHECK: @objc_release
|
||||
|
@ -20,7 +20,7 @@ declare i8* @objc_retainBlock(i8*)
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
define void @bitcasttest(i8* %storage, void (...)* %block) {
|
||||
; CHECK: define void @bitcasttest
|
||||
; CHECK-LABEL: define void @bitcasttest(
|
||||
entry:
|
||||
%t1 = bitcast void (...)* %block to i8*
|
||||
; CHECK: tail call i8* @objc_retain
|
||||
@ -37,7 +37,7 @@ entry:
|
||||
}
|
||||
|
||||
define void @bitcasttest_a(i8* %storage, void (...)* %block) {
|
||||
; CHECK: define void @bitcasttest_a
|
||||
; CHECK-LABEL: define void @bitcasttest_a(
|
||||
entry:
|
||||
%t1 = bitcast void (...)* %block to i8*
|
||||
; CHECK-NOT: tail call i8* @objc_retain
|
||||
@ -54,7 +54,7 @@ entry:
|
||||
}
|
||||
|
||||
define void @geptest(void (...)** %storage_array, void (...)* %block) {
|
||||
; CHECK: define void @geptest
|
||||
; CHECK-LABEL: define void @geptest(
|
||||
entry:
|
||||
%t1 = bitcast void (...)* %block to i8*
|
||||
; CHECK: tail call i8* @objc_retain
|
||||
@ -73,7 +73,7 @@ entry:
|
||||
}
|
||||
|
||||
define void @geptest_a(void (...)** %storage_array, void (...)* %block) {
|
||||
; CHECK: define void @geptest_a
|
||||
; CHECK-LABEL: define void @geptest_a(
|
||||
entry:
|
||||
%t1 = bitcast void (...)* %block to i8*
|
||||
; CHECK-NOT: tail call i8* @objc_retain
|
||||
@ -93,7 +93,7 @@ entry:
|
||||
|
||||
define void @selecttest(void (...)** %store1, void (...)** %store2,
|
||||
void (...)* %block) {
|
||||
; CHECK: define void @selecttest
|
||||
; CHECK-LABEL: define void @selecttest(
|
||||
entry:
|
||||
%t1 = bitcast void (...)* %block to i8*
|
||||
; CHECK: tail call i8* @objc_retain
|
||||
@ -111,7 +111,7 @@ entry:
|
||||
|
||||
define void @selecttest_a(void (...)** %store1, void (...)** %store2,
|
||||
void (...)* %block) {
|
||||
; CHECK: define void @selecttest_a
|
||||
; CHECK-LABEL: define void @selecttest_a(
|
||||
entry:
|
||||
%t1 = bitcast void (...)* %block to i8*
|
||||
; CHECK-NOT: tail call i8* @objc_retain
|
||||
@ -130,7 +130,7 @@ entry:
|
||||
define void @phinodetest(void (...)** %storage1,
|
||||
void (...)** %storage2,
|
||||
void (...)* %block) {
|
||||
; CHECK: define void @phinodetest
|
||||
; CHECK-LABEL: define void @phinodetest(
|
||||
entry:
|
||||
%t1 = bitcast void (...)* %block to i8*
|
||||
; CHECK: tail call i8* @objc_retain
|
||||
@ -160,7 +160,7 @@ end:
|
||||
define void @phinodetest_a(void (...)** %storage1,
|
||||
void (...)** %storage2,
|
||||
void (...)* %block) {
|
||||
; CHECK: define void @phinodetest_a
|
||||
; CHECK-LABEL: define void @phinodetest_a(
|
||||
entry:
|
||||
%t1 = bitcast void (...)* %block to i8*
|
||||
; CHECK-NOT: tail call i8* @objc_retain
|
||||
|
@ -26,7 +26,7 @@ declare i8* @returner()
|
||||
; retain is an objc_retainAutoreleasedReturnValue, since it's
|
||||
; better to do the RV optimization.
|
||||
|
||||
; CHECK: define void @test0(
|
||||
; CHECK-LABEL: define void @test0(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: %x = call i8* @returner
|
||||
; CHECK-NEXT: %0 = tail call i8* @objc_retainAutoreleasedReturnValue(i8* %x) [[NUW:#[0-9]+]]
|
||||
@ -54,7 +54,7 @@ return:
|
||||
|
||||
; Delete no-ops.
|
||||
|
||||
; CHECK: define void @test2
|
||||
; CHECK-LABEL: define void @test2(
|
||||
; CHECK-NOT: @objc_
|
||||
; CHECK: }
|
||||
define void @test2() {
|
||||
@ -67,7 +67,7 @@ define void @test2() {
|
||||
; Delete a redundant retainRV,autoreleaseRV when forwaring a call result
|
||||
; directly to a return value.
|
||||
|
||||
; CHECK: define i8* @test3
|
||||
; CHECK-LABEL: define i8* @test3(
|
||||
; CHECK: call i8* @returner()
|
||||
; CHECK-NEXT: ret i8* %call
|
||||
define i8* @test3() {
|
||||
@ -81,7 +81,7 @@ entry:
|
||||
; Delete a redundant retain,autoreleaseRV when forwaring a call result
|
||||
; directly to a return value.
|
||||
|
||||
; CHECK: define i8* @test4
|
||||
; CHECK-LABEL: define i8* @test4(
|
||||
; CHECK: call i8* @returner()
|
||||
; CHECK-NEXT: ret i8* %call
|
||||
define i8* @test4() {
|
||||
@ -114,7 +114,7 @@ entry:
|
||||
; into objc_retainAutoreleasedReturnValueAutoreleaseReturnValue?
|
||||
; Those entrypoints don't exist yet though.
|
||||
|
||||
; CHECK: define i8* @test7(
|
||||
; CHECK-LABEL: define i8* @test7(
|
||||
; CHECK: call i8* @objc_retainAutoreleasedReturnValue(i8* %p)
|
||||
; CHECK: %t = tail call i8* @objc_autoreleaseReturnValue(i8* %p)
|
||||
define i8* @test7() {
|
||||
@ -125,7 +125,7 @@ define i8* @test7() {
|
||||
ret i8* %t
|
||||
}
|
||||
|
||||
; CHECK: define i8* @test7b(
|
||||
; CHECK-LABEL: define i8* @test7b(
|
||||
; CHECK: call i8* @objc_retain(i8* %p)
|
||||
; CHECK: %t = tail call i8* @objc_autoreleaseReturnValue(i8* %p)
|
||||
define i8* @test7b() {
|
||||
@ -188,7 +188,7 @@ define i8* @test12(i8* %p) {
|
||||
|
||||
; Don't zap the objc_retainAutoreleasedReturnValue.
|
||||
|
||||
; CHECK: define i8* @test13(
|
||||
; CHECK-LABEL: define i8* @test13(
|
||||
; CHECK: tail call i8* @objc_retainAutoreleasedReturnValue(i8* %p)
|
||||
; CHECK: call i8* @objc_autorelease(i8* %p)
|
||||
; CHECK: ret i8* %p
|
||||
@ -203,7 +203,7 @@ define i8* @test13() {
|
||||
; Convert objc_retainAutoreleasedReturnValue to objc_retain if its
|
||||
; argument is not a return value.
|
||||
|
||||
; CHECK: define void @test14(
|
||||
; CHECK-LABEL: define void @test14(
|
||||
; CHECK-NEXT: tail call i8* @objc_retain(i8* %p) [[NUW]]
|
||||
; CHECK-NEXT: ret void
|
||||
define void @test14(i8* %p) {
|
||||
@ -214,7 +214,7 @@ define void @test14(i8* %p) {
|
||||
; Don't convert objc_retainAutoreleasedReturnValue to objc_retain if its
|
||||
; argument is a return value.
|
||||
|
||||
; CHECK: define void @test15(
|
||||
; CHECK-LABEL: define void @test15(
|
||||
; CHECK-NEXT: %y = call i8* @returner()
|
||||
; CHECK-NEXT: tail call i8* @objc_retainAutoreleasedReturnValue(i8* %y) [[NUW]]
|
||||
; CHECK-NEXT: ret void
|
||||
@ -272,7 +272,7 @@ define i8* @test22(i8* %p) {
|
||||
|
||||
; Convert autoreleaseRV to autorelease.
|
||||
|
||||
; CHECK: define void @test23(
|
||||
; CHECK-LABEL: define void @test23(
|
||||
; CHECK: call i8* @objc_autorelease(i8* %p) [[NUW]]
|
||||
define void @test23(i8* %p) {
|
||||
store i8 0, i8* %p
|
||||
@ -283,7 +283,7 @@ define void @test23(i8* %p) {
|
||||
; Don't convert autoreleaseRV to autorelease if the result is returned,
|
||||
; even through a bitcast.
|
||||
|
||||
; CHECK: define {}* @test24(
|
||||
; CHECK-LABEL: define {}* @test24(
|
||||
; CHECK: tail call i8* @objc_autoreleaseReturnValue(i8* %p)
|
||||
define {}* @test24(i8* %p) {
|
||||
%t = call i8* @objc_autoreleaseReturnValue(i8* %p)
|
||||
|
@ -3,7 +3,7 @@
|
||||
; Handle a retain+release pair entirely contained within a split loop backedge.
|
||||
; rdar://11256239
|
||||
|
||||
; CHECK: define void @test0
|
||||
; CHECK-LABEL: define void @test0(
|
||||
; CHECK: call i8* @objc_retain(i8* %call) [[NUW:#[0-9]+]]
|
||||
; CHECK: call i8* @objc_retain(i8* %call) [[NUW]]
|
||||
; CHECK: call i8* @objc_retain(i8* %cond) [[NUW]]
|
||||
|
@ -10,7 +10,7 @@ declare void @objc_copyWeak(i8**, i8**)
|
||||
|
||||
; If the pointer-to-weak-pointer is null, it's undefined behavior.
|
||||
|
||||
; CHECK: define void @test0(
|
||||
; CHECK-LABEL: define void @test0(
|
||||
; CHECK: store i8* undef, i8** null
|
||||
; CHECK: store i8* undef, i8** null
|
||||
; CHECK: store i8* undef, i8** null
|
||||
|
@ -16,7 +16,7 @@ F:
|
||||
store atomic i32 123, i32* @G seq_cst, align 4
|
||||
ret i32 0
|
||||
}
|
||||
; CHECK: define i32 @test1
|
||||
; CHECK-LABEL: define i32 @test1(
|
||||
; CHECK-NOT: store
|
||||
; CHECK: ret i32 17
|
||||
|
||||
@ -25,6 +25,6 @@ define i32 @test2() {
|
||||
ret i32 %V
|
||||
}
|
||||
|
||||
; CHECK: define i32 @test2
|
||||
; CHECK-LABEL: define i32 @test2(
|
||||
; CHECK-NOT: load
|
||||
; CHECK: ret i32 222
|
||||
|
@ -6,14 +6,14 @@ define internal i32 @test1a(i32 %A) {
|
||||
%X = add i32 1, 2
|
||||
ret i32 %A
|
||||
}
|
||||
; CHECK: define internal i32 @test1a
|
||||
; CHECK-LABEL: define internal i32 @test1a(
|
||||
; CHECK: ret i32 undef
|
||||
|
||||
define i32 @test1b() {
|
||||
%X = call i32 @test1a( i32 17 )
|
||||
ret i32 %X
|
||||
|
||||
; CHECK: define i32 @test1b
|
||||
; CHECK-LABEL: define i32 @test1b(
|
||||
; CHECK: ret i32 17
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ F:
|
||||
%C.upgrd.1 = call i32 @test2a(i32 1)
|
||||
ret i32 %C.upgrd.1
|
||||
}
|
||||
; CHECK: define internal i32 @test2a
|
||||
; CHECK-LABEL: define internal i32 @test2a(
|
||||
; CHECK-NEXT: br label %T
|
||||
; CHECK: ret i32 undef
|
||||
|
||||
@ -40,7 +40,7 @@ define i32 @test2b() {
|
||||
%X = call i32 @test2a(i32 0)
|
||||
ret i32 %X
|
||||
}
|
||||
; CHECK: define i32 @test2b
|
||||
; CHECK-LABEL: define i32 @test2b(
|
||||
; CHECK-NEXT: %X = call i32 @test2a(i32 0)
|
||||
; CHECK-NEXT: ret i32 0
|
||||
|
||||
@ -54,7 +54,7 @@ define void @test3a() {
|
||||
store i32 %X, i32* @G
|
||||
ret void
|
||||
}
|
||||
; CHECK: define void @test3a
|
||||
; CHECK-LABEL: define void @test3a(
|
||||
; CHECK-NEXT: ret void
|
||||
|
||||
|
||||
@ -69,7 +69,7 @@ F:
|
||||
store i32 123, i32* @G
|
||||
ret i32 0
|
||||
}
|
||||
; CHECK: define i32 @test3b
|
||||
; CHECK-LABEL: define i32 @test3b(
|
||||
; CHECK-NOT: store
|
||||
; CHECK: ret i32 0
|
||||
|
||||
@ -102,7 +102,7 @@ B:
|
||||
define internal i64 @test4c(i64 %a) {
|
||||
ret i64 %a
|
||||
}
|
||||
; CHECK: define internal i64 @test4c
|
||||
; CHECK-LABEL: define internal i64 @test4c(
|
||||
; CHECK: ret i64 undef
|
||||
|
||||
|
||||
@ -149,7 +149,7 @@ define i64 @test6b() {
|
||||
%a = call i64 @test6a()
|
||||
ret i64 %a
|
||||
}
|
||||
; CHECK: define i64 @test6b
|
||||
; CHECK-LABEL: define i64 @test6b(
|
||||
; CHECK: ret i64 0
|
||||
|
||||
;;======================== test7
|
||||
@ -172,7 +172,7 @@ define i32 @test7b() {
|
||||
%Y = extractvalue %T %X, 0
|
||||
%Z = add i32 %Y, %Y
|
||||
ret i32 %Z
|
||||
; CHECK: define i32 @test7b
|
||||
; CHECK-LABEL: define i32 @test7b(
|
||||
; CHECK-NEXT: call %T @test7a(i32 17)
|
||||
; CHECK-NEXT: ret i32 36
|
||||
}
|
||||
@ -191,7 +191,7 @@ define internal {} @test8a(i32 %A, i32* %P) {
|
||||
define void @test8b(i32* %P) {
|
||||
%X = call {} @test8a(i32 5, i32* %P)
|
||||
ret void
|
||||
; CHECK: define void @test8b
|
||||
; CHECK-LABEL: define void @test8b(
|
||||
; CHECK-NEXT: call {} @test8a
|
||||
; CHECK-NEXT: ret void
|
||||
}
|
||||
@ -216,7 +216,7 @@ define i32 @test10a() nounwind {
|
||||
entry:
|
||||
%call = call i32 @test10b(i32 undef)
|
||||
ret i32 %call
|
||||
; CHECK: define i32 @test10a
|
||||
; CHECK-LABEL: define i32 @test10a(
|
||||
; CHECK: ret i32 0
|
||||
}
|
||||
|
||||
@ -224,6 +224,6 @@ define internal i32 @test10b(i32 %x) nounwind {
|
||||
entry:
|
||||
%r = and i32 %x, 1
|
||||
ret i32 %r
|
||||
; CHECK: define internal i32 @test10b
|
||||
; CHECK-LABEL: define internal i32 @test10b(
|
||||
; CHECK: ret i32 undef
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
; with no cases.
|
||||
declare void @foo()
|
||||
define void @test1() {
|
||||
; CHECK: define void @test1
|
||||
; CHECK-LABEL: define void @test1(
|
||||
; CHECK: call void @foo()
|
||||
switch i32 undef, label %d []
|
||||
d:
|
||||
|
@ -36,5 +36,5 @@ unwind: ; preds = %then
|
||||
unreachable
|
||||
}
|
||||
|
||||
; CHECK: define void @odd_fn
|
||||
; CHECK-LABEL: define void @odd_fn(
|
||||
; CHECK: %storemerge.in = phi i32* [ %retptr2, %else ], [ %retptr1, %then ]
|
||||
|
@ -6,7 +6,7 @@ target triple = "x86_64-apple-darwin10"
|
||||
|
||||
%struct.anon = type { [1 x float] }
|
||||
|
||||
; CHECK: define void @Test(
|
||||
; CHECK-LABEL: define void @Test(
|
||||
; CHECK: load float addrspace(2)*
|
||||
; CHECK-NEXT: fsub float
|
||||
; CHECK: store float {{.*}}, float addrspace(2)*
|
||||
|
@ -6,7 +6,7 @@ target triple = "thumbv7-apple-darwin10.0.0"
|
||||
%struct.Vector4 = type { float, float, float, float }
|
||||
@f.vector = internal constant %struct.Vector4 { float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00 }, align 16
|
||||
|
||||
; CHECK: define void @f
|
||||
; CHECK-LABEL: define void @f(
|
||||
; CHECK-NOT: alloca
|
||||
; CHECK: phi <4 x float>
|
||||
|
||||
|
@ -263,7 +263,7 @@ if.else: br label %if.end
|
||||
if.end:
|
||||
%dirent_type.0 = phi i32 [ 3, %sw.default ], [ 6, %sw.bb3 ], [ 5, %sw.bb2 ], [ 0, %sw.bb1 ], [ 3, %sw.bb ], [ 0, %if.else ]
|
||||
ret i32 %dirent_type.0
|
||||
; CHECK: define i32 @overflow
|
||||
; CHECK-LABEL: define i32 @overflow(
|
||||
; CHECK: switch
|
||||
; CHECK: phi
|
||||
}
|
||||
@ -284,7 +284,7 @@ bb2: br label %bb3
|
||||
bb3:
|
||||
%tmp4 = phi i1 [ undef, %bb ], [ false, %bb2 ], [ true, %bb1 ]
|
||||
ret i1 %tmp4
|
||||
; CHECK: define i1 @undef
|
||||
; CHECK-LABEL: define i1 @undef(
|
||||
; CHECK: %switch.cast = trunc i32 %switch.tableidx to i9
|
||||
; CHECK: %switch.downshift = lshr i9 3, %switch.shiftamt
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
declare void @foo() nounwind uwtable
|
||||
|
||||
define void @func(i32 %A) nounwind uwtable {
|
||||
; CHECK: define void @func
|
||||
; CHECK-LABEL: define void @func(
|
||||
entry:
|
||||
%cmp11 = icmp eq i32 %A, 1
|
||||
br i1 %cmp11, label %if.then, label %if.else, !prof !0
|
||||
|
@ -2,7 +2,7 @@
|
||||
; PR7328
|
||||
; PR7506
|
||||
define i32 @foo(i32 %x) {
|
||||
; CHECK: define i32 @foo
|
||||
; CHECK-LABEL: define i32 @foo(
|
||||
; CHECK: %accumulator.tr = phi i32 [ 1, %entry ], [ 0, %body ]
|
||||
entry:
|
||||
%cond = icmp ugt i32 %x, 0 ; <i1> [#uses=1]
|
||||
|
@ -13,7 +13,7 @@ else: ; preds = %entry
|
||||
ret i32 1
|
||||
}
|
||||
|
||||
; CHECK: define i32 @test1_factorial
|
||||
; CHECK-LABEL: define i32 @test1_factorial(
|
||||
; CHECK: phi i32
|
||||
; CHECK-NOT: call i32
|
||||
; CHECK: else:
|
||||
@ -34,7 +34,7 @@ return: ; preds = %entry
|
||||
ret i32 %x
|
||||
}
|
||||
|
||||
; CHECK: define i32 @test2_mul
|
||||
; CHECK-LABEL: define i32 @test2_mul(
|
||||
; CHECK: phi i32
|
||||
; CHECK-NOT: call i32
|
||||
; CHECK: return:
|
||||
|
@ -14,7 +14,7 @@ entry:
|
||||
|
||||
; Do turn other calls into infinite loops though.
|
||||
|
||||
; CHECK: define double @foo
|
||||
; CHECK-LABEL: define double @foo(
|
||||
; CHECK-NOT: call
|
||||
; CHECK: }
|
||||
define double @foo(double %f) {
|
||||
@ -22,7 +22,7 @@ define double @foo(double %f) {
|
||||
ret double %t
|
||||
}
|
||||
|
||||
; CHECK: define float @fabsf
|
||||
; CHECK-LABEL: define float @fabsf(
|
||||
; CHECK-NOT: call
|
||||
; CHECK: }
|
||||
define float @fabsf(float %f) {
|
||||
|
Loading…
Reference in New Issue
Block a user