diff options
Diffstat (limited to 'test/Transforms/InstCombine')
179 files changed, 2277 insertions, 1411 deletions
diff --git a/test/Transforms/InstCombine/2007-01-27-AndICmp.ll b/test/Transforms/InstCombine/2007-01-27-AndICmp.ll index 4d1b982..6298a07 100644 --- a/test/Transforms/InstCombine/2007-01-27-AndICmp.ll +++ b/test/Transforms/InstCombine/2007-01-27-AndICmp.ll @@ -1,8 +1,8 @@ ; RUN: opt < %s -instcombine -S | grep "ugt.*, 1" define i1 @test(i32 %tmp1030) { - %tmp1037 = icmp ne i32 %tmp1030, 40 ; <i1> [#uses=1] - %tmp1039 = icmp ne i32 %tmp1030, 41 ; <i1> [#uses=1] + %tmp1037 = icmp ne i32 %tmp1030, 39 ; <i1> [#uses=1] + %tmp1039 = icmp ne i32 %tmp1030, 40 ; <i1> [#uses=1] %tmp1042 = and i1 %tmp1037, %tmp1039 ; <i1> [#uses=1] ret i1 %tmp1042 } diff --git a/test/Transforms/InstCombine/2008-01-06-BitCastAttributes.ll b/test/Transforms/InstCombine/2008-01-06-BitCastAttributes.ll index 23b6067..22c0782 100644 --- a/test/Transforms/InstCombine/2008-01-06-BitCastAttributes.ll +++ b/test/Transforms/InstCombine/2008-01-06-BitCastAttributes.ll @@ -1,23 +1,30 @@ ; Ignore stderr, we expect warnings there -; RUN: opt < %s -instcombine 2> /dev/null -S | not grep bitcast +; RUN: opt < %s -instcombine 2> /dev/null -S | FileCheck %s + +; CHECK-NOT: bitcast define void @a() { - ret void + ret void } define signext i32 @b(i32* inreg %x) { - ret i32 0 + ret i32 0 } define void @c(...) { - ret void + ret void } define void @g(i32* %y) { - call void bitcast (void ()* @a to void (i32*)*)( i32* noalias %y ) - call <2 x i32> bitcast (i32 (i32*)* @b to <2 x i32> (i32*)*)( i32* inreg null ) ; <<2 x i32>>:1 [#uses=0] +; CHECK-LABEL: @g( +; CHECK: call i64 bitcast (i32 (i32*)* @b to i64 (i32)*)(i32 0) %x = call i64 bitcast (i32 (i32*)* @b to i64 (i32)*)( i32 0 ) ; <i64> [#uses=0] - call void bitcast (void (...)* @c to void (i32)*)( i32 0 ) - call void bitcast (void (...)* @c to void (i32)*)( i32 zeroext 0 ) - ret void + +; The rest should not have bitcasts remaining +; CHECK-NOT: bitcast + call void bitcast (void ()* @a to void (i32*)*)( i32* noalias %y ) + call <2 x i32> bitcast (i32 (i32*)* @b to <2 x i32> (i32*)*)( i32* inreg null ) ; <<2 x i32>>:1 [#uses=0] + call void bitcast (void (...)* @c to void (i32)*)( i32 0 ) + call void bitcast (void (...)* @c to void (i32)*)( i32 zeroext 0 ) + ret void } diff --git a/test/Transforms/InstCombine/2008-01-06-VoidCast.ll b/test/Transforms/InstCombine/2008-01-06-VoidCast.ll index 407ff4d..5dcaa38 100644 --- a/test/Transforms/InstCombine/2008-01-06-VoidCast.ll +++ b/test/Transforms/InstCombine/2008-01-06-VoidCast.ll @@ -1,10 +1,12 @@ -; RUN: opt < %s -instcombine -S | not grep bitcast +; RUN: opt < %s -instcombine -S | FileCheck %s define void @f(i16 %y) { - ret void + ret void } define i32 @g(i32 %y) { - %x = call i32 bitcast (void (i16)* @f to i32 (i32)*)( i32 %y ) ; <i32> [#uses=1] - ret i32 %x +; CHECK-LABEL: @g( +; CHECK: call i32 bitcast + %x = call i32 bitcast (void (i16)* @f to i32 (i32)*)( i32 %y ) ; <i32> [#uses=1] + ret i32 %x } diff --git a/test/Transforms/InstCombine/2008-11-20-DivMulRem.ll b/test/Transforms/InstCombine/2008-11-20-DivMulRem.ll index 43af190..0c0e55a 100644 --- a/test/Transforms/InstCombine/2008-11-20-DivMulRem.ll +++ b/test/Transforms/InstCombine/2008-11-20-DivMulRem.ll @@ -2,7 +2,7 @@ ; PR3103 define i8 @test1(i8 %x, i8 %y) { -; CHECK: @test1 +; CHECK-LABEL: @test1( %A = udiv i8 %x, %y ; CHECK-NEXT: urem %B = mul i8 %A, %y @@ -12,7 +12,7 @@ define i8 @test1(i8 %x, i8 %y) { } define i8 @test2(i8 %x, i8 %y) { -; CHECK: @test2 +; CHECK-LABEL: @test2( %A = sdiv i8 %x, %y ; CHECK-NEXT: srem %B = mul i8 %A, %y @@ -22,7 +22,7 @@ define i8 @test2(i8 %x, i8 %y) { } define i8 @test3(i8 %x, i8 %y) { -; CHECK: @test3 +; CHECK-LABEL: @test3( %A = udiv i8 %x, %y ; CHECK-NEXT: urem %B = mul i8 %A, %y @@ -33,7 +33,7 @@ define i8 @test3(i8 %x, i8 %y) { } define i8 @test4(i8 %x) { -; CHECK: @test4 +; CHECK-LABEL: @test4( %A = udiv i8 %x, 3 ; CHECK-NEXT: urem %B = mul i8 %A, -3 @@ -45,7 +45,7 @@ define i8 @test4(i8 %x) { } define i32 @test5(i32 %x, i32 %y) { -; CHECK: @test5 +; CHECK-LABEL: @test5( ; (((X / Y) * Y) / Y) -> X / Y %div = sdiv i32 %x, %y ; CHECK-NEXT: sdiv @@ -56,7 +56,7 @@ define i32 @test5(i32 %x, i32 %y) { } define i32 @test6(i32 %x, i32 %y) { -; CHECK: @test6 +; CHECK-LABEL: @test6( ; (((X / Y) * Y) / Y) -> X / Y %div = udiv i32 %x, %y ; CHECK-NEXT: udiv diff --git a/test/Transforms/InstCombine/2010-03-03-ExtElim.ll b/test/Transforms/InstCombine/2010-03-03-ExtElim.ll index bb3159e..b1384ec 100644 --- a/test/Transforms/InstCombine/2010-03-03-ExtElim.ll +++ b/test/Transforms/InstCombine/2010-03-03-ExtElim.ll @@ -1,5 +1,4 @@ ; RUN: opt -instcombine -S < %s | FileCheck %s -; PR6486 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:32:32-n8:16:32" target triple = "i386-unknown-linux-gnu" @@ -7,8 +6,8 @@ target triple = "i386-unknown-linux-gnu" @g_92 = common global [2 x i32*] zeroinitializer, align 4 ; <[2 x i32*]*> [#uses=1] @g_177 = constant i32** bitcast (i8* getelementptr (i8* bitcast ([2 x i32*]* @g_92 to i8*), i64 4) to i32**), align 4 ; <i32***> [#uses=1] -define i1 @test() nounwind { -; CHECK: @test +define i1 @PR6486() nounwind { +; CHECK-LABEL: @PR6486( %tmp = load i32*** @g_177 ; <i32**> [#uses=1] %cmp = icmp ne i32** null, %tmp ; <i1> [#uses=1] %conv = zext i1 %cmp to i32 ; <i32> [#uses=1] @@ -16,3 +15,18 @@ define i1 @test() nounwind { ret i1 %cmp1 ; CHECK: ret i1 true } + +@d = common global i32 0, align 4 +@a = common global [1 x i32] zeroinitializer, align 4 + +define i1 @PR16462_1() nounwind { +; CHECK-LABEL: @PR16462_1( + ret i1 icmp sgt (i32 sext (i16 trunc (i32 select (i1 icmp eq (i32* getelementptr inbounds ([1 x i32]* @a, i32 0, i32 0), i32* @d), i32 0, i32 1) to i16) to i32), i32 65535) +; CHECK: ret i1 icmp sgt (i32 sext (i16 trunc (i32 select (i1 icmp eq (i32* getelementptr inbounds ([1 x i32]* @a, i32 0, i32 0), i32* @d), i32 0, i32 1) to i16) to i32), i32 65535) +} + +define i1 @PR16462_2() nounwind { +; CHECK-LABEL: @PR16462_2( + ret i1 icmp sgt (i32 sext (i16 trunc (i32 select (i1 icmp eq (i32* getelementptr inbounds ([1 x i32]* @a, i32 0, i32 0), i32* @d), i32 0, i32 1) to i16) to i32), i32 42) +; CHECK: ret i1 icmp sgt (i16 trunc (i32 select (i1 icmp eq (i32* getelementptr inbounds ([1 x i32]* @a, i32 0, i32 0), i32* @d), i32 0, i32 1) to i16), i16 42) +} diff --git a/test/Transforms/InstCombine/2010-11-01-lshr-mask.ll b/test/Transforms/InstCombine/2010-11-01-lshr-mask.ll index 8001621..1549c0d 100644 --- a/test/Transforms/InstCombine/2010-11-01-lshr-mask.ll +++ b/test/Transforms/InstCombine/2010-11-01-lshr-mask.ll @@ -1,7 +1,7 @@ ; RUN: opt -instcombine -S < %s | FileCheck %s ; <rdar://problem/8606771> -; CHECK: @main +; CHECK-LABEL: @main( define i32 @main(i32 %argc) nounwind ssp { entry: %tmp3151 = trunc i32 %argc to i8 @@ -23,7 +23,7 @@ entry: } ; rdar://8739316 -; CHECK: @foo +; CHECK-LABEL: @foo( define i8 @foo(i8 %arg, i8 %arg1) nounwind { bb: %tmp = shl i8 %arg, 7 diff --git a/test/Transforms/InstCombine/2010-11-21-SizeZeroTypeGEP.ll b/test/Transforms/InstCombine/2010-11-21-SizeZeroTypeGEP.ll index 720365c..80983ef 100644 --- a/test/Transforms/InstCombine/2010-11-21-SizeZeroTypeGEP.ll +++ b/test/Transforms/InstCombine/2010-11-21-SizeZeroTypeGEP.ll @@ -3,14 +3,14 @@ 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" define {}* @foo({}* %x, i32 %n) { -; CHECK: @foo +; CHECK-LABEL: @foo( ; CHECK-NOT: getelementptr %p = getelementptr {}* %x, i32 %n ret {}* %p } define i8* @bar(i64 %n, {{}, [0 x {[0 x i8]}]}* %p) { -; CHECK: @bar +; CHECK-LABEL: @bar( %g = getelementptr {{}, [0 x {[0 x i8]}]}* %p, i64 %n, i32 1, i64 %n, i32 0, i64 %n ; CHECK: %p, i64 0, i32 1, i64 0, i32 0, i64 %n ret i8* %g diff --git a/test/Transforms/InstCombine/2010-11-23-Distributed.ll b/test/Transforms/InstCombine/2010-11-23-Distributed.ll index 4f8e8dc..20bfed8 100644 --- a/test/Transforms/InstCombine/2010-11-23-Distributed.ll +++ b/test/Transforms/InstCombine/2010-11-23-Distributed.ll @@ -1,6 +1,6 @@ ; RUN: opt < %s -instcombine -S | FileCheck %s define i32 @foo(i32 %x, i32 %y) { -; CHECK: @foo +; CHECK-LABEL: @foo( %add = add nsw i32 %y, %x %mul = mul nsw i32 %add, %y %square = mul nsw i32 %y, %y @@ -11,7 +11,7 @@ define i32 @foo(i32 %x, i32 %y) { } define i1 @bar(i64 %x, i64 %y) { -; CHECK: @bar +; CHECK-LABEL: @bar( %a = and i64 %y, %x ; CHECK: and ; CHECK-NOT: and diff --git a/test/Transforms/InstCombine/2011-06-13-nsw-alloca.ll b/test/Transforms/InstCombine/2011-06-13-nsw-alloca.ll index fedb46d..a75a465 100644 --- a/test/Transforms/InstCombine/2011-06-13-nsw-alloca.ll +++ b/test/Transforms/InstCombine/2011-06-13-nsw-alloca.ll @@ -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 diff --git a/test/Transforms/InstCombine/2012-03-10-InstCombine.ll b/test/Transforms/InstCombine/2012-03-10-InstCombine.ll index 58ccf12..d1860bc 100644 --- a/test/Transforms/InstCombine/2012-03-10-InstCombine.ll +++ b/test/Transforms/InstCombine/2012-03-10-InstCombine.ll @@ -2,7 +2,7 @@ ; Derived from gcc.c-torture/execute/frame-address.c -; CHECK: @func +; CHECK-LABEL: @func( ; CHECK: return: ; CHECK-NOT: ret i32 0 ; CHECK: ret i32 %retval diff --git a/test/Transforms/InstCombine/2012-04-24-vselect.ll b/test/Transforms/InstCombine/2012-04-24-vselect.ll index 8d2de2b..211d401 100644 --- a/test/Transforms/InstCombine/2012-04-24-vselect.ll +++ b/test/Transforms/InstCombine/2012-04-24-vselect.ll @@ -1,6 +1,6 @@ ; RUN: opt -instcombine -S < %s | FileCheck %s -; CHECK: @foo +; CHECK-LABEL: @foo( ; CHECK: <i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0> define <8 x i32> @foo() nounwind { diff --git a/test/Transforms/InstCombine/2012-05-28-select-hang.ll b/test/Transforms/InstCombine/2012-05-28-select-hang.ll index c580bac..db1dbd5 100644 --- a/test/Transforms/InstCombine/2012-05-28-select-hang.ll +++ b/test/Transforms/InstCombine/2012-05-28-select-hang.ll @@ -34,6 +34,6 @@ land.end: ; preds = %land.rhs, %entry store i8 %conv9, i8* @a, align 1 ret void -; CHECK: @func +; CHECK-LABEL: @func( ; CHECK-NOT: select } diff --git a/test/Transforms/InstCombine/2012-08-28-udiv_ashl.ll b/test/Transforms/InstCombine/2012-08-28-udiv_ashl.ll index 4efaf8c..0374bd5 100644 --- a/test/Transforms/InstCombine/2012-08-28-udiv_ashl.ll +++ b/test/Transforms/InstCombine/2012-08-28-udiv_ashl.ll @@ -5,7 +5,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-S128" target triple = "x86_64-apple-macosx10.8.0" -; CHECK: @udiv400 +; CHECK-LABEL: @udiv400( ; CHECK: udiv i32 %x, 400 ; CHECK: ret define i32 @udiv400(i32 %x) { @@ -16,7 +16,7 @@ entry: } -; CHECK: @udiv400_no +; CHECK-LABEL: @udiv400_no( ; CHECK: ashr ; CHECK: div ; CHECK: ret @@ -27,7 +27,7 @@ entry: ret i32 %div1 } -; CHECK: @sdiv400_yes +; CHECK-LABEL: @sdiv400_yes( ; CHECK: udiv i32 %x, 400 ; CHECK: ret define i32 @sdiv400_yes(i32 %x) { @@ -41,7 +41,7 @@ entry: } -; CHECK: @udiv_i80 +; CHECK-LABEL: @udiv_i80( ; CHECK: udiv i80 %x, 400 ; CHECK: ret define i80 @udiv_i80(i80 %x) { diff --git a/test/Transforms/InstCombine/2012-09-17-ZeroSizedAlloca.ll b/test/Transforms/InstCombine/2012-09-17-ZeroSizedAlloca.ll index ba025e9..7015725 100644 --- a/test/Transforms/InstCombine/2012-09-17-ZeroSizedAlloca.ll +++ b/test/Transforms/InstCombine/2012-09-17-ZeroSizedAlloca.ll @@ -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-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-S128" target triple = "x86_64-apple-macosx10.8.0" -; CHECK: @f +; CHECK-LABEL: @f( ; CHECK-NEXT: alloca [0 x i8], align 1024 ; CHECK-NOT: alloca ; CHECK: ret void diff --git a/test/Transforms/InstCombine/2012-09-24-MemcpyFromGlobalCrash.ll b/test/Transforms/InstCombine/2012-09-24-MemcpyFromGlobalCrash.ll index 4cd60b4..35b6285 100644 --- a/test/Transforms/InstCombine/2012-09-24-MemcpyFromGlobalCrash.ll +++ b/test/Transforms/InstCombine/2012-09-24-MemcpyFromGlobalCrash.ll @@ -8,7 +8,7 @@ declare void @bar(i8*) declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind define void @test() { -; CHECK: @test +; CHECK-LABEL: @test( ; CHECK: llvm.memcpy ; CHECK: ret void %A = alloca [100 x i8] diff --git a/test/Transforms/InstCombine/2012-3-15-or-xor-constant.ll b/test/Transforms/InstCombine/2012-3-15-or-xor-constant.ll index c1602da..466629c 100644 --- a/test/Transforms/InstCombine/2012-3-15-or-xor-constant.ll +++ b/test/Transforms/InstCombine/2012-3-15-or-xor-constant.ll @@ -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( diff --git a/test/Transforms/InstCombine/2013-03-05-Combine-BitcastTy-Into-Alloca.ll b/test/Transforms/InstCombine/2013-03-05-Combine-BitcastTy-Into-Alloca.ll index b20c3a0..789e317 100644 --- a/test/Transforms/InstCombine/2013-03-05-Combine-BitcastTy-Into-Alloca.ll +++ b/test/Transforms/InstCombine/2013-03-05-Combine-BitcastTy-Into-Alloca.ll @@ -10,7 +10,7 @@ target triple = "x86_64-apple-macosx10.9.0" ; allocation of an i96 because of the bitcast to create %2. That's not valid, ; as the other 32 bits of the structure still feed into the return value define { i64, i64 } @function(i32 %x, i32 %y, i32 %z) nounwind { -; CHECK: @function +; CHECK-LABEL: @function( ; CHECK-NEXT: entry: ; CHECK-NEXT: %retval = alloca %struct._my_struct, align 8 ; CHECK-NOT: bitcast i96* %retval to %struct._my_struct* diff --git a/test/Transforms/InstCombine/ExtractCast.ll b/test/Transforms/InstCombine/ExtractCast.ll index 5ebbefd..9a8872f 100644 --- a/test/Transforms/InstCombine/ExtractCast.ll +++ b/test/Transforms/InstCombine/ExtractCast.ll @@ -1,6 +1,6 @@ ; RUN: opt < %s -instcombine -S -o - | FileCheck %s -; CHECK: @a +; CHECK-LABEL: @a( define i32 @a(<4 x i64> %I) { entry: ; CHECK-NOT: trunc <4 x i64> @@ -13,7 +13,7 @@ entry: } -; CHECK: @b +; CHECK-LABEL: @b( define i32 @b(<4 x float> %I) { entry: ; CHECK-NOT: fptosi <4 x float> diff --git a/test/Transforms/InstCombine/LandingPadClauses.ll b/test/Transforms/InstCombine/LandingPadClauses.ll index de3b2d3..10af4bc 100644 --- a/test/Transforms/InstCombine/LandingPadClauses.ll +++ b/test/Transforms/InstCombine/LandingPadClauses.ll @@ -11,7 +11,7 @@ declare i32 @__objc_personality_v0(i32, i64, i8*, i8*) declare void @bar() define void @foo_generic() { -; CHECK: @foo_generic +; CHECK-LABEL: @foo_generic( invoke void @bar() to label %cont.a unwind label %lpad.a cont.a: @@ -131,7 +131,7 @@ lpad.i: } define void @foo_cxx() { -; CHECK: @foo_cxx +; CHECK-LABEL: @foo_cxx( invoke void @bar() to label %cont.a unwind label %lpad.a cont.a: @@ -182,7 +182,7 @@ lpad.d: } define void @foo_objc() { -; CHECK: @foo_objc +; CHECK-LABEL: @foo_objc( invoke void @bar() to label %cont.a unwind label %lpad.a cont.a: diff --git a/test/Transforms/InstCombine/abs-1.ll b/test/Transforms/InstCombine/abs-1.ll index 807f238..2c223ed 100644 --- a/test/Transforms/InstCombine/abs-1.ll +++ b/test/Transforms/InstCombine/abs-1.ll @@ -11,7 +11,7 @@ declare i64 @llabs(i64) ; Check abs(x) -> x >s -1 ? x : -x. define i32 @test_simplify1(i32 %x) { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %ret = call i32 @abs(i32 %x) ; CHECK-NEXT: [[ISPOS:%[a-z0-9]+]] = icmp sgt i32 %x, -1 ; CHECK-NEXT: [[NEG:%[a-z0-9]+]] = sub i32 0, %x @@ -21,7 +21,7 @@ define i32 @test_simplify1(i32 %x) { } define i64 @test_simplify2(i64 %x) { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( %ret = call i64 @labs(i64 %x) ; CHECK-NEXT: [[ISPOS:%[a-z0-9]+]] = icmp sgt i64 %x, -1 ; CHECK-NEXT: [[NEG:%[a-z0-9]+]] = sub i64 0, %x @@ -31,7 +31,7 @@ define i64 @test_simplify2(i64 %x) { } define i64 @test_simplify3(i64 %x) { -; CHECK: @test_simplify3 +; CHECK-LABEL: @test_simplify3( %ret = call i64 @llabs(i64 %x) ; CHECK-NEXT: [[ISPOS:%[a-z0-9]+]] = icmp sgt i64 %x, -1 ; CHECK-NEXT: [[NEG:%[a-z0-9]+]] = sub i64 0, %x diff --git a/test/Transforms/InstCombine/add2.ll b/test/Transforms/InstCombine/add2.ll index c5109c5..0964bc0 100644 --- a/test/Transforms/InstCombine/add2.ll +++ b/test/Transforms/InstCombine/add2.ll @@ -6,7 +6,7 @@ define i64 @test1(i64 %A, i32 %B) { %tmp5 = add i64 %tmp3, %A %tmp6 = and i64 %tmp5, 123 ret i64 %tmp6 -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK-NEXT: and i64 %A, 123 ; CHECK-NEXT: ret i64 } @@ -16,7 +16,7 @@ define i32 @test2(i32 %A) { %C = and i32 %A, 32 %F = add i32 %B, %C ret i32 %F -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK-NEXT: and i32 %A, 39 ; CHECK-NEXT: ret i32 } @@ -26,7 +26,7 @@ define i32 @test3(i32 %A) { %C = lshr i32 %A, 30 %F = add i32 %B, %C ret i32 %F -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK-NEXT: and ; CHECK-NEXT: lshr ; CHECK-NEXT: or i32 %B, %C @@ -36,7 +36,7 @@ define i32 @test3(i32 %A) { define i32 @test4(i32 %A) { %B = add nuw i32 %A, %A ret i32 %B -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK-NEXT: %B = shl nuw i32 %A, 1 ; CHECK-NEXT: ret i32 %B } diff --git a/test/Transforms/InstCombine/add4.ll b/test/Transforms/InstCombine/add4.ll index 1047e16..208c7f0 100644 --- a/test/Transforms/InstCombine/add4.ll +++ b/test/Transforms/InstCombine/add4.ll @@ -1,22 +1,39 @@ ; RUN: opt < %s -instcombine -S | FileCheck %s -;; Target triple for gep raising case below. -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" -target triple = "i686-apple-darwin8" - define float @test1(float %A, float %B, i1 %C) { EntryBlock: + ;; A*(1 - uitofp i1 C) -> select C, 0, A + %cf = uitofp i1 %C to float + %mc = fsub float 1.000000e+00, %cf + %p1 = fmul fast float %A, %mc + ret float %p1 +; CHECK-LABEL: @test1( +; CHECK: select i1 %C, float -0.000000e+00, float %A +} + +define float @test2(float %A, float %B, i1 %C) { +EntryBlock: + ;; B*(uitofp i1 C) -> select C, B, 0 + %cf = uitofp i1 %C to float + %p2 = fmul fast float %B, %cf + ret float %p2 +; CHECK-LABEL: @test2( +; CHECK: select i1 %C, float %B, float -0.000000e+00 +} + +define float @test3(float %A, float %B, i1 %C) { +EntryBlock: ;; select C, 0, B + select C, A, 0 -> select C, A, B %cf = uitofp i1 %C to float %s1 = select i1 %C, float 0.000000e+00, float %B %s2 = select i1 %C, float %A, float 0.000000e+00 %sum = fadd fast float %s1, %s2 ret float %sum -; CHECK: @test1 +; CHECK-LABEL: @test3( ; CHECK: select i1 %C, float %A, float %B } -define float @test2(float %A, float %B, i1 %C) { +define float @test4(float %A, float %B, i1 %C) { EntryBlock: ;; B*(uitofp i1 C) + A*(1 - uitofp i1 C) -> select C, A, B %cf = uitofp i1 %C to float @@ -25,11 +42,11 @@ EntryBlock: %p2 = fmul fast float %B, %cf %s1 = fadd fast float %p2, %p1 ret float %s1 -; CHECK: @test2 +; CHECK-LABEL: @test4( ; CHECK: select i1 %C, float %B, float %A } -define float @test3(float %A, float %B, i1 %C) { +define float @test5(float %A, float %B, i1 %C) { EntryBlock: ;; A*(1 - uitofp i1 C) + B*(uitofp i1 C) -> select C, A, B %cf = uitofp i1 %C to float @@ -38,7 +55,25 @@ EntryBlock: %p2 = fmul fast float %B, %cf %s1 = fadd fast float %p1, %p2 ret float %s1 -; CHECK: @test3 +; CHECK-LABEL: @test5( ; CHECK: select i1 %C, float %B, float %A } +; PR15952 +define float @test6(float %A, float %B, i32 %C) { + %cf = uitofp i32 %C to float + %mc = fsub float 1.000000e+00, %cf + %p1 = fmul fast float %A, %mc + ret float %p1 +; CHECK-LABEL: @test6( +; CHECK: uitofp +} + +define float @test7(float %A, float %B, i32 %C) { + %cf = uitofp i32 %C to float + %p2 = fmul fast float %B, %cf + ret float %p2 +; CHECK-LABEL: @test7( +; CHECK: uitofp +} + diff --git a/test/Transforms/InstCombine/align-addr.ll b/test/Transforms/InstCombine/align-addr.ll index 4ea1bd9..e33ee9f 100644 --- a/test/Transforms/InstCombine/align-addr.ll +++ b/test/Transforms/InstCombine/align-addr.ll @@ -4,7 +4,7 @@ target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:1 ; Instcombine should be able to prove vector alignment in the ; presence of a few mild address computation tricks. -; CHECK: @test0( +; CHECK-LABEL: @test0( ; CHECK: align 16 define void @test0(i8* %b, i64 %n, i64 %u, i64 %y) nounwind { @@ -35,7 +35,7 @@ return: ; When we see a unaligned load from an insufficiently aligned global or ; alloca, increase the alignment of the load, turning it into an aligned load. -; CHECK: @test1( +; CHECK-LABEL: @test1( ; CHECK: tmp = load ; CHECK: GLOBAL{{.*}}align 16 @@ -49,7 +49,7 @@ entry: ; When a load or store lacks an explicit alignment, add one. -; CHECK: @test2( +; CHECK-LABEL: @test2( ; CHECK: load double* %p, align 8 ; CHECK: store double %n, double* %p, align 8 @@ -67,7 +67,7 @@ declare void @use(i8*) define void @test3(%struct.s* sret %a4) { ; Check that the alignment is bumped up the alignment of the sret type. -; CHECK: @test3 +; CHECK-LABEL: @test3( %a4.cast = bitcast %struct.s* %a4 to i8* call void @llvm.memset.p0i8.i64(i8* %a4.cast, i8 0, i64 16, i32 1, i1 false) ; CHECK: call void @llvm.memset.p0i8.i64(i8* %a4.cast, i8 0, i64 16, i32 4, i1 false) diff --git a/test/Transforms/InstCombine/align-external.ll b/test/Transforms/InstCombine/align-external.ll index c3ef2db..66ff9c1 100644 --- a/test/Transforms/InstCombine/align-external.ll +++ b/test/Transforms/InstCombine/align-external.ll @@ -22,7 +22,7 @@ define i64 @foo(i64 %a) { } define i32 @bar() { -; CHECK: @bar +; CHECK-LABEL: @bar( %r = load i32* @B, align 1 ; CHECK: align 1 ret i32 %r diff --git a/test/Transforms/InstCombine/alloca.ll b/test/Transforms/InstCombine/alloca.ll index 68a671c..9a80ad9 100644 --- a/test/Transforms/InstCombine/alloca.ll +++ b/test/Transforms/InstCombine/alloca.ll @@ -8,7 +8,7 @@ declare void @use(...) @int = global i32 zeroinitializer ; Zero byte allocas should be merged if they can't be deleted. -; CHECK: @test +; CHECK-LABEL: @test( ; CHECK: alloca ; CHECK-NOT: alloca define void @test() { @@ -25,7 +25,7 @@ define void @test() { } ; Zero byte allocas should be deleted. -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK-NOT: alloca define void @test2() { %A = alloca i32 ; <i32*> [#uses=1] @@ -34,7 +34,7 @@ define void @test2() { } ; Zero byte allocas should be deleted. -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK-NOT: alloca define void @test3() { %A = alloca { i32 } ; <{ i32 }*> [#uses=1] @@ -43,7 +43,7 @@ define void @test3() { ret void } -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK: = zext i32 %n to i64 ; CHECK: %A = alloca i32, i64 % define i32* @test4(i32 %n) { @@ -54,7 +54,7 @@ define i32* @test4(i32 %n) { ; Allocas which are only used by GEPs, bitcasts, and stores (transitively) ; should be deleted. define void @test5() { -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK-NOT: alloca ; CHECK-NOT: store ; CHECK: ret @@ -80,7 +80,7 @@ declare void @f(i32* %p) ; Check that we don't delete allocas in some erroneous cases. define void @test6() { -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK-NOT: ret ; CHECK: alloca ; CHECK-NEXT: alloca diff --git a/test/Transforms/InstCombine/and-xor-or.ll b/test/Transforms/InstCombine/and-xor-or.ll index 7ff810b..ec36d13 100644 --- a/test/Transforms/InstCombine/and-xor-or.ll +++ b/test/Transforms/InstCombine/and-xor-or.ll @@ -7,7 +7,7 @@ define i64 @or(i64 %x, i64 %y) nounwind uwtable readnone ssp { %2 = xor i64 %y, %x %3 = add i64 %1, %2 ret i64 %3 -; CHECK: @or +; CHECK-LABEL: @or( ; CHECK: or i64 ; CHECK-NEXT: ret } @@ -18,7 +18,7 @@ define i64 @or2(i64 %x, i64 %y) nounwind uwtable readnone ssp { %2 = xor i64 %y, %x %3 = or i64 %1, %2 ret i64 %3 -; CHECK: @or2 +; CHECK-LABEL: @or2( ; CHECK: or i64 ; CHECK-NEXT: ret } diff --git a/test/Transforms/InstCombine/and.ll b/test/Transforms/InstCombine/and.ll index 8492df9..3d36bfb 100644 --- a/test/Transforms/InstCombine/and.ll +++ b/test/Transforms/InstCombine/and.ll @@ -186,9 +186,9 @@ define i1 @test25(i32 %A) { } define i1 @test26(i32 %A) { - %B = icmp ne i32 %A, 50 ; <i1> [#uses=1] - %C = icmp ne i32 %A, 51 ; <i1> [#uses=1] - ;; (A-50) > 1 + %B = icmp ne i32 %A, 49 ; <i1> [#uses=1] + %C = icmp ne i32 %A, 50 ; <i1> [#uses=1] + ;; (A-49) > 1 %D = and i1 %B, %C ; <i1> [#uses=1] ret i1 %D } diff --git a/test/Transforms/InstCombine/and2.ll b/test/Transforms/InstCombine/and2.ll index 531aedb..504391a 100644 --- a/test/Transforms/InstCombine/and2.ll +++ b/test/Transforms/InstCombine/and2.ll @@ -13,7 +13,7 @@ define i1 @test2(i1 %X, i1 %Y) { %a = and i1 %X, %Y %b = and i1 %a, %X ret i1 %b -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK-NEXT: and i1 %X, %Y ; CHECK-NEXT: ret } @@ -22,7 +22,7 @@ define i32 @test3(i32 %X, i32 %Y) { %a = and i32 %X, %Y %b = and i32 %Y, %a ret i32 %b -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK-NEXT: and i32 %X, %Y ; CHECK-NEXT: ret } @@ -32,7 +32,7 @@ define i1 @test4(i32 %X) { %b = icmp slt i32 %X, 0 %c = and i1 %a, %b ret i1 %c -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK-NEXT: ret i1 false } diff --git a/test/Transforms/InstCombine/apint-call-cast-target.ll b/test/Transforms/InstCombine/apint-call-cast-target.ll index fe336de..4e98f9b 100644 --- a/test/Transforms/InstCombine/apint-call-cast-target.ll +++ b/test/Transforms/InstCombine/apint-call-cast-target.ll @@ -1,16 +1,19 @@ -; RUN: opt < %s -instcombine -S | grep call | not grep bitcast +; RUN: opt < %s -instcombine -S | FileCheck %s target datalayout = "e-p:32:32" target triple = "i686-pc-linux-gnu" - define i32 @main() { +; CHECK-LABEL: @main( +; CHECK: call i32 bitcast entry: %tmp = call i32 bitcast (i7* (i999*)* @ctime to i32 (i99*)*)( i99* null ) ret i32 %tmp } define i7* @ctime(i999*) { +; CHECK-LABEL: @ctime( +; CHECK: call i7* bitcast entry: %tmp = call i7* bitcast (i32 ()* @main to i7* ()*)( ) ret i7* %tmp diff --git a/test/Transforms/InstCombine/apint-shift-simplify.ll b/test/Transforms/InstCombine/apint-shift-simplify.ll index 14e895a..63703ba 100644 --- a/test/Transforms/InstCombine/apint-shift-simplify.ll +++ b/test/Transforms/InstCombine/apint-shift-simplify.ll @@ -5,7 +5,7 @@ define i41 @test0(i41 %A, i41 %B, i41 %C) { %Y = shl i41 %B, %C %Z = and i41 %X, %Y ret i41 %Z -; CHECK: @test0 +; CHECK-LABEL: @test0( ; CHECK-NEXT: and i41 %A, %B ; CHECK-NEXT: shl i41 ; CHECK-NEXT: ret @@ -16,7 +16,7 @@ define i57 @test1(i57 %A, i57 %B, i57 %C) { %Y = lshr i57 %B, %C %Z = or i57 %X, %Y ret i57 %Z -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK-NEXT: or i57 %A, %B ; CHECK-NEXT: lshr i57 ; CHECK-NEXT: ret @@ -27,7 +27,7 @@ define i49 @test2(i49 %A, i49 %B, i49 %C) { %Y = ashr i49 %B, %C %Z = xor i49 %X, %Y ret i49 %Z -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK-NEXT: xor i49 %A, %B ; CHECK-NEXT: ashr i49 ; CHECK-NEXT: ret diff --git a/test/Transforms/InstCombine/apint-shift.ll b/test/Transforms/InstCombine/apint-shift.ll index 73f630e..f5764c2 100644 --- a/test/Transforms/InstCombine/apint-shift.ll +++ b/test/Transforms/InstCombine/apint-shift.ll @@ -2,14 +2,14 @@ ; even with arbitrary precision integers. ; RUN: opt < %s -instcombine -S | FileCheck %s -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK-NOT: sh define i47 @test1(i47 %A) { %B = shl i47 %A, 0 ; <i47> [#uses=1] ret i47 %B } -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK-NOT: sh define i41 @test2(i7 %X) { %A = zext i7 %X to i41 ; <i41> [#uses=1] @@ -17,14 +17,14 @@ define i41 @test2(i7 %X) { ret i41 %B } -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK-NOT: sh define i41 @test3(i41 %A) { %B = ashr i41 %A, 0 ; <i41> [#uses=1] ret i41 %B } -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK-NOT: sh define i39 @test4(i7 %X) { %A = zext i7 %X to i39 ; <i39> [#uses=1] @@ -32,21 +32,21 @@ define i39 @test4(i7 %X) { ret i39 %B } -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK-NOT: sh define i55 @test5(i55 %A) { %B = lshr i55 %A, 55 ; <i55> [#uses=1] ret i55 %B } -; CHECK: @test5a +; CHECK-LABEL: @test5a( ; CHECK-NOT: sh define i32 @test5a(i32 %A) { %B = shl i32 %A, 32 ; <i32> [#uses=1] ret i32 %B } -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK: mul i55 %A, 6 define i55 @test6(i55 %A) { %B = shl i55 %A, 1 ; <i55> [#uses=1] @@ -54,7 +54,7 @@ define i55 @test6(i55 %A) { ret i55 %C } -; CHECK: @test6a +; CHECK-LABEL: @test6a( ; CHECK: mul i55 %A, 6 define i55 @test6a(i55 %A) { %B = mul i55 %A, 3 ; <i55> [#uses=1] @@ -62,7 +62,7 @@ define i55 @test6a(i55 %A) { ret i55 %C } -; CHECK: @test7 +; CHECK-LABEL: @test7( ; CHECK-NOT: sh define i29 @test7(i8 %X) { %A = zext i8 %X to i29 ; <i29> [#uses=1] @@ -70,7 +70,7 @@ define i29 @test7(i8 %X) { ret i29 %B } -; CHECK: @test8 +; CHECK-LABEL: @test8( ; CHECK-NOT: sh define i7 @test8(i7 %A) { %B = shl i7 %A, 4 ; <i7> [#uses=1] @@ -78,7 +78,7 @@ define i7 @test8(i7 %A) { ret i7 %C } -; CHECK: @test9 +; CHECK-LABEL: @test9( ; CHECK-NOT: sh define i17 @test9(i17 %A) { %B = shl i17 %A, 16 ; <i17> [#uses=1] @@ -86,7 +86,7 @@ define i17 @test9(i17 %A) { ret i17 %C } -; CHECK: @test10 +; CHECK-LABEL: @test10( ; CHECK-NOT: sh define i19 @test10(i19 %A) { %B = lshr i19 %A, 18 ; <i19> [#uses=1] @@ -94,7 +94,7 @@ define i19 @test10(i19 %A) { ret i19 %C } -; CHECK: @test11 +; CHECK-LABEL: @test11( ; Don't hide the shl from scalar evolution. DAGCombine will get it. ; CHECK: shl define i23 @test11(i23 %A) { @@ -104,7 +104,7 @@ define i23 @test11(i23 %A) { ret i23 %C } -; CHECK: @test12 +; CHECK-LABEL: @test12( ; CHECK-NOT: sh define i47 @test12(i47 %A) { %B = ashr i47 %A, 8 ; <i47> [#uses=1] @@ -112,7 +112,7 @@ define i47 @test12(i47 %A) { ret i47 %C } -; CHECK: @test13 +; CHECK-LABEL: @test13( ; Don't hide the shl from scalar evolution. DAGCombine will get it. ; CHECK: shl define i18 @test13(i18 %A) { @@ -122,7 +122,7 @@ define i18 @test13(i18 %A) { ret i18 %C } -; CHECK: @test14 +; CHECK-LABEL: @test14( ; CHECK-NOT: sh define i35 @test14(i35 %A) { %B = lshr i35 %A, 4 ; <i35> [#uses=1] @@ -131,7 +131,7 @@ define i35 @test14(i35 %A) { ret i35 %D } -; CHECK: @test14a +; CHECK-LABEL: @test14a( ; CHECK-NOT: sh define i79 @test14a(i79 %A) { %B = shl i79 %A, 4 ; <i79> [#uses=1] @@ -140,7 +140,7 @@ define i79 @test14a(i79 %A) { ret i79 %D } -; CHECK: @test15 +; CHECK-LABEL: @test15( ; CHECK-NOT: sh define i45 @test15(i1 %C) { %A = select i1 %C, i45 3, i45 1 ; <i45> [#uses=1] @@ -148,7 +148,7 @@ define i45 @test15(i1 %C) { ret i45 %V } -; CHECK: @test15a +; CHECK-LABEL: @test15a( ; CHECK-NOT: sh define i53 @test15a(i1 %X) { %A = select i1 %X, i8 3, i8 1 ; <i8> [#uses=1] @@ -157,7 +157,7 @@ define i53 @test15a(i1 %X) { ret i53 %V } -; CHECK: @test16 +; CHECK-LABEL: @test16( ; CHECK-NOT: sh define i1 @test16(i84 %X) { %tmp.3 = ashr i84 %X, 4 ; <i84> [#uses=1] @@ -166,7 +166,7 @@ define i1 @test16(i84 %X) { ret i1 %tmp.7 } -; CHECK: @test17 +; CHECK-LABEL: @test17( ; CHECK-NOT: sh define i1 @test17(i106 %A) { %B = lshr i106 %A, 3 ; <i106> [#uses=1] @@ -174,7 +174,7 @@ define i1 @test17(i106 %A) { ret i1 %C } -; CHECK: @test18 +; CHECK-LABEL: @test18( ; CHECK-NOT: sh define i1 @test18(i11 %A) { %B = lshr i11 %A, 10 ; <i11> [#uses=1] @@ -182,7 +182,7 @@ define i1 @test18(i11 %A) { ret i1 %C } -; CHECK: @test19 +; CHECK-LABEL: @test19( ; CHECK-NOT: sh define i1 @test19(i37 %A) { %B = ashr i37 %A, 2 ; <i37> [#uses=1] @@ -190,7 +190,7 @@ define i1 @test19(i37 %A) { ret i1 %C } -; CHECK: @test19a +; CHECK-LABEL: @test19a( ; CHECK-NOT: sh define i1 @test19a(i39 %A) { %B = ashr i39 %A, 2 ; <i39> [#uses=1] @@ -198,7 +198,7 @@ define i1 @test19a(i39 %A) { ret i1 %C } -; CHECK: @test20 +; CHECK-LABEL: @test20( ; CHECK-NOT: sh define i1 @test20(i13 %A) { %B = ashr i13 %A, 12 ; <i13> [#uses=1] @@ -206,7 +206,7 @@ define i1 @test20(i13 %A) { ret i1 %C } -; CHECK: @test21 +; CHECK-LABEL: @test21( ; CHECK-NOT: sh define i1 @test21(i12 %A) { %B = shl i12 %A, 6 ; <i12> [#uses=1] @@ -214,7 +214,7 @@ define i1 @test21(i12 %A) { ret i1 %C } -; CHECK: @test22 +; CHECK-LABEL: @test22( ; CHECK-NOT: sh define i1 @test22(i14 %A) { %B = shl i14 %A, 7 ; <i14> [#uses=1] @@ -222,7 +222,7 @@ define i1 @test22(i14 %A) { ret i1 %C } -; CHECK: @test23 +; CHECK-LABEL: @test23( ; CHECK-NOT: sh define i11 @test23(i44 %A) { %B = shl i44 %A, 33 ; <i44> [#uses=1] @@ -231,7 +231,7 @@ define i11 @test23(i44 %A) { ret i11 %D } -; CHECK: @test25 +; CHECK-LABEL: @test25( ; CHECK-NOT: sh define i37 @test25(i37 %tmp.2, i37 %AA) { %x = lshr i37 %AA, 17 ; <i37> [#uses=1] @@ -241,7 +241,7 @@ define i37 @test25(i37 %tmp.2, i37 %AA) { ret i37 %tmp.6 } -; CHECK: @test26 +; CHECK-LABEL: @test26( ; CHECK-NOT: sh define i40 @test26(i40 %A) { %B = lshr i40 %A, 1 ; <i40> [#uses=1] diff --git a/test/Transforms/InstCombine/apint-shl-trunc.ll b/test/Transforms/InstCombine/apint-shl-trunc.ll index f2dc7d5..b4450d4 100644 --- a/test/Transforms/InstCombine/apint-shl-trunc.ll +++ b/test/Transforms/InstCombine/apint-shl-trunc.ll @@ -1,7 +1,7 @@ ; RUN: opt < %s -instcombine -S | FileCheck %s define i1 @test0(i39 %X, i39 %A) { -; CHECK: @test0 +; CHECK-LABEL: @test0( ; CHECK: %[[V1:.*]] = shl i39 1, %A ; CHECK: %[[V2:.*]] = and i39 %[[V1]], %X ; CHECK: %[[V3:.*]] = icmp ne i39 %[[V2]], 0 @@ -13,7 +13,7 @@ define i1 @test0(i39 %X, i39 %A) { } define i1 @test1(i799 %X, i799 %A) { -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK: %[[V1:.*]] = shl i799 1, %A ; CHECK: %[[V2:.*]] = and i799 %[[V1]], %X ; CHECK: %[[V3:.*]] = icmp ne i799 %[[V2]], 0 diff --git a/test/Transforms/InstCombine/atomic.ll b/test/Transforms/InstCombine/atomic.ll index 097cf5e..ccee874 100644 --- a/test/Transforms/InstCombine/atomic.ll +++ b/test/Transforms/InstCombine/atomic.ll @@ -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 diff --git a/test/Transforms/InstCombine/badmalloc.ll b/test/Transforms/InstCombine/badmalloc.ll index 3abe28a..2074d26 100644 --- a/test/Transforms/InstCombine/badmalloc.ll +++ b/test/Transforms/InstCombine/badmalloc.ll @@ -15,11 +15,11 @@ define i1 @test1() { call void @free(i8* %A) ret i1 %B -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK: ret i1 false } -; CHECK: @test2 +; CHECK-LABEL: @test2( define noalias i8* @test2() nounwind { entry: ; CHECK: @malloc diff --git a/test/Transforms/InstCombine/bitcast-alias-function.ll b/test/Transforms/InstCombine/bitcast-alias-function.ll new file mode 100644 index 0000000..a6b56f9 --- /dev/null +++ b/test/Transforms/InstCombine/bitcast-alias-function.ll @@ -0,0 +1,229 @@ +; RUN: opt -S -instcombine -o - %s | FileCheck %s +target datalayout = "e-p:32:32:32-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v64:64:64-v128:128:128-a0:0:64" + + + +; Cases that should be bitcast + +; Test cast between scalars with same bit sizes +@alias_i32_to_f32 = alias bitcast (i32 (i32)* @func_i32 to float (float)*) + +; Test cast between vectors with same number of elements and bit sizes +@alias_v2i32_to_v2f32 = alias bitcast (<2 x i32> (<2 x i32>)* @func_v2i32 to <2 x float> (<2 x float>)*) + +; Test cast from vector to scalar with same number of bits +@alias_v2f32_to_i64 = alias bitcast (i64 (i64)* @func_i64 to <2 x float> (<2 x float>)*) + +; Test cast from scalar to vector with same number of bits +@alias_i64_to_v2f32 = alias bitcast (<2 x float> (<2 x float>)* @func_v2f32 to i64 (i64)*) + +; Test cast between vectors of pointers +@alias_v2i32p_to_v2i64p = alias bitcast (<2 x i32*> (<2 x i32*>)* @func_v2i32p to <2 x i64*> (<2 x i64*>)*) + + +; Cases that should be invalid and unchanged + +; Test cast between scalars with different bit sizes +@alias_i64_to_f32 = alias bitcast (i64 (i64)* @func_i64 to float (float)*) + +; Test cast between vectors with different bit sizes but the +; same number of elements +@alias_v2i64_to_v2f32 = alias bitcast (<2 x i64> (<2 x i64>)* @func_v2i64 to <2 x float> (<2 x float>)*) + +; Test cast between vectors with same number of bits and different +; numbers of elements +@alias_v2i32_to_v4f32 = alias bitcast (<2 x i32> (<2 x i32>)* @func_v2i32 to <4 x float> (<4 x float>)*) + +; Test cast between scalar and vector with different number of bits +@alias_i64_to_v4f32 = alias bitcast (<4 x float> (<4 x float>)* @func_v4f32 to i64 (i64)*) + +; Test cast between vector and scalar with different number of bits +@alias_v4f32_to_i64 = alias bitcast (i64 (i64)* @func_i64 to <4 x float> (<4 x float>)*) + +; Test cast from scalar to vector of pointers with same number of bits +; We don't know the pointer size at this point, so this can't be done +@alias_i64_to_v2i32p = alias bitcast (<2 x i32*> (<2 x i32*>)* @func_v2i32p to i64 (i64)*) + +; Test cast between vector of pointers and scalar with different number of bits +@alias_v4i32p_to_i64 = alias bitcast (i64 (i64)* @func_i64 to <4 x i32*> (<4 x i32*>)*) + + + +define internal <2 x i32> @func_v2i32(<2 x i32> %v) noinline nounwind { +entry: + ret <2 x i32> %v +} + +define internal <2 x float> @func_v2f32(<2 x float> %v) noinline nounwind { +entry: + ret <2 x float> %v +} + +define internal <4 x float> @func_v4f32(<4 x float> %v) noinline nounwind { +entry: + ret <4 x float> %v +} + +define internal i32 @func_i32(i32 %v) noinline nounwind { +entry: + ret i32 %v +} + +define internal i64 @func_i64(i64 %v) noinline nounwind { +entry: + ret i64 %v +} + +define internal <2 x i64> @func_v2i64(<2 x i64> %v) noinline nounwind { +entry: + ret <2 x i64> %v +} + +define internal <2 x i32*> @func_v2i32p(<2 x i32*> %v) noinline nounwind { +entry: + ret <2 x i32*> %v +} + +; Valid cases, only bitcast for argument / return type and call underlying function + +; Sizes match, should only bitcast +define void @bitcast_alias_scalar(float* noalias %source, float* noalias %dest) nounwind { +entry: +; CHECK-LABEL: @bitcast_alias_scalar +; CHECK: bitcast float %tmp to i32 +; CHECK-NOT: fptoui +; CHECK-NOT: uitofp +; CHECK: bitcast i32 %call to float + %tmp = load float* %source, align 8 + %call = call float @alias_i32_to_f32(float %tmp) nounwind + store float %call, float* %dest, align 8 + ret void +} + +; Sizes match, should only bitcast +define void @bitcast_alias_vector(<2 x float>* noalias %source, <2 x float>* noalias %dest) nounwind { +entry: +; CHECK-LABEL: @bitcast_alias_vector +; CHECK: bitcast <2 x float> %tmp to <2 x i32> +; CHECK-NOT: fptoui +; CHECK-NOT: uitofp +; CHECK: bitcast <2 x i32> %call to <2 x float> + %tmp = load <2 x float>* %source, align 8 + %call = call <2 x float> @alias_v2i32_to_v2f32(<2 x float> %tmp) nounwind + store <2 x float> %call, <2 x float>* %dest, align 8 + ret void +} + +; Sizes match, should only bitcast +define void @bitcast_alias_vector_scalar_same_size(<2 x float>* noalias %source, <2 x float>* noalias %dest) nounwind { +entry: +; CHECK-LABEL: @bitcast_alias_vector_scalar_same_size +; CHECK: bitcast <2 x float> %tmp to i64 +; CHECK: %call = call i64 @func_i64 +; CHECK: bitcast i64 %call to <2 x float> + %tmp = load <2 x float>* %source, align 8 + %call = call <2 x float> @alias_v2f32_to_i64(<2 x float> %tmp) nounwind + store <2 x float> %call, <2 x float>* %dest, align 8 + ret void +} + +define void @bitcast_alias_scalar_vector_same_size(i64* noalias %source, i64* noalias %dest) nounwind { +entry: +; CHECK-LABEL: @bitcast_alias_scalar_vector_same_size +; CHECK: bitcast i64 %tmp to <2 x float> +; CHECK: call <2 x float> @func_v2f32 +; CHECK: bitcast <2 x float> %call to i64 + %tmp = load i64* %source, align 8 + %call = call i64 @alias_i64_to_v2f32(i64 %tmp) nounwind + store i64 %call, i64* %dest, align 8 + ret void +} + +define void @bitcast_alias_vector_ptrs_same_size(<2 x i64*>* noalias %source, <2 x i64*>* noalias %dest) nounwind { +entry: +; CHECK-LABEL: @bitcast_alias_vector_ptrs_same_size +; CHECK: bitcast <2 x i64*> %tmp to <2 x i32*> +; CHECK: call <2 x i32*> @func_v2i32p +; CHECK: bitcast <2 x i32*> %call to <2 x i64*> + %tmp = load <2 x i64*>* %source, align 8 + %call = call <2 x i64*> @alias_v2i32p_to_v2i64p(<2 x i64*> %tmp) nounwind + store <2 x i64*> %call, <2 x i64*>* %dest, align 8 + ret void +} + +; Invalid cases: + +define void @bitcast_alias_mismatch_scalar_size(float* noalias %source, float* noalias %dest) nounwind { +entry: +; CHECK-LABEL: @bitcast_alias_mismatch_scalar_size +; CHECK-NOT: fptoui +; CHECK: @alias_i64_to_f32 +; CHECK-NOT: uitofp + %tmp = load float* %source, align 8 + %call = call float @alias_i64_to_f32(float %tmp) nounwind + store float %call, float* %dest, align 8 + ret void +} + +define void @bitcast_alias_mismatch_vector_element_and_bit_size(<2 x float>* noalias %source, <2 x float>* noalias %dest) nounwind { +entry: +; CHECK-LABEL: @bitcast_alias_mismatch_vector_element_and_bit_size +; CHECK-NOT: fptoui <2 x float> %tmp to <2 x i64> +; CHECK: @alias_v2i64_to_v2f32 +; CHECK-NOT: uitofp <2 x i64> %call to <2 x float> + %tmp = load <2 x float>* %source, align 8 + %call = call <2 x float> @alias_v2i64_to_v2f32(<2 x float> %tmp) nounwind + store <2 x float> %call, <2 x float>* %dest, align 8 + ret void +} + +define void @bitcast_alias_vector_mismatched_number_elements(<4 x float>* noalias %source, <4 x float>* noalias %dest) nounwind { +entry: +; CHECK-LABEL: @bitcast_alias_vector_mismatched_number_elements +; CHECK: %call = call <4 x float> @alias_v2i32_to_v4f32 + %tmp = load <4 x float>* %source, align 8 + %call = call <4 x float> @alias_v2i32_to_v4f32(<4 x float> %tmp) nounwind + store <4 x float> %call, <4 x float>* %dest, align 8 + ret void +} + +define void @bitcast_alias_vector_scalar_mismatched_bit_size(<4 x float>* noalias %source, <4 x float>* noalias %dest) nounwind { +entry: +; CHECK-LABEL: @bitcast_alias_vector_scalar_mismatched_bit_size +; CHECK: %call = call <4 x float> @alias_v4f32_to_i64 + %tmp = load <4 x float>* %source, align 8 + %call = call <4 x float> @alias_v4f32_to_i64(<4 x float> %tmp) nounwind + store <4 x float> %call, <4 x float>* %dest, align 8 + ret void +} + +define void @bitcast_alias_vector_ptrs_scalar_mismatched_bit_size(<4 x i32*>* noalias %source, <4 x i32*>* noalias %dest) nounwind { +entry: +; CHECK-LABEL: @bitcast_alias_vector_ptrs_scalar_mismatched_bit_size +; CHECK: @alias_v4i32p_to_i64 + %tmp = load <4 x i32*>* %source, align 8 + %call = call <4 x i32*> @alias_v4i32p_to_i64(<4 x i32*> %tmp) nounwind + store <4 x i32*> %call, <4 x i32*>* %dest, align 8 + ret void +} + +define void @bitcast_alias_scalar_vector_ptrs_same_size(i64* noalias %source, i64* noalias %dest) nounwind { +entry: +; CHECK-LABEL: @bitcast_alias_scalar_vector_ptrs_same_size +; CHECK: @alias_i64_to_v2i32p + %tmp = load i64* %source, align 8 + %call = call i64 @alias_i64_to_v2i32p(i64 %tmp) nounwind + store i64 %call, i64* %dest, align 8 + ret void +} + +define void @bitcast_alias_scalar_vector_mismatched_bit_size(i64* noalias %source, i64* noalias %dest) nounwind { +entry: +; CHECK-LABEL: @bitcast_alias_scalar_vector_mismatched_bit_size +; CHECK: call i64 @alias_i64_to_v4f32 + %tmp = load i64* %source, align 8 + %call = call i64 @alias_i64_to_v4f32(i64 %tmp) nounwind + store i64 %call, i64* %dest, align 8 + ret void +} + diff --git a/test/Transforms/InstCombine/bitcast-bigendian.ll b/test/Transforms/InstCombine/bitcast-bigendian.ll index 4ded581..28b0e9a 100644 --- a/test/Transforms/InstCombine/bitcast-bigendian.ll +++ b/test/Transforms/InstCombine/bitcast-bigendian.ll @@ -18,7 +18,7 @@ define float @test2(<2 x float> %A, <2 x i32> %B) { %add = fadd float %tmp24, %tmp4 ret float %add -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK-NEXT: %tmp24 = extractelement <2 x float> %A, i32 1 ; CHECK-NEXT: bitcast <2 x i32> %B to <2 x float> ; CHECK-NEXT: %tmp4 = extractelement <2 x float> {{.*}}, i32 1 @@ -40,7 +40,7 @@ define float @test3(<2 x float> %A, <2 x i64> %B) { %add = fadd float %tmp24, %tmp4 ret float %add -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK-NEXT: %tmp24 = extractelement <2 x float> %A, i32 0 ; CHECK-NEXT: bitcast <2 x i64> %B to <4 x float> ; CHECK-NEXT: %tmp4 = extractelement <4 x float> {{.*}}, i32 1 diff --git a/test/Transforms/InstCombine/bitcast-vec-uniform.ll b/test/Transforms/InstCombine/bitcast-vec-uniform.ll index 5975f1e..bfb7719 100644 --- a/test/Transforms/InstCombine/bitcast-vec-uniform.ll +++ b/test/Transforms/InstCombine/bitcast-vec-uniform.ll @@ -1,6 +1,6 @@ ; RUN: opt < %s -instcombine -S | FileCheck %s -; CHECK: @a +; CHECK-LABEL: @a( ; CHECK-NOT: bitcast ; CHECK: ret define <4 x i32> @a(<1 x i64> %y) { @@ -8,7 +8,7 @@ define <4 x i32> @a(<1 x i64> %y) { ret <4 x i32> %c } -; CHECK: @b +; CHECK-LABEL: @b( ; CHECK-NOT: bitcast ; CHECK: ret @@ -17,7 +17,7 @@ define <4 x i32> @b(<1 x i64> %y) { ret <4 x i32> %c } -; CHECK: @foo +; CHECK-LABEL: @foo( ; CHECK-NOT: bitcast ; CHECK: ret @@ -28,7 +28,7 @@ define <2 x float> @foo() { } -; CHECK: @foo2 +; CHECK-LABEL: @foo2( ; CHECK-NOT: bitcast ; CHECK: ret define <2 x double> @foo2() { @@ -36,7 +36,7 @@ define <2 x double> @foo2() { ret <2 x double> %cast } -; CHECK: @foo3 +; CHECK-LABEL: @foo3( ; CHECK-NOT: bitcast ; CHECK: ret define <1 x float> @foo3() { @@ -44,7 +44,7 @@ define <1 x float> @foo3() { ret <1 x float> %cast } -; CHECK: @foo4 +; CHECK-LABEL: @foo4( ; CHECK-NOT: bitcast ; CHECK: ret define float @foo4() { @@ -52,7 +52,7 @@ define float @foo4() { ret float %cast } -; CHECK: @foo5 +; CHECK-LABEL: @foo5( ; CHECK-NOT: bitcast ; CHECK: ret define double @foo5() { @@ -61,7 +61,7 @@ define double @foo5() { } -; CHECK: @foo6 +; CHECK-LABEL: @foo6( ; CHECK-NOT: bitcast ; CHECK: ret define <2 x double> @foo6() { diff --git a/test/Transforms/InstCombine/bitcast-vector-fold.ll b/test/Transforms/InstCombine/bitcast-vector-fold.ll index 8fd7f35..04c2861 100644 --- a/test/Transforms/InstCombine/bitcast-vector-fold.ll +++ b/test/Transforms/InstCombine/bitcast-vector-fold.ll @@ -35,4 +35,4 @@ define <4 x i32> @test6() { define i32 @test7() { %tmp3 = bitcast <2 x half> <half 0xH1100, half 0xH0011> to i32 ret i32 %tmp3 -}
\ No newline at end of file +} diff --git a/test/Transforms/InstCombine/bitcast.ll b/test/Transforms/InstCombine/bitcast.ll index 1e61132..4ef8790 100644 --- a/test/Transforms/InstCombine/bitcast.ll +++ b/test/Transforms/InstCombine/bitcast.ll @@ -12,7 +12,7 @@ define i32 @test1(i64 %a) { %t4 = extractelement <2 x i32> %t3, i32 0 ret i32 %t4 -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK: ret i32 0 } @@ -31,7 +31,7 @@ define float @test2(<2 x float> %A, <2 x i32> %B) { %add = fadd float %tmp24, %tmp4 ret float %add -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK-NEXT: %tmp24 = extractelement <2 x float> %A, i32 0 ; CHECK-NEXT: bitcast <2 x i32> %B to <2 x float> ; CHECK-NEXT: %tmp4 = extractelement <2 x float> {{.*}}, i32 0 @@ -56,7 +56,7 @@ define float @test3(<2 x float> %A, <2 x i64> %B) { %add = fadd float %tmp24, %tmp4 ret float %add -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK-NEXT: %tmp24 = extractelement <2 x float> %A, i32 1 ; CHECK-NEXT: bitcast <2 x i64> %B to <4 x float> ; CHECK-NEXT: %tmp4 = extractelement <4 x float> {{.*}}, i32 2 @@ -72,7 +72,7 @@ define <2 x i32> @test4(i32 %A, i32 %B){ %ins35 = or i64 %tmp33, %tmp38 %tmp43 = bitcast i64 %ins35 to <2 x i32> ret <2 x i32> %tmp43 - ; CHECK: @test4 + ; CHECK-LABEL: @test4( ; CHECK-NEXT: insertelement <2 x i32> undef, i32 %A, i32 0 ; CHECK-NEXT: insertelement <2 x i32> {{.*}}, i32 %B, i32 1 ; CHECK-NEXT: ret <2 x i32> @@ -89,7 +89,7 @@ define <2 x float> @test5(float %A, float %B) { %ins35 = or i64 %tmp33, %tmp38 %tmp43 = bitcast i64 %ins35 to <2 x float> ret <2 x float> %tmp43 - ; CHECK: @test5 + ; CHECK-LABEL: @test5( ; CHECK-NEXT: insertelement <2 x float> undef, float %A, i32 0 ; CHECK-NEXT: insertelement <2 x float> {{.*}}, float %B, i32 1 ; CHECK-NEXT: ret <2 x float> @@ -102,7 +102,7 @@ define <2 x float> @test6(float %A){ %mask20 = or i64 %tmp25, 1109917696 ; <i64> [#uses=1] %tmp35 = bitcast i64 %mask20 to <2 x float> ; <<2 x float>> [#uses=1] ret <2 x float> %tmp35 -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK-NEXT: insertelement <2 x float> <float 4.200000e+01, float undef>, float %A, i32 1 ; CHECK: ret } @@ -110,7 +110,7 @@ define <2 x float> @test6(float %A){ define i64 @ISPC0(i64 %in) { %out = and i64 %in, xor (i64 bitcast (<4 x i16> <i16 -1, i16 -1, i16 -1, i16 -1> to i64), i64 -1) ret i64 %out -; CHECK: @ISPC0 +; CHECK-LABEL: @ISPC0( ; CHECK: ret i64 0 } @@ -118,14 +118,14 @@ define i64 @ISPC0(i64 %in) { define i64 @Vec2(i64 %in) { %out = and i64 %in, xor (i64 bitcast (<4 x i16> <i16 0, i16 0, i16 0, i16 0> to i64), i64 0) ret i64 %out -; CHECK: @Vec2 +; CHECK-LABEL: @Vec2( ; CHECK: ret i64 0 } define i64 @All11(i64 %in) { %out = and i64 %in, xor (i64 bitcast (<2 x float> bitcast (i64 -1 to <2 x float>) to i64), i64 -1) ret i64 %out -; CHECK: @All11 +; CHECK-LABEL: @All11( ; CHECK: ret i64 0 } @@ -133,7 +133,7 @@ define i64 @All11(i64 %in) { define i32 @All111(i32 %in) { %out = and i32 %in, xor (i32 bitcast (<1 x float> bitcast (i32 -1 to <1 x float>) to i32), i32 -1) ret i32 %out -; CHECK: @All111 +; CHECK-LABEL: @All111( ; CHECK: ret i32 0 } @@ -141,6 +141,6 @@ define <2 x i16> @BitcastInsert(i32 %a) { %v = insertelement <1 x i32> undef, i32 %a, i32 0 %r = bitcast <1 x i32> %v to <2 x i16> ret <2 x i16> %r -; CHECK: @BitcastInsert +; CHECK-LABEL: @BitcastInsert( ; CHECK: bitcast i32 %a to <2 x i16> } diff --git a/test/Transforms/InstCombine/call-cast-target.ll b/test/Transforms/InstCombine/call-cast-target.ll index 7addc8a..315c516 100644 --- a/test/Transforms/InstCombine/call-cast-target.ll +++ b/test/Transforms/InstCombine/call-cast-target.ll @@ -1,13 +1,14 @@ -; RUN: opt < %s -instcombine -S | \ -; RUN: grep call | not grep bitcast +; RUN: opt < %s -instcombine -S | FileCheck %s target datalayout = "e-p:32:32" target triple = "i686-pc-linux-gnu" define i32 @main() { +; CHECK-LABEL: @main +; CHECK: call i32 bitcast entry: - %tmp = call i32 bitcast (i8* (i32*)* @ctime to i32 (i32*)*)( i32* null ) ; <i32> [#uses=1] - ret i32 %tmp + %tmp = call i32 bitcast (i8* (i32*)* @ctime to i32 (i32*)*)( i32* null ) ; <i32> [#uses=1] + ret i32 %tmp } declare i8* @ctime(i32*) diff --git a/test/Transforms/InstCombine/call.ll b/test/Transforms/InstCombine/call.ll index 96ec420..55833fb 100644 --- a/test/Transforms/InstCombine/call.ll +++ b/test/Transforms/InstCombine/call.ll @@ -7,92 +7,94 @@ target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:1 declare void @test1a(i8*) define void @test1(i32* %A) { - call void bitcast (void (i8*)* @test1a to void (i32*)*)( i32* %A ) - ret void +; CHECK-LABEL: @test1( ; CHECK: %1 = bitcast i32* %A to i8* ; CHECK: call void @test1a(i8* %1) ; CHECK: ret void + call void bitcast (void (i8*)* @test1a to void (i32*)*)( i32* %A ) + ret void } -; More complex case, translate argument because of resolution. This is safe +; More complex case, translate argument because of resolution. This is safe ; because we have the body of the function define void @test2a(i8 %A) { - ret void +; CHECK-LABEL: @test2a( ; CHECK: ret void + ret void } define i32 @test2(i32 %A) { - call void bitcast (void (i8)* @test2a to void (i32)*)( i32 %A ) - ret i32 %A -; CHECK: %1 = trunc i32 %A to i8 -; CHECK: call void @test2a(i8 %1) +; CHECK-LABEL: @test2( +; CHECK: call void bitcast ; CHECK: ret i32 %A + call void bitcast (void (i8)* @test2a to void (i32)*)( i32 %A ) + ret i32 %A } -; Resolving this should insert a cast from sbyte to int, following the C +; Resolving this should insert a cast from sbyte to int, following the C ; promotion rules. define void @test3a(i8, ...) {unreachable } define void @test3(i8 %A, i8 %B) { - call void bitcast (void (i8, ...)* @test3a to void (i8, i8)*)( i8 %A, i8 %B -) - ret void +; CHECK-LABEL: @test3( ; CHECK: %1 = zext i8 %B to i32 ; CHECK: call void (i8, ...)* @test3a(i8 %A, i32 %1) ; CHECK: ret void + call void bitcast (void (i8, ...)* @test3a to void (i8, i8)*)( i8 %A, i8 %B) + ret void } - ; test conversion of return value... define i8 @test4a() { - ret i8 0 +; CHECK-LABEL: @test4a( ; CHECK: ret i8 0 + ret i8 0 } define i32 @test4() { - %X = call i32 bitcast (i8 ()* @test4a to i32 ()*)( ) ; <i32> [#uses=1] - ret i32 %X -; CHECK: %X = call i8 @test4a() -; CHECK: %1 = zext i8 %X to i32 -; CHECK: ret i32 %1 +; CHECK-LABEL: @test4( +; CHECK: call i32 bitcast + %X = call i32 bitcast (i8 ()* @test4a to i32 ()*)( ) ; <i32> [#uses=1] + ret i32 %X } - -; test conversion of return value... no value conversion occurs so we can do +; test conversion of return value... no value conversion occurs so we can do ; this with just a prototype... declare i32 @test5a() define i32 @test5() { - %X = call i32 @test5a( ) ; <i32> [#uses=1] - ret i32 %X +; CHECK-LABEL: @test5( ; CHECK: %X = call i32 @test5a() ; CHECK: ret i32 %X + %X = call i32 @test5a( ) ; <i32> [#uses=1] + ret i32 %X } - ; test addition of new arguments... declare i32 @test6a(i32) define i32 @test6() { - %X = call i32 bitcast (i32 (i32)* @test6a to i32 ()*)( ) - ret i32 %X +; CHECK-LABEL: @test6( ; CHECK: %X = call i32 @test6a(i32 0) ; CHECK: ret i32 %X + %X = call i32 bitcast (i32 (i32)* @test6a to i32 ()*)( ) + ret i32 %X } - ; test removal of arguments, only can happen with a function body define void @test7a() { - ret void +; CHECK-LABEL: @test7a( ; CHECK: ret void + ret void } define void @test7() { - call void bitcast (void ()* @test7a to void (i32)*)( i32 5 ) - ret void +; CHECK-LABEL: @test7( ; CHECK: call void @test7a() ; CHECK: ret void + call void bitcast (void ()* @test7a to void (i32)*)( i32 5 ) + ret void } @@ -100,6 +102,11 @@ define void @test7() { declare void @test8a() define i8* @test8() { +; CHECK-LABEL: @test8( +; CHECK-NEXT: invoke void @test8a() +; Don't turn this into "unreachable": the callee and caller don't agree in +; calling conv, but the implementation of test8a may actually end up using the +; right calling conv. invoke void @test8a() to label %invoke.cont unwind label %try.handler @@ -114,23 +121,17 @@ try.handler: ; preds = %entry declare i32 @__gxx_personality_v0(...) -; Don't turn this into "unreachable": the callee and caller don't agree in -; calling conv, but the implementation of test8a may actually end up using the -; right calling conv. -; CHECK: @test8() { -; CHECK-NEXT: invoke void @test8a() - - -; Don't turn this into a direct call, because test9x is just a prototype and +; Don't turn this into a direct call, because test9x is just a prototype and ; doing so will make it varargs. ; rdar://9038601 declare i8* @test9x(i8*, i8*, ...) noredzone define i8* @test9(i8* %arg, i8* %tmp3) nounwind ssp noredzone { +; CHECK-LABEL: @test9 entry: %call = call i8* bitcast (i8* (i8*, i8*, ...)* @test9x to i8* (i8*, i8*)*)(i8* %arg, i8* %tmp3) noredzone ret i8* %call -; CHECK: @test9( +; CHECK-LABEL: @test9( ; CHECK: call i8* bitcast } diff --git a/test/Transforms/InstCombine/canonicalize_branch.ll b/test/Transforms/InstCombine/canonicalize_branch.ll index 869546d..b62b143 100644 --- a/test/Transforms/InstCombine/canonicalize_branch.ll +++ b/test/Transforms/InstCombine/canonicalize_branch.ll @@ -5,7 +5,7 @@ define i32 @test0(i32 %X, i32 %Y) { %C = icmp eq i32 %X, %Y br i1 %C, label %T, label %F, !prof !0 -; CHECK: @test0 +; CHECK-LABEL: @test0( ; CHECK: %C = icmp eq i32 %X, %Y ; CHECK: br i1 %C, label %T, label %F @@ -19,7 +19,7 @@ define i32 @test1(i32 %X, i32 %Y) { %C = icmp ne i32 %X, %Y br i1 %C, label %T, label %F, !prof !1 -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK: %C = icmp eq i32 %X, %Y ; CHECK: br i1 %C, label %F, label %T @@ -33,7 +33,7 @@ define i32 @test2(i32 %X, i32 %Y) { %C = icmp ule i32 %X, %Y br i1 %C, label %T, label %F, !prof !2 -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK: %C = icmp ugt i32 %X, %Y ; CHECK: br i1 %C, label %F, label %T @@ -47,7 +47,7 @@ define i32 @test3(i32 %X, i32 %Y) { %C = icmp uge i32 %X, %Y br i1 %C, label %T, label %F, !prof !3 -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK: %C = icmp ult i32 %X, %Y ; CHECK: br i1 %C, label %F, label %T diff --git a/test/Transforms/InstCombine/cast.ll b/test/Transforms/InstCombine/cast.ll index ff2c0a9..52ea7b9 100644 --- a/test/Transforms/InstCombine/cast.ll +++ b/test/Transforms/InstCombine/cast.ll @@ -326,7 +326,7 @@ define i16 @test39(i16 %a) { %tmp.upgrd.32 = or i32 %tmp21, %tmp5 %tmp.upgrd.3 = trunc i32 %tmp.upgrd.32 to i16 ret i16 %tmp.upgrd.3 -; CHECK: @test39 +; CHECK-LABEL: @test39( ; CHECK: %tmp.upgrd.32 = call i16 @llvm.bswap.i16(i16 %a) ; CHECK: ret i16 %tmp.upgrd.32 } @@ -338,7 +338,7 @@ define i16 @test40(i16 %a) { %tmp.upgrd.32 = or i32 %tmp21, %tmp5 %tmp.upgrd.3 = trunc i32 %tmp.upgrd.32 to i16 ret i16 %tmp.upgrd.3 -; CHECK: @test40 +; CHECK-LABEL: @test40( ; CHECK: %tmp21 = lshr i16 %a, 9 ; CHECK: %tmp5 = shl i16 %a, 8 ; CHECK: %tmp.upgrd.32 = or i16 %tmp21, %tmp5 @@ -350,7 +350,7 @@ define i32* @test41(i32* %tmp1) { %tmp64 = bitcast i32* %tmp1 to { i32 }* %tmp65 = getelementptr { i32 }* %tmp64, i32 0, i32 0 ret i32* %tmp65 -; CHECK: @test41 +; CHECK-LABEL: @test41( ; CHECK: ret i32* %tmp1 } @@ -358,7 +358,7 @@ define i32 @test42(i32 %X) { %Y = trunc i32 %X to i8 ; <i8> [#uses=1] %Z = zext i8 %Y to i32 ; <i32> [#uses=1] ret i32 %Z -; CHECK: @test42 +; CHECK-LABEL: @test42( ; CHECK: %Z = and i32 %X, 255 } @@ -368,7 +368,7 @@ define zeroext i64 @test43(i8 zeroext %on_off) nounwind readonly { %B = add i32 %A, -1 %C = sext i32 %B to i64 ret i64 %C ;; Should be (add (zext i8 -> i64), -1) -; CHECK: @test43 +; CHECK-LABEL: @test43( ; CHECK-NEXT: %A = zext i8 %on_off to i64 ; CHECK-NEXT: %B = add i64 %A, -1 ; CHECK-NEXT: ret i64 %B @@ -379,7 +379,7 @@ define i64 @test44(i8 %T) { %B = or i16 %A, 1234 %C = zext i16 %B to i64 ret i64 %C -; CHECK: @test44 +; CHECK-LABEL: @test44( ; CHECK-NEXT: %A = zext i8 %T to i64 ; CHECK-NEXT: %B = or i64 %A, 1234 ; CHECK-NEXT: ret i64 %B @@ -391,7 +391,7 @@ define i64 @test45(i8 %A, i64 %Q) { %C = or i32 %B, %D %E = zext i32 %C to i64 ret i64 %E -; CHECK: @test45 +; CHECK-LABEL: @test45( ; CHECK-NEXT: %B = sext i8 %A to i64 ; CHECK-NEXT: %C = or i64 %B, %Q ; CHECK-NEXT: %E = and i64 %C, 4294967295 @@ -405,7 +405,7 @@ define i64 @test46(i64 %A) { %D = shl i32 %C, 8 %E = zext i32 %D to i64 ret i64 %E -; CHECK: @test46 +; CHECK-LABEL: @test46( ; CHECK-NEXT: %C = shl i64 %A, 8 ; CHECK-NEXT: %D = and i64 %C, 10752 ; CHECK-NEXT: ret i64 %D @@ -416,7 +416,7 @@ define i64 @test47(i8 %A) { %C = or i32 %B, 42 %E = zext i32 %C to i64 ret i64 %E -; CHECK: @test47 +; CHECK-LABEL: @test47( ; CHECK-NEXT: %B = sext i8 %A to i64 ; CHECK-NEXT: %C = and i64 %B, 4294967253 ; CHECK-NEXT: %E = or i64 %C, 42 @@ -430,7 +430,7 @@ define i64 @test48(i8 %A, i8 %a) { %D = or i32 %C, %b %E = zext i32 %D to i64 ret i64 %E -; CHECK: @test48 +; CHECK-LABEL: @test48( ; CHECK-NEXT: %b = zext i8 %a to i64 ; CHECK-NEXT: %B = zext i8 %A to i64 ; CHECK-NEXT: %C = shl nuw nsw i64 %B, 8 @@ -443,7 +443,7 @@ define i64 @test49(i64 %A) { %C = or i32 %B, 1 %D = sext i32 %C to i64 ret i64 %D -; CHECK: @test49 +; CHECK-LABEL: @test49( ; CHECK-NEXT: %C = shl i64 %A, 32 ; CHECK-NEXT: ashr exact i64 %C, 32 ; CHECK-NEXT: %D = or i64 {{.*}}, 1 @@ -456,7 +456,7 @@ define i64 @test50(i64 %A) { %D = add i32 %B, -1 %E = sext i32 %D to i64 ret i64 %E -; CHECK: @test50 +; CHECK-LABEL: @test50( ; lshr+shl will be handled by DAGCombine. ; CHECK-NEXT: lshr i64 %A, 2 ; CHECK-NEXT: shl i64 %a, 32 @@ -472,7 +472,7 @@ define i64 @test51(i64 %A, i1 %cond) { %E = select i1 %cond, i32 %C, i32 %D %F = sext i32 %E to i64 ret i64 %F -; CHECK: @test51 +; CHECK-LABEL: @test51( ; CHECK-NEXT: %C = and i64 %A, 4294967294 ; CHECK-NEXT: %D = or i64 %A, 1 ; CHECK-NEXT: %E = select i1 %cond, i64 %C, i64 %D @@ -487,7 +487,7 @@ define i32 @test52(i64 %A) { %D = and i16 %C, -25350 %E = zext i16 %D to i32 ret i32 %E -; CHECK: @test52 +; CHECK-LABEL: @test52( ; CHECK-NEXT: %B = trunc i64 %A to i32 ; CHECK-NEXT: %C = and i32 %B, 7224 ; CHECK-NEXT: %D = or i32 %C, 32962 @@ -500,7 +500,7 @@ define i64 @test53(i32 %A) { %D = and i16 %C, -25350 %E = zext i16 %D to i64 ret i64 %E -; CHECK: @test53 +; CHECK-LABEL: @test53( ; CHECK-NEXT: %B = zext i32 %A to i64 ; CHECK-NEXT: %C = and i64 %B, 7224 ; CHECK-NEXT: %D = or i64 %C, 32962 @@ -513,7 +513,7 @@ define i32 @test54(i64 %A) { %D = and i16 %C, -25350 %E = sext i16 %D to i32 ret i32 %E -; CHECK: @test54 +; CHECK-LABEL: @test54( ; CHECK-NEXT: %B = trunc i64 %A to i32 ; CHECK-NEXT: %C = and i32 %B, 7224 ; CHECK-NEXT: %D = or i32 %C, -32574 @@ -526,7 +526,7 @@ define i64 @test55(i32 %A) { %D = and i16 %C, -25350 %E = sext i16 %D to i64 ret i64 %E -; CHECK: @test55 +; CHECK-LABEL: @test55( ; CHECK-NEXT: %B = zext i32 %A to i64 ; CHECK-NEXT: %C = and i64 %B, 7224 ; CHECK-NEXT: %D = or i64 %C, -32574 @@ -538,7 +538,7 @@ define i64 @test56(i16 %A) nounwind { %tmp354 = lshr i32 %tmp353, 5 %tmp355 = zext i32 %tmp354 to i64 ret i64 %tmp355 -; CHECK: @test56 +; CHECK-LABEL: @test56( ; CHECK-NEXT: %tmp353 = sext i16 %A to i64 ; CHECK-NEXT: %tmp354 = lshr i64 %tmp353, 5 ; CHECK-NEXT: %tmp355 = and i64 %tmp354, 134217727 @@ -550,7 +550,7 @@ define i64 @test57(i64 %A) nounwind { %C = lshr i32 %B, 8 %E = zext i32 %C to i64 ret i64 %E -; CHECK: @test57 +; CHECK-LABEL: @test57( ; CHECK-NEXT: %C = lshr i64 %A, 8 ; CHECK-NEXT: %E = and i64 %C, 16777215 ; CHECK-NEXT: ret i64 %E @@ -563,7 +563,7 @@ define i64 @test58(i64 %A) nounwind { %E = zext i32 %D to i64 ret i64 %E -; CHECK: @test58 +; CHECK-LABEL: @test58( ; CHECK-NEXT: %C = lshr i64 %A, 8 ; CHECK-NEXT: %D = and i64 %C, 16777087 ; CHECK-NEXT: %E = or i64 %D, 128 @@ -579,7 +579,7 @@ define i64 @test59(i8 %A, i8 %B) nounwind { %H = or i32 %G, %E %I = zext i32 %H to i64 ret i64 %I -; CHECK: @test59 +; CHECK-LABEL: @test59( ; CHECK-NEXT: %C = zext i8 %A to i64 ; CHECK-NOT: i32 ; CHECK: %F = zext i8 %B to i64 @@ -593,7 +593,7 @@ define <3 x i32> @test60(<4 x i32> %call4) nounwind { %tmp10 = bitcast i96 %tmp9 to <3 x i32> ret <3 x i32> %tmp10 -; CHECK: @test60 +; CHECK-LABEL: @test60( ; CHECK-NEXT: shufflevector ; CHECK-NEXT: ret } @@ -603,7 +603,7 @@ define <4 x i32> @test61(<3 x i32> %call4) nounwind { %tmp9 = zext i96 %tmp11 to i128 %tmp10 = bitcast i128 %tmp9 to <4 x i32> ret <4 x i32> %tmp10 -; CHECK: @test61 +; CHECK-LABEL: @test61( ; CHECK-NEXT: shufflevector ; CHECK-NEXT: ret } @@ -613,7 +613,7 @@ define <4 x i32> @test62(<3 x float> %call4) nounwind { %tmp9 = zext i96 %tmp11 to i128 %tmp10 = bitcast i128 %tmp9 to <4 x i32> ret <4 x i32> %tmp10 -; CHECK: @test62 +; CHECK-LABEL: @test62( ; CHECK-NEXT: bitcast ; CHECK-NEXT: shufflevector ; CHECK-NEXT: ret @@ -625,7 +625,7 @@ entry: %a = bitcast i64 %tmp8 to <2 x i32> %vcvt.i = uitofp <2 x i32> %a to <2 x float> ret <2 x float> %vcvt.i -; CHECK: @test63 +; CHECK-LABEL: @test63( ; CHECK: bitcast ; CHECK: uitofp } @@ -634,7 +634,7 @@ define <4 x float> @test64(<4 x float> %c) nounwind { %t0 = bitcast <4 x float> %c to <4 x i32> %t1 = bitcast <4 x i32> %t0 to <4 x float> ret <4 x float> %t1 -; CHECK: @test64 +; CHECK-LABEL: @test64( ; CHECK-NEXT: ret <4 x float> %c } @@ -642,7 +642,7 @@ define <4 x float> @test65(<4 x float> %c) nounwind { %t0 = bitcast <4 x float> %c to <2 x double> %t1 = bitcast <2 x double> %t0 to <4 x float> ret <4 x float> %t1 -; CHECK: @test65 +; CHECK-LABEL: @test65( ; CHECK-NEXT: ret <4 x float> %c } @@ -650,13 +650,13 @@ define <2 x float> @test66(<2 x float> %c) nounwind { %t0 = bitcast <2 x float> %c to double %t1 = bitcast double %t0 to <2 x float> ret <2 x float> %t1 -; CHECK: @test66 +; CHECK-LABEL: @test66( ; CHECK-NEXT: ret <2 x float> %c } define float @test2c() { ret float extractelement (<2 x float> bitcast (double bitcast (<2 x float> <float -1.000000e+00, float -1.000000e+00> to double) to <2 x float>), i32 0) -; CHECK: @test2c +; CHECK-LABEL: @test2c( ; CHECK-NOT: extractelement } @@ -665,7 +665,7 @@ define i64 @test_mmx(<2 x i32> %c) nounwind { %B = bitcast x86_mmx %A to <2 x i32> %C = bitcast <2 x i32> %B to i64 ret i64 %C -; CHECK: @test_mmx +; CHECK-LABEL: @test_mmx( ; CHECK-NOT: x86_mmx } @@ -674,7 +674,7 @@ define i64 @test_mmx_const(<2 x i32> %c) nounwind { %B = bitcast x86_mmx %A to <2 x i32> %C = bitcast <2 x i32> %B to i64 ret i64 %C -; CHECK: @test_mmx_const +; CHECK-LABEL: @test_mmx_const( ; CHECK-NOT: x86_mmx } @@ -689,14 +689,14 @@ define i1 @test67(i1 %a, i32 %b) { %trunc = trunc i32 %conv.i.i to i8 %tobool.i = icmp eq i8 %trunc, 0 ret i1 %tobool.i -; CHECK: @test67 +; CHECK-LABEL: @test67( ; CHECK: ret i1 false } %s = type { i32, i32, i32 } define %s @test68(%s *%p, i64 %i) { -; CHECK: @test68 +; CHECK-LABEL: @test68( %o = mul i64 %i, 12 %q = bitcast %s* %p to i8* %pp = getelementptr inbounds i8* %q, i64 %o @@ -709,7 +709,7 @@ define %s @test68(%s *%p, i64 %i) { } define double @test69(double *%p, i64 %i) { -; CHECK: @test69 +; CHECK-LABEL: @test69( %o = shl nsw i64 %i, 3 %q = bitcast double* %p to i8* %pp = getelementptr inbounds i8* %q, i64 %o @@ -722,7 +722,7 @@ define double @test69(double *%p, i64 %i) { } define %s @test70(%s *%p, i64 %i) { -; CHECK: @test70 +; CHECK-LABEL: @test70( %o = mul nsw i64 %i, 36 ; CHECK-NEXT: mul nsw i64 %i, 3 %q = bitcast %s* %p to i8* @@ -736,7 +736,7 @@ define %s @test70(%s *%p, i64 %i) { } define double @test71(double *%p, i64 %i) { -; CHECK: @test71 +; CHECK-LABEL: @test71( %o = shl i64 %i, 5 ; CHECK-NEXT: shl i64 %i, 2 %q = bitcast double* %p to i8* @@ -750,7 +750,7 @@ define double @test71(double *%p, i64 %i) { } define double @test72(double *%p, i32 %i) { -; CHECK: @test72 +; CHECK-LABEL: @test72( %so = mul nsw i32 %i, 8 %o = sext i32 %so to i64 ; CHECK-NEXT: sext i32 %i to i64 @@ -765,7 +765,7 @@ define double @test72(double *%p, i32 %i) { } define double @test73(double *%p, i128 %i) { -; CHECK: @test73 +; CHECK-LABEL: @test73( %lo = mul nsw i128 %i, 8 %o = trunc i128 %lo to i64 ; CHECK-NEXT: trunc i128 %i to i64 @@ -780,7 +780,7 @@ define double @test73(double *%p, i128 %i) { } define double @test74(double *%p, i64 %i) { -; CHECK: @test74 +; CHECK-LABEL: @test74( %q = bitcast double* %p to i64* %pp = getelementptr inbounds i64* %q, i64 %i ; CHECK-NEXT: getelementptr inbounds double* @@ -792,7 +792,7 @@ define double @test74(double *%p, i64 %i) { } define i32* @test75(i32* %p, i32 %x) { -; CHECK: @test75 +; CHECK-LABEL: @test75( %y = shl i32 %x, 3 ; CHECK-NEXT: shl i32 %x, 3 %z = sext i32 %y to i64 @@ -804,7 +804,7 @@ define i32* @test75(i32* %p, i32 %x) { } define %s @test76(%s *%p, i64 %i, i64 %j) { -; CHECK: @test76 +; CHECK-LABEL: @test76( %o = mul i64 %i, 12 %o2 = mul nsw i64 %o, %j ; CHECK-NEXT: %o2 = mul i64 %i, %j @@ -819,7 +819,7 @@ define %s @test76(%s *%p, i64 %i, i64 %j) { } define %s @test77(%s *%p, i64 %i, i64 %j) { -; CHECK: @test77 +; CHECK-LABEL: @test77( %o = mul nsw i64 %i, 36 %o2 = mul nsw i64 %o, %j ; CHECK-NEXT: %o = mul nsw i64 %i, 3 @@ -835,7 +835,7 @@ define %s @test77(%s *%p, i64 %i, i64 %j) { } define %s @test78(%s *%p, i64 %i, i64 %j, i32 %k, i32 %l, i128 %m, i128 %n) { -; CHECK: @test78 +; CHECK-LABEL: @test78( %a = mul nsw i32 %k, 36 ; CHECK-NEXT: mul nsw i32 %k, 3 %b = mul nsw i32 %a, %l @@ -863,7 +863,7 @@ define %s @test78(%s *%p, i64 %i, i64 %j, i32 %k, i32 %l, i128 %m, i128 %n) { } define %s @test79(%s *%p, i64 %i, i32 %j) { -; CHECK: @test79 +; CHECK-LABEL: @test79( %a = mul nsw i64 %i, 36 ; CHECK: mul nsw i64 %i, 36 %b = trunc i64 %a to i32 @@ -877,7 +877,7 @@ define %s @test79(%s *%p, i64 %i, i32 %j) { } define double @test80([100 x double]* %p, i32 %i) { -; CHECK: @test80 +; CHECK-LABEL: @test80( %tmp = mul nsw i32 %i, 8 ; CHECK-NEXT: sext i32 %i to i64 %q = bitcast [100 x double]* %p to i8* @@ -906,7 +906,7 @@ define i64 @test82(i64 %A) nounwind { %E = zext i32 %D to i64 ret i64 %E -; CHECK: @test82 +; CHECK-LABEL: @test82( ; CHECK-NEXT: [[REG:%[0-9]*]] = shl i64 %A, 1 ; CHECK-NEXT: %E = and i64 [[REG]], 4294966784 ; CHECK-NEXT: ret i64 %E @@ -921,7 +921,7 @@ define i64 @test83(i16 %a, i64 %k) { %sh_prom1 = zext i32 %shl to i64 ret i64 %sh_prom1 -; CHECK: @test83 +; CHECK-LABEL: @test83( ; CHECK: %sub = add nsw i64 %k, 4294967295 ; CHECK: %sh_prom = trunc i64 %sub to i32 ; CHECK: %shl = shl i32 %conv, %sh_prom diff --git a/test/Transforms/InstCombine/cast_ptr.ll b/test/Transforms/InstCombine/cast_ptr.ll index 09910fb..7910ea3 100644 --- a/test/Transforms/InstCombine/cast_ptr.ll +++ b/test/Transforms/InstCombine/cast_ptr.ll @@ -6,7 +6,7 @@ target datalayout = "p:32:32" ; This shouldn't convert to getelementptr because the relationship ; between the arithmetic and the layout of allocated memory is ; entirely unknown. -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK: ptrtoint ; CHECK: add ; CHECK: inttoptr @@ -18,7 +18,7 @@ define i8* @test1(i8* %t) { } ; These casts should be folded away. -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK: icmp eq i8* %a, %b define i1 @test2(i8* %a, i8* %b) { %tmpa = ptrtoint i8* %a to i32 ; <i32> [#uses=1] @@ -28,7 +28,7 @@ define i1 @test2(i8* %a, i8* %b) { } ; These casts should also be folded away. -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK: icmp eq i8* %a, @global @global = global i8 0 define i1 @test3(i8* %a) { @@ -41,7 +41,7 @@ define i1 @test4(i32 %A) { %B = inttoptr i32 %A to i8* %C = icmp eq i8* %B, null ret i1 %C -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK-NEXT: %C = icmp eq i32 %A, 0 ; CHECK-NEXT: ret i1 %C } @@ -60,7 +60,7 @@ define %unop* @test5(%op* %O) { %tmp = load %unop* (%op*)** bitcast ([1 x %op* (%op*)*]* @Array to %unop* (%op*)**); <%unop* (%op*)*> [#uses=1] %tmp.2 = call %unop* %tmp( %op* %O ) ; <%unop*> [#uses=1] ret %unop* %tmp.2 -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK: call %op* @foo(%op* %O) } @@ -74,6 +74,6 @@ entry: %arrayidx223 = bitcast i8 addrspace(1)* %source to i8* %tmp4 = load i8* %arrayidx223 ret i8 %tmp4 -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK: load i8* %arrayidx223 } diff --git a/test/Transforms/InstCombine/compare-signs.ll b/test/Transforms/InstCombine/compare-signs.ll index 72db66e..cdf95ab 100644 --- a/test/Transforms/InstCombine/compare-signs.ll +++ b/test/Transforms/InstCombine/compare-signs.ll @@ -22,7 +22,7 @@ ;} define i32 @test3(i32 %a, i32 %b) nounwind readnone { -; CHECK: @test3 +; CHECK-LABEL: @test3( entry: ; CHECK: xor i32 %a, %b ; CHECK: lshr i32 %0, 31 @@ -40,7 +40,7 @@ entry: ; Variation on @test3: checking the 2nd bit in a situation where the 5th bit ; is one, not zero. define i32 @test3i(i32 %a, i32 %b) nounwind readnone { -; CHECK: @test3i +; CHECK-LABEL: @test3i( entry: ; CHECK: xor i32 %a, %b ; CHECK: lshr i32 %0, 31 diff --git a/test/Transforms/InstCombine/constant-fold-gep.ll b/test/Transforms/InstCombine/constant-fold-gep.ll index e5b16ea..9f82e66 100644 --- a/test/Transforms/InstCombine/constant-fold-gep.ll +++ b/test/Transforms/InstCombine/constant-fold-gep.ll @@ -56,7 +56,7 @@ define void @frob() { ; PR8883 - Constant fold exotic gep subtract -; CHECK: @test2 +; CHECK-LABEL: @test2( @X = global [1000 x i8] zeroinitializer, align 16 define i64 @test2() { diff --git a/test/Transforms/InstCombine/cos-1.ll b/test/Transforms/InstCombine/cos-1.ll index b92e448..c2e9a0d 100644 --- a/test/Transforms/InstCombine/cos-1.ll +++ b/test/Transforms/InstCombine/cos-1.ll @@ -10,7 +10,7 @@ declare double @cos(double) ; Check cos(-x) -> cos(x); define double @test_simplify1(double %d) { -; NO-FLOAT-SHRINK: @test_simplify1 +; NO-FLOAT-SHRINK-LABEL: @test_simplify1( %neg = fsub double -0.000000e+00, %d %cos = call double @cos(double %neg) ; NO-FLOAT-SHRINK: call double @cos(double %d) @@ -18,7 +18,7 @@ define double @test_simplify1(double %d) { } define float @test_simplify2(float %f) { -; DO-FLOAT-SHRINK: @test_simplify2 +; DO-FLOAT-SHRINK-LABEL: @test_simplify2( %conv1 = fpext float %f to double %neg = fsub double -0.000000e+00, %conv1 %cos = call double @cos(double %neg) @@ -28,7 +28,7 @@ define float @test_simplify2(float %f) { } define float @test_simplify3(float %f) { -; NO-FLOAT-SHRINK: @test_simplify3 +; NO-FLOAT-SHRINK-LABEL: @test_simplify3( %conv1 = fpext float %f to double %neg = fsub double -0.000000e+00, %conv1 %cos = call double @cos(double %neg) diff --git a/test/Transforms/InstCombine/cos-2.ll b/test/Transforms/InstCombine/cos-2.ll index 2f2dfaf..c9a9c7c 100644 --- a/test/Transforms/InstCombine/cos-2.ll +++ b/test/Transforms/InstCombine/cos-2.ll @@ -9,7 +9,7 @@ declare float @cos(double) ; Check that cos functions with the wrong prototype aren't simplified. define float @test_no_simplify1(double %d) { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %neg = fsub double -0.000000e+00, %d %cos = call float @cos(double %neg) ; CHECK: call float @cos(double %neg) diff --git a/test/Transforms/InstCombine/debug-line.ll b/test/Transforms/InstCombine/debug-line.ll index 084efdc..a76c353 100644 --- a/test/Transforms/InstCombine/debug-line.ll +++ b/test/Transforms/InstCombine/debug-line.ll @@ -11,14 +11,16 @@ define void @foo() nounwind ssp { declare i32 @printf(i8*, ...) +!llvm.dbg.cu = !{!2} !llvm.dbg.sp = !{!0} -!0 = metadata !{i32 589870, i32 0, metadata !1, metadata !"foo", metadata !"foo", metadata !"", metadata !1, i32 4, metadata !3, i1 false, i1 true, i32 0, i32 0, null, i32 0, i1 false, void ()* @foo} ; [ DW_TAG_subprogram ] -!1 = metadata !{i32 589865, metadata !"m.c", metadata !"/private/tmp", metadata !2} ; [ DW_TAG_file_type ] -!2 = metadata !{i32 589841, i32 0, i32 12, metadata !"m.c", metadata !"/private/tmp", metadata !"clang", i1 true, i1 false, metadata !"", i32 0} ; [ DW_TAG_compile_unit ] -!3 = metadata !{i32 589845, metadata !1, metadata !"", metadata !1, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !4, i32 0, null} ; [ DW_TAG_subroutine_type ] +!0 = metadata !{i32 589870, metadata !8, metadata !1, metadata !"foo", metadata !"foo", metadata !"", i32 4, metadata !3, i1 false, i1 true, i32 0, i32 0, null, i32 0, i1 false, void ()* @foo, null, null, null, i32 0} ; [ DW_TAG_subprogram ] +!1 = metadata !{i32 589865, metadata !8} ; [ DW_TAG_file_type ] +!2 = metadata !{i32 589841, metadata !8, i32 12, metadata !"clang", i1 true, metadata !"", i32 0, metadata !4, metadata !4, metadata !9, null, null, metadata !""} ; [ DW_TAG_compile_unit ] +!3 = metadata !{i32 589845, metadata !8, metadata !1, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !4, i32 0, null} ; [ DW_TAG_subroutine_type ] !4 = metadata !{null} !5 = metadata !{i32 5, i32 2, metadata !6, null} -!6 = metadata !{i32 589835, metadata !0, i32 4, i32 12, metadata !1, i32 0} ; [ DW_TAG_lexical_block ] +!6 = metadata !{i32 589835, metadata !8, metadata !0, i32 4, i32 12, i32 0} ; [ DW_TAG_lexical_block ] !7 = metadata !{i32 6, i32 1, metadata !6, null} - +!8 = metadata !{metadata !"m.c", metadata !"/private/tmp"} +!9 = metadata !{metadata !0} diff --git a/test/Transforms/InstCombine/debuginfo.ll b/test/Transforms/InstCombine/debuginfo.ll index a9e3de3..2f080bf 100644 --- a/test/Transforms/InstCombine/debuginfo.ll +++ b/test/Transforms/InstCombine/debuginfo.ll @@ -31,26 +31,27 @@ entry: !llvm.dbg.cu = !{!3} !0 = metadata !{i32 786689, metadata !1, metadata !"__dest", metadata !2, i32 16777294, metadata !6, i32 0, null} ; [ DW_TAG_arg_variable ] -!1 = metadata !{i32 786478, metadata !2, metadata !"foobar", metadata !"foobar", metadata !"", metadata !2, i32 79, metadata !4, i1 true, i1 true, i32 0, i32 0, i32 0, i32 256, i1 true, i8* (i8*, i32, i64)* @foobar, null, null, metadata !25, i32 79} ; [ DW_TAG_subprogram ] +!1 = metadata !{i32 786478, metadata !27, metadata !2, metadata !"foobar", metadata !"foobar", metadata !"", i32 79, metadata !4, i1 true, i1 true, i32 0, i32 0, i32 0, i32 256, i1 true, i8* (i8*, i32, i64)* @foobar, null, null, metadata !25, i32 79} ; [ DW_TAG_subprogram ] !2 = metadata !{i32 786473, metadata !27} ; [ DW_TAG_file_type ] -!3 = metadata !{i32 786449, i32 0, i32 12, metadata !26, metadata !"clang version 3.0 (trunk 127710)", i1 true, metadata !"", i32 0, null, null, metadata !24, null, null} ; [ DW_TAG_compile_unit ] -!4 = metadata !{i32 786453, metadata !2, metadata !"", metadata !2, i32 0, i64 0, i64 0, i32 0, i32 0, i32 0, metadata !5, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] +!3 = metadata !{i32 786449, metadata !28, i32 12, metadata !"clang version 3.0 (trunk 127710)", i1 true, metadata !"", i32 0, metadata !29, metadata !29, metadata !24, null, null, metadata !""} ; [ DW_TAG_compile_unit ] +!4 = metadata !{i32 786453, metadata !27, metadata !2, metadata !"", i32 0, i64 0, i64 0, i32 0, i32 0, i32 0, metadata !5, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] !5 = metadata !{metadata !6} -!6 = metadata !{i32 786447, metadata !3, metadata !"", null, i32 0, i64 64, i64 64, i64 0, i32 0, null} ; [ DW_TAG_pointer_type ] +!6 = metadata !{i32 786447, null, metadata !3, metadata !"", i32 0, i64 64, i64 64, i64 0, i32 0, null} ; [ DW_TAG_pointer_type ] !7 = metadata !{i32 786689, metadata !1, metadata !"__val", metadata !2, i32 33554510, metadata !8, i32 0, null} ; [ DW_TAG_arg_variable ] -!8 = metadata !{i32 786468, metadata !3, metadata !"int", null, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ] +!8 = metadata !{i32 786468, null, metadata !3, metadata !"int", i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ] !9 = metadata !{i32 786689, metadata !1, metadata !"__len", metadata !2, i32 50331726, metadata !10, i32 0, null} ; [ DW_TAG_arg_variable ] -!10 = metadata !{i32 589846, metadata !3, metadata !"size_t", metadata !2, i32 80, i64 0, i64 0, i64 0, i32 0, metadata !11} ; [ DW_TAG_typedef ] -!11 = metadata !{i32 589846, metadata !3, metadata !"__darwin_size_t", metadata !2, i32 90, i64 0, i64 0, i64 0, i32 0, metadata !12} ; [ DW_TAG_typedef ] -!12 = metadata !{i32 786468, metadata !3, metadata !"long unsigned int", null, i32 0, i64 64, i64 64, i64 0, i32 0, i32 7} ; [ DW_TAG_base_type ] +!10 = metadata !{i32 589846, metadata !27, metadata !3, metadata !"size_t", i32 80, i64 0, i64 0, i64 0, i32 0, metadata !11} ; [ DW_TAG_typedef ] +!11 = metadata !{i32 589846, metadata !27, metadata !3, metadata !"__darwin_size_t", i32 90, i64 0, i64 0, i64 0, i32 0, metadata !12} ; [ DW_TAG_typedef ] +!12 = metadata !{i32 786468, null, metadata !3, metadata !"long unsigned int", i32 0, i64 64, i64 64, i64 0, i32 0, i32 7} ; [ DW_TAG_base_type ] !16 = metadata !{i32 78, i32 28, metadata !1, null} !18 = metadata !{i32 78, i32 40, metadata !1, null} !20 = metadata !{i32 78, i32 54, metadata !1, null} !21 = metadata !{i32 80, i32 3, metadata !22, null} -!22 = metadata !{i32 786443, metadata !23, i32 80, i32 3, metadata !2, i32 7} ; [ DW_TAG_lexical_block ] -!23 = metadata !{i32 786443, metadata !1, i32 79, i32 1, metadata !2, i32 6} ; [ DW_TAG_lexical_block ] +!22 = metadata !{i32 786443, metadata !27, metadata !23, i32 80, i32 3, i32 7} ; [ DW_TAG_lexical_block ] +!23 = metadata !{i32 786443, metadata !27, metadata !1, i32 79, i32 1, i32 6} ; [ DW_TAG_lexical_block ] !24 = metadata !{metadata !1} !25 = metadata !{metadata !0, metadata !7, metadata !9} !26 = metadata !{i32 786473, metadata !28} ; [ DW_TAG_file_type ] !27 = metadata !{metadata !"string.h", metadata !"Game"} !28 = metadata !{metadata !"bits.c", metadata !"Game"} +!29 = metadata !{i32 0} diff --git a/test/Transforms/InstCombine/disable-simplify-libcalls.ll b/test/Transforms/InstCombine/disable-simplify-libcalls.ll index c2c2936..6652788 100644 --- a/test/Transforms/InstCombine/disable-simplify-libcalls.ll +++ b/test/Transforms/InstCombine/disable-simplify-libcalls.ll @@ -51,42 +51,42 @@ declare i32 @printf(i8*) declare i32 @sprintf(i8*, i8*) define double @t1(double %x) { -; CHECK: @t1 +; CHECK-LABEL: @t1( %ret = call double @ceil(double %x) ret double %ret ; CHECK: call double @ceil } define double @t2(double %x, double %y) { -; CHECK: @t2 +; CHECK-LABEL: @t2( %ret = call double @copysign(double %x, double %y) ret double %ret ; CHECK: call double @copysign } define double @t3(double %x) { -; CHECK: @t3 +; CHECK-LABEL: @t3( %call = call double @cos(double %x) ret double %call ; CHECK: call double @cos } define double @t4(double %x) { -; CHECK: @t4 +; CHECK-LABEL: @t4( %ret = call double @fabs(double %x) ret double %ret ; CHECK: call double @fabs } define double @t5(double %x) { -; CHECK: @t5 +; CHECK-LABEL: @t5( %ret = call double @floor(double %x) ret double %ret ; CHECK: call double @floor } define i8* @t6(i8* %x) { -; CHECK: @t6 +; CHECK-LABEL: @t6( %empty = getelementptr [1 x i8]* @empty, i32 0, i32 0 %ret = call i8* @strcat(i8* %x, i8* %empty) ret i8* %ret @@ -94,7 +94,7 @@ define i8* @t6(i8* %x) { } define i8* @t7(i8* %x) { -; CHECK: @t7 +; CHECK-LABEL: @t7( %empty = getelementptr [1 x i8]* @empty, i32 0, i32 0 %ret = call i8* @strncat(i8* %x, i8* %empty, i32 1) ret i8* %ret @@ -102,7 +102,7 @@ define i8* @t7(i8* %x) { } define i8* @t8() { -; CHECK: @t8 +; CHECK-LABEL: @t8( %x = getelementptr inbounds [13 x i8]* @.str1, i32 0, i32 0 %ret = call i8* @strchr(i8* %x, i32 119) ret i8* %ret @@ -110,7 +110,7 @@ define i8* @t8() { } define i8* @t9() { -; CHECK: @t9 +; CHECK-LABEL: @t9( %x = getelementptr inbounds [13 x i8]* @.str1, i32 0, i32 0 %ret = call i8* @strrchr(i8* %x, i32 119) ret i8* %ret @@ -118,7 +118,7 @@ define i8* @t9() { } define i32 @t10() { -; CHECK: @t10 +; CHECK-LABEL: @t10( %x = getelementptr inbounds [4 x i8]* @.str2, i32 0, i32 0 %y = getelementptr inbounds [4 x i8]* @.str3, i32 0, i32 0 %ret = call i32 @strcmp(i8* %x, i8* %y) @@ -127,7 +127,7 @@ define i32 @t10() { } define i32 @t11() { -; CHECK: @t11 +; CHECK-LABEL: @t11( %x = getelementptr inbounds [4 x i8]* @.str2, i32 0, i32 0 %y = getelementptr inbounds [4 x i8]* @.str3, i32 0, i32 0 %ret = call i32 @strncmp(i8* %x, i8* %y, i64 3) @@ -136,7 +136,7 @@ define i32 @t11() { } define i8* @t12(i8* %x) { -; CHECK: @t12 +; CHECK-LABEL: @t12( %y = getelementptr inbounds [4 x i8]* @.str2, i32 0, i32 0 %ret = call i8* @strcpy(i8* %x, i8* %y) ret i8* %ret @@ -144,7 +144,7 @@ define i8* @t12(i8* %x) { } define i8* @t13(i8* %x) { -; CHECK: @t13 +; CHECK-LABEL: @t13( %y = getelementptr inbounds [4 x i8]* @.str2, i32 0, i32 0 %ret = call i8* @stpcpy(i8* %x, i8* %y) ret i8* %ret @@ -152,7 +152,7 @@ define i8* @t13(i8* %x) { } define i8* @t14(i8* %x) { -; CHECK: @t14 +; CHECK-LABEL: @t14( %y = getelementptr inbounds [4 x i8]* @.str2, i32 0, i32 0 %ret = call i8* @strncpy(i8* %x, i8* %y, i64 3) ret i8* %ret @@ -160,7 +160,7 @@ define i8* @t14(i8* %x) { } define i64 @t15() { -; CHECK: @t15 +; CHECK-LABEL: @t15( %x = getelementptr inbounds [4 x i8]* @.str2, i32 0, i32 0 %ret = call i64 @strlen(i8* %x) ret i64 %ret @@ -168,7 +168,7 @@ define i64 @t15() { } define i8* @t16(i8* %x) { -; CHECK: @t16 +; CHECK-LABEL: @t16( %y = getelementptr inbounds [1 x i8]* @.str, i32 0, i32 0 %ret = call i8* @strpbrk(i8* %x, i8* %y) ret i8* %ret @@ -176,7 +176,7 @@ define i8* @t16(i8* %x) { } define i64 @t17(i8* %x) { -; CHECK: @t17 +; CHECK-LABEL: @t17( %y = getelementptr inbounds [1 x i8]* @.str, i32 0, i32 0 %ret = call i64 @strspn(i8* %x, i8* %y) ret i64 %ret @@ -184,7 +184,7 @@ define i64 @t17(i8* %x) { } define double @t18(i8** %y) { -; CHECK: @t18 +; CHECK-LABEL: @t18( %x = getelementptr inbounds [6 x i8]* @.str4, i64 0, i64 0 %ret = call double @strtod(i8* %x, i8** %y) ret double %ret @@ -192,7 +192,7 @@ define double @t18(i8** %y) { } define float @t19(i8** %y) { -; CHECK: @t19 +; CHECK-LABEL: @t19( %x = getelementptr inbounds [6 x i8]* @.str4, i64 0, i64 0 %ret = call float @strtof(i8* %x, i8** %y) ret float %ret @@ -200,7 +200,7 @@ define float @t19(i8** %y) { } define x86_fp80 @t20(i8** %y) { -; CHECK: @t20 +; CHECK-LABEL: @t20( %x = getelementptr inbounds [6 x i8]* @.str4, i64 0, i64 0 %ret = call x86_fp80 @strtold(i8* %x, i8** %y) ret x86_fp80 %ret @@ -208,7 +208,7 @@ define x86_fp80 @t20(i8** %y) { } define i64 @t21(i8** %y) { -; CHECK: @t21 +; CHECK-LABEL: @t21( %x = getelementptr inbounds [5 x i8]* @.str5, i64 0, i64 0 %ret = call i64 @strtol(i8* %x, i8** %y, i32 10) ret i64 %ret @@ -216,7 +216,7 @@ define i64 @t21(i8** %y) { } define i64 @t22(i8** %y) { -; CHECK: @t22 +; CHECK-LABEL: @t22( %x = getelementptr inbounds [5 x i8]* @.str5, i64 0, i64 0 %ret = call i64 @strtoll(i8* %x, i8** %y, i32 10) ret i64 %ret @@ -224,7 +224,7 @@ define i64 @t22(i8** %y) { } define i64 @t23(i8** %y) { -; CHECK: @t23 +; CHECK-LABEL: @t23( %x = getelementptr inbounds [5 x i8]* @.str5, i64 0, i64 0 %ret = call i64 @strtoul(i8* %x, i8** %y, i32 10) ret i64 %ret @@ -232,7 +232,7 @@ define i64 @t23(i8** %y) { } define i64 @t24(i8** %y) { -; CHECK: @t24 +; CHECK-LABEL: @t24( %x = getelementptr inbounds [5 x i8]* @.str5, i64 0, i64 0 %ret = call i64 @strtoull(i8* %x, i8** %y, i32 10) ret i64 %ret @@ -240,7 +240,7 @@ define i64 @t24(i8** %y) { } define i64 @t25(i8* %y) { -; CHECK: @t25 +; CHECK-LABEL: @t25( %x = getelementptr [1 x i8]* @empty, i32 0, i32 0 %ret = call i64 @strcspn(i8* %x, i8* %y) ret i64 %ret @@ -248,35 +248,35 @@ define i64 @t25(i8* %y) { } define i32 @t26(i32 %y) { -; CHECK: @t26 +; CHECK-LABEL: @t26( %ret = call i32 @abs(i32 %y) ret i32 %ret ; CHECK: call i32 @abs } define i32 @t27(i32 %y) { -; CHECK: @t27 +; CHECK-LABEL: @t27( %ret = call i32 @ffs(i32 %y) ret i32 %ret ; CHECK: call i32 @ffs } define i32 @t28(i64 %y) { -; CHECK: @t28 +; CHECK-LABEL: @t28( %ret = call i32 @ffsl(i64 %y) ret i32 %ret ; CHECK: call i32 @ffsl } define i32 @t29(i64 %y) { -; CHECK: @t29 +; CHECK-LABEL: @t29( %ret = call i32 @ffsll(i64 %y) ret i32 %ret ; CHECK: call i32 @ffsll } define void @t30() { -; CHECK: @t30 +; CHECK-LABEL: @t30( %x = getelementptr inbounds [13 x i8]* @.str1, i32 0, i32 0 call i32 @fprintf(i8* null, i8* %x) ret void @@ -284,42 +284,42 @@ define void @t30() { } define i32 @t31(i32 %y) { -; CHECK: @t31 +; CHECK-LABEL: @t31( %ret = call i32 @isascii(i32 %y) ret i32 %ret ; CHECK: call i32 @isascii } define i32 @t32(i32 %y) { -; CHECK: @t32 +; CHECK-LABEL: @t32( %ret = call i32 @isdigit(i32 %y) ret i32 %ret ; CHECK: call i32 @isdigit } define i32 @t33(i32 %y) { -; CHECK: @t33 +; CHECK-LABEL: @t33( %ret = call i32 @toascii(i32 %y) ret i32 %ret ; CHECK: call i32 @toascii } define i64 @t34(i64 %y) { -; CHECK: @t34 +; CHECK-LABEL: @t34( %ret = call i64 @labs(i64 %y) ret i64 %ret ; CHECK: call i64 @labs } define i64 @t35(i64 %y) { -; CHECK: @t35 +; CHECK-LABEL: @t35( %ret = call i64 @llabs(i64 %y) ret i64 %ret ; CHECK: call i64 @llabs } define void @t36() { -; CHECK: @t36 +; CHECK-LABEL: @t36( %x = getelementptr inbounds [1 x i8]* @empty, i32 0, i32 0 call i32 @printf(i8* %x) ret void @@ -327,7 +327,7 @@ define void @t36() { } define void @t37(i8* %x) { -; CHECK: @t37 +; CHECK-LABEL: @t37( %y = getelementptr inbounds [13 x i8]* @.str1, i32 0, i32 0 call i32 @sprintf(i8* %x, i8* %y) ret void diff --git a/test/Transforms/InstCombine/div-shift-crash.ll b/test/Transforms/InstCombine/div-shift-crash.ll new file mode 100644 index 0000000..a619724 --- /dev/null +++ b/test/Transforms/InstCombine/div-shift-crash.ll @@ -0,0 +1,101 @@ +; RUN: opt -instcombine < %s +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-f128:128:128-v128:128:128-n32:64" +target triple = "powerpc64-unknown-linux-gnu" + +%struct.S0.0.1.2.3.4.13.22.31.44.48.53.54.55.56.58.59.60.66.68.70.74.77.106.107.108.109.110.113.117.118.128.129 = type <{ i64 }> + +; Function Attrs: nounwind +define void @main() #0 { +entry: + %l_819.i.i = alloca %struct.S0.0.1.2.3.4.13.22.31.44.48.53.54.55.56.58.59.60.66.68.70.74.77.106.107.108.109.110.113.117.118.128.129, align 8 + br i1 undef, label %land.lhs.true, label %for.cond.i + +land.lhs.true: ; preds = %entry + br label %for.cond.i + +for.cond.i: ; preds = %land.lhs.true, %entry + %0 = getelementptr inbounds %struct.S0.0.1.2.3.4.13.22.31.44.48.53.54.55.56.58.59.60.66.68.70.74.77.106.107.108.109.110.113.117.118.128.129* %l_819.i.i, i64 0, i32 0 + br label %for.cond.i6.i.i + +for.cond.i6.i.i: ; preds = %for.body.i8.i.i, %for.cond.i + br i1 undef, label %for.body.i8.i.i, label %lbl_707.i.i.i + +for.body.i8.i.i: ; preds = %for.cond.i6.i.i + br label %for.cond.i6.i.i + +lbl_707.i.i.i: ; preds = %for.cond.i6.i.i + br i1 undef, label %lor.rhs.i.i.i, label %lor.end.i.i.i + +lor.rhs.i.i.i: ; preds = %lbl_707.i.i.i + br label %lor.end.i.i.i + +lor.end.i.i.i: ; preds = %lor.rhs.i.i.i, %lbl_707.i.i.i + br label %for.cond1.i.i.i.i + +for.cond1.i.i.i.i: ; preds = %for.body4.i.i.i.i, %lor.end.i.i.i + br i1 undef, label %for.body4.i.i.i.i, label %func_39.exit.i.i + +for.body4.i.i.i.i: ; preds = %for.cond1.i.i.i.i + br label %for.cond1.i.i.i.i + +func_39.exit.i.i: ; preds = %for.cond1.i.i.i.i + %l_8191.sroa.0.0.copyload.i.i = load i64* %0, align 1 + br label %for.cond1.i.i.i + +for.cond1.i.i.i: ; preds = %safe_div_func_uint32_t_u_u.exit.i.i.i, %func_39.exit.i.i + br i1 undef, label %for.cond7.i.i.i, label %func_11.exit.i + +for.cond7.i.i.i: ; preds = %for.end30.i.i.i, %for.cond1.i.i.i + %storemerge.i.i.i = phi i32 [ %sub.i.i.i, %for.end30.i.i.i ], [ 4, %for.cond1.i.i.i ] + br i1 undef, label %for.cond22.i.i.i, label %for.end32.i.i.i + +for.cond22.i.i.i: ; preds = %for.body25.i.i.i, %for.cond7.i.i.i + br i1 undef, label %for.body25.i.i.i, label %for.end30.i.i.i + +for.body25.i.i.i: ; preds = %for.cond22.i.i.i + br label %for.cond22.i.i.i + +for.end30.i.i.i: ; preds = %for.cond22.i.i.i + %sub.i.i.i = add nsw i32 0, -1 + br label %for.cond7.i.i.i + +for.end32.i.i.i: ; preds = %for.cond7.i.i.i + %conv33.i.i.i = trunc i64 %l_8191.sroa.0.0.copyload.i.i to i32 + %xor.i.i.i.i = xor i32 %storemerge.i.i.i, -701565022 + %sub.i.i.i.i = sub nsw i32 0, %storemerge.i.i.i + %xor3.i.i.i.i = xor i32 %sub.i.i.i.i, %storemerge.i.i.i + %and4.i.i.i.i = and i32 %xor.i.i.i.i, %xor3.i.i.i.i + %cmp.i.i.i.i = icmp slt i32 %and4.i.i.i.i, 0 + %sub5.i.i.i.i = sub nsw i32 -701565022, %storemerge.i.i.i + %.sub5.i.i.i.i = select i1 %cmp.i.i.i.i, i32 -701565022, i32 %sub5.i.i.i.i + br i1 undef, label %safe_div_func_uint32_t_u_u.exit.i.i.i, label %cond.false.i.i.i.i + +cond.false.i.i.i.i: ; preds = %for.end32.i.i.i + %div.i.i.i.i = udiv i32 %conv33.i.i.i, %.sub5.i.i.i.i + br label %safe_div_func_uint32_t_u_u.exit.i.i.i + +safe_div_func_uint32_t_u_u.exit.i.i.i: ; preds = %cond.false.i.i.i.i, %for.end32.i.i.i + %cond.i.i.i.i = phi i32 [ %div.i.i.i.i, %cond.false.i.i.i.i ], [ %conv33.i.i.i, %for.end32.i.i.i ] + %cmp35.i.i.i = icmp ne i32 %cond.i.i.i.i, -7 + br label %for.cond1.i.i.i + +func_11.exit.i: ; preds = %for.cond1.i.i.i + br i1 undef, label %for.body, label %for.end + +for.body: ; preds = %func_11.exit.i + unreachable + +for.end: ; preds = %func_11.exit.i + br label %for.cond15 + +for.cond15: ; preds = %for.cond19, %for.end + br i1 undef, label %for.cond19, label %for.end45 + +for.cond19: ; preds = %for.cond15 + br label %for.cond15 + +for.end45: ; preds = %for.cond15 + unreachable +} + +attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } diff --git a/test/Transforms/InstCombine/div-shift.ll b/test/Transforms/InstCombine/div-shift.ll index e0372eb..3350f19 100644 --- a/test/Transforms/InstCombine/div-shift.ll +++ b/test/Transforms/InstCombine/div-shift.ll @@ -35,3 +35,41 @@ define i64 @t3(i64 %x, i32 %y) nounwind { %3 = udiv i64 %x, %2 ret i64 %3 } + +define i32 @t4(i32 %x, i32 %y) nounwind { +; CHECK: t4 +; CHECK-NOT: udiv +; CHECK-NEXT: [[CMP:%.*]] = icmp ult i32 %y, 5 +; CHECK-NEXT: [[SEL:%.*]] = select i1 [[CMP]], i32 5, i32 %y +; CHECK-NEXT: [[SHR:%.*]] = lshr i32 %x, [[SEL]] +; CHECK-NEXT: ret i32 [[SHR]] + %1 = shl i32 1, %y + %2 = icmp ult i32 %1, 32 + %3 = select i1 %2, i32 32, i32 %1 + %4 = udiv i32 %x, %3 + ret i32 %4 +} + +define i32 @t5(i1 %x, i1 %y, i32 %V) nounwind { +; CHECK: t5 +; CHECK-NOT: udiv +; CHECK-NEXT: [[SEL1:%.*]] = select i1 %x, i32 5, i32 6 +; CHECK-NEXT: [[LSHR:%.*]] = lshr i32 %V, [[SEL1]] +; CHECK-NEXT: [[SEL2:%.*]] = select i1 %y, i32 [[LSHR]], i32 0 +; CHECK-NEXT: ret i32 [[SEL2]] + %1 = shl i32 1, %V + %2 = select i1 %x, i32 32, i32 64 + %3 = select i1 %y, i32 %2, i32 %1 + %4 = udiv i32 %V, %3 + ret i32 %4 +} + +define i32 @t6(i32 %x, i32 %z) nounwind{ +; CHECK: t6 +; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 %x, 0 +; CHECK-NOT: udiv i32 %z, %x + %x_is_zero = icmp eq i32 %x, 0 + %divisor = select i1 %x_is_zero, i32 1, i32 %x + %y = udiv i32 %z, %divisor + ret i32 %y +} diff --git a/test/Transforms/InstCombine/div.ll b/test/Transforms/InstCombine/div.ll index 8a0897b..f67fd1c 100644 --- a/test/Transforms/InstCombine/div.ll +++ b/test/Transforms/InstCombine/div.ll @@ -5,7 +5,7 @@ define i32 @test1(i32 %A) { %B = sdiv i32 %A, 1 ; <i32> [#uses=1] ret i32 %B -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK-NEXT: ret i32 %A } @@ -13,7 +13,7 @@ define i32 @test2(i32 %A) { ; => Shift %B = udiv i32 %A, 8 ; <i32> [#uses=1] ret i32 %B -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK-NEXT: lshr i32 %A, 3 } @@ -21,7 +21,7 @@ define i32 @test3(i32 %A) { ; => 0, don't need to keep traps %B = sdiv i32 0, %A ; <i32> [#uses=1] ret i32 %B -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK-NEXT: ret i32 0 } @@ -29,7 +29,7 @@ define i32 @test4(i32 %A) { ; 0-A %B = sdiv i32 %A, -1 ; <i32> [#uses=1] ret i32 %B -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK-NEXT: sub i32 0, %A } @@ -37,7 +37,7 @@ define i32 @test5(i32 %A) { %B = udiv i32 %A, -16 ; <i32> [#uses=1] %C = udiv i32 %B, -4 ; <i32> [#uses=1] ret i32 %C -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK-NEXT: ret i32 0 } @@ -46,7 +46,7 @@ define i1 @test6(i32 %A) { ; A < 123 %C = icmp eq i32 %B, 0 ; <i1> [#uses=1] ret i1 %C -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK-NEXT: icmp ult i32 %A, 123 } @@ -55,7 +55,7 @@ define i1 @test7(i32 %A) { ; A >= 20 && A < 30 %C = icmp eq i32 %B, 2 ; <i1> [#uses=1] ret i1 %C -; CHECK: @test7 +; CHECK-LABEL: @test7( ; CHECK-NEXT: add i32 %A, -20 ; CHECK-NEXT: icmp ult i32 } @@ -65,7 +65,7 @@ define i1 @test8(i8 %A) { ; A >= 246 %C = icmp eq i8 %B, 2 ; <i1> [#uses=1] ret i1 %C -; CHECK: @test8 +; CHECK-LABEL: @test8( ; CHECK-NEXT: icmp ugt i8 %A, -11 } @@ -74,7 +74,7 @@ define i1 @test9(i8 %A) { ; A < 246 %C = icmp ne i8 %B, 2 ; <i1> [#uses=1] ret i1 %C -; CHECK: @test9 +; CHECK-LABEL: @test9( ; CHECK-NEXT: icmp ult i8 %A, -10 } @@ -82,7 +82,7 @@ define i32 @test10(i32 %X, i1 %C) { %V = select i1 %C, i32 64, i32 8 ; <i32> [#uses=1] %R = udiv i32 %X, %V ; <i32> [#uses=1] ret i32 %R -; CHECK: @test10 +; CHECK-LABEL: @test10( ; CHECK-NEXT: select i1 %C, i32 6, i32 3 ; CHECK-NEXT: lshr i32 %X } @@ -91,7 +91,7 @@ define i32 @test11(i32 %X, i1 %C) { %A = select i1 %C, i32 1024, i32 32 ; <i32> [#uses=1] %B = udiv i32 %X, %A ; <i32> [#uses=1] ret i32 %B -; CHECK: @test11 +; CHECK-LABEL: @test11( ; CHECK-NEXT: select i1 %C, i32 10, i32 5 ; CHECK-NEXT: lshr i32 %X } @@ -100,14 +100,14 @@ define i32 @test11(i32 %X, i1 %C) { define i32 @test12(i32 %x) nounwind { %tmp3 = udiv i32 %x, %x ; 1 ret i32 %tmp3 -; CHECK: @test12 +; CHECK-LABEL: @test12( ; CHECK-NEXT: ret i32 1 } define i32 @test13(i32 %x) nounwind { %tmp3 = sdiv i32 %x, %x ; 1 ret i32 %tmp3 -; CHECK: @test13 +; CHECK-LABEL: @test13( ; CHECK-NEXT: ret i32 1 } @@ -115,7 +115,7 @@ define i32 @test14(i8 %x) nounwind { %zext = zext i8 %x to i32 %div = udiv i32 %zext, 257 ; 0 ret i32 %div -; CHECK: @test14 +; CHECK-LABEL: @test14( ; CHECK-NEXT: ret i32 0 } @@ -125,7 +125,7 @@ define i32 @test15(i32 %a, i32 %b) nounwind { %div = lshr i32 %shl, 2 %div2 = udiv i32 %a, %div ret i32 %div2 -; CHECK: @test15 +; CHECK-LABEL: @test15( ; CHECK-NEXT: add i32 %b, -2 ; CHECK-NEXT: lshr i32 %a, ; CHECK-NEXT: ret i32 diff --git a/test/Transforms/InstCombine/exact.ll b/test/Transforms/InstCombine/exact.ll index 88ca88c..868d60a 100644 --- a/test/Transforms/InstCombine/exact.ll +++ b/test/Transforms/InstCombine/exact.ll @@ -1,20 +1,20 @@ ; RUN: opt < %s -instcombine -S | FileCheck %s -; CHECK: @sdiv1 +; CHECK-LABEL: @sdiv1( ; CHECK: sdiv i32 %x, 8 define i32 @sdiv1(i32 %x) { %y = sdiv i32 %x, 8 ret i32 %y } -; CHECK: @sdiv2 +; CHECK-LABEL: @sdiv2( ; CHECK: ashr exact i32 %x, 3 define i32 @sdiv2(i32 %x) { %y = sdiv exact i32 %x, 8 ret i32 %y } -; CHECK: @sdiv3 +; CHECK-LABEL: @sdiv3( ; CHECK: %y = srem i32 %x, 3 ; CHECK: %z = sub i32 %x, %y ; CHECK: ret i32 %z @@ -24,7 +24,7 @@ define i32 @sdiv3(i32 %x) { ret i32 %z } -; CHECK: @sdiv4 +; CHECK-LABEL: @sdiv4( ; CHECK: ret i32 %x define i32 @sdiv4(i32 %x) { %y = sdiv exact i32 %x, 3 @@ -42,7 +42,7 @@ define i32 @sdiv5(i32 %x) { ret i32 %z } -; CHECK: @sdiv6 +; CHECK-LABEL: @sdiv6( ; CHECK: %z = sub i32 0, %x ; CHECK: ret i32 %z define i32 @sdiv6(i32 %x) { @@ -51,7 +51,7 @@ define i32 @sdiv6(i32 %x) { ret i32 %z } -; CHECK: @udiv1 +; CHECK-LABEL: @udiv1( ; CHECK: ret i32 %x define i32 @udiv1(i32 %x, i32 %w) { %y = udiv exact i32 %x, %w @@ -59,7 +59,7 @@ define i32 @udiv1(i32 %x, i32 %w) { ret i32 %z } -; CHECK: @udiv2 +; CHECK-LABEL: @udiv2( ; CHECK: %z = lshr exact i32 %x, %w ; CHECK: ret i32 %z define i32 @udiv2(i32 %x, i32 %w) { @@ -68,7 +68,7 @@ define i32 @udiv2(i32 %x, i32 %w) { ret i32 %z } -; CHECK: @ashr1 +; CHECK-LABEL: @ashr1( ; CHECK: %B = ashr exact i64 %A, 2 ; CHECK: ret i64 %B define i64 @ashr1(i64 %X) nounwind { @@ -78,7 +78,7 @@ define i64 @ashr1(i64 %X) nounwind { } ; PR9120 -; CHECK: @ashr_icmp1 +; CHECK-LABEL: @ashr_icmp1( ; CHECK: %B = icmp eq i64 %X, 0 ; CHECK: ret i1 %B define i1 @ashr_icmp1(i64 %X) nounwind { @@ -87,7 +87,7 @@ define i1 @ashr_icmp1(i64 %X) nounwind { ret i1 %B } -; CHECK: @ashr_icmp2 +; CHECK-LABEL: @ashr_icmp2( ; CHECK: %Z = icmp slt i64 %X, 16 ; CHECK: ret i1 %Z define i1 @ashr_icmp2(i64 %X) nounwind { @@ -98,7 +98,7 @@ define i1 @ashr_icmp2(i64 %X) nounwind { ; PR9998 ; Make sure we don't transform the ashr here into an sdiv -; CHECK: @pr9998 +; CHECK-LABEL: @pr9998( ; CHECK: [[BIT:%[A-Za-z0-9.]+]] = and i32 %V, 1 ; CHECK-NEXT: [[CMP:%[A-Za-z0-9.]+]] = icmp ne i32 [[BIT]], 0 ; CHECK-NEXT: ret i1 [[CMP]] @@ -113,7 +113,7 @@ entry: -; CHECK: @udiv_icmp1 +; CHECK-LABEL: @udiv_icmp1( ; CHECK: icmp ne i64 %X, 0 define i1 @udiv_icmp1(i64 %X) nounwind { %A = udiv exact i64 %X, 5 ; X/5 @@ -121,7 +121,7 @@ define i1 @udiv_icmp1(i64 %X) nounwind { ret i1 %B } -; CHECK: @sdiv_icmp1 +; CHECK-LABEL: @sdiv_icmp1( ; CHECK: icmp eq i64 %X, 0 define i1 @sdiv_icmp1(i64 %X) nounwind { %A = sdiv exact i64 %X, 5 ; X/5 == 0 --> x == 0 @@ -129,7 +129,7 @@ define i1 @sdiv_icmp1(i64 %X) nounwind { ret i1 %B } -; CHECK: @sdiv_icmp2 +; CHECK-LABEL: @sdiv_icmp2( ; CHECK: icmp eq i64 %X, 5 define i1 @sdiv_icmp2(i64 %X) nounwind { %A = sdiv exact i64 %X, 5 ; X/5 == 1 --> x == 5 @@ -137,7 +137,7 @@ define i1 @sdiv_icmp2(i64 %X) nounwind { ret i1 %B } -; CHECK: @sdiv_icmp3 +; CHECK-LABEL: @sdiv_icmp3( ; CHECK: icmp eq i64 %X, -5 define i1 @sdiv_icmp3(i64 %X) nounwind { %A = sdiv exact i64 %X, 5 ; X/5 == -1 --> x == -5 @@ -145,7 +145,7 @@ define i1 @sdiv_icmp3(i64 %X) nounwind { ret i1 %B } -; CHECK: @sdiv_icmp4 +; CHECK-LABEL: @sdiv_icmp4( ; CHECK: icmp eq i64 %X, 0 define i1 @sdiv_icmp4(i64 %X) nounwind { %A = sdiv exact i64 %X, -5 ; X/-5 == 0 --> x == 0 @@ -153,7 +153,7 @@ define i1 @sdiv_icmp4(i64 %X) nounwind { ret i1 %B } -; CHECK: @sdiv_icmp5 +; CHECK-LABEL: @sdiv_icmp5( ; CHECK: icmp eq i64 %X, -5 define i1 @sdiv_icmp5(i64 %X) nounwind { %A = sdiv exact i64 %X, -5 ; X/-5 == 1 --> x == -5 @@ -161,7 +161,7 @@ define i1 @sdiv_icmp5(i64 %X) nounwind { ret i1 %B } -; CHECK: @sdiv_icmp6 +; CHECK-LABEL: @sdiv_icmp6( ; CHECK: icmp eq i64 %X, 5 define i1 @sdiv_icmp6(i64 %X) nounwind { %A = sdiv exact i64 %X, -5 ; X/-5 == 1 --> x == 5 diff --git a/test/Transforms/InstCombine/exp2-1.ll b/test/Transforms/InstCombine/exp2-1.ll index 1b0ad50..99fb9ec 100644 --- a/test/Transforms/InstCombine/exp2-1.ll +++ b/test/Transforms/InstCombine/exp2-1.ll @@ -10,7 +10,7 @@ declare float @exp2f(float) ; Check exp2(sitofp(x)) -> ldexp(1.0, sext(x)). define double @test_simplify1(i32 %x) { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %conv = sitofp i32 %x to double %ret = call double @exp2(double %conv) ; CHECK: call double @ldexp @@ -18,7 +18,7 @@ define double @test_simplify1(i32 %x) { } define double @test_simplify2(i16 signext %x) { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( %conv = sitofp i16 %x to double %ret = call double @exp2(double %conv) ; CHECK: call double @ldexp @@ -26,7 +26,7 @@ define double @test_simplify2(i16 signext %x) { } define double @test_simplify3(i8 signext %x) { -; CHECK: @test_simplify3 +; CHECK-LABEL: @test_simplify3( %conv = sitofp i8 %x to double %ret = call double @exp2(double %conv) ; CHECK: call double @ldexp @@ -34,7 +34,7 @@ define double @test_simplify3(i8 signext %x) { } define float @test_simplify4(i32 %x) { -; CHECK: @test_simplify4 +; CHECK-LABEL: @test_simplify4( %conv = sitofp i32 %x to float %ret = call float @exp2f(float %conv) ; CHECK: call float @ldexpf @@ -44,7 +44,7 @@ define float @test_simplify4(i32 %x) { ; Check exp2(uitofp(x)) -> ldexp(1.0, zext(x)). define double @test_no_simplify1(i32 %x) { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %conv = uitofp i32 %x to double %ret = call double @exp2(double %conv) ; CHECK: call double @exp2 @@ -52,7 +52,7 @@ define double @test_no_simplify1(i32 %x) { } define double @test_simplify6(i16 zeroext %x) { -; CHECK: @test_simplify6 +; CHECK-LABEL: @test_simplify6( %conv = uitofp i16 %x to double %ret = call double @exp2(double %conv) ; CHECK: call double @ldexp @@ -60,7 +60,7 @@ define double @test_simplify6(i16 zeroext %x) { } define double @test_simplify7(i8 zeroext %x) { -; CHECK: @test_simplify7 +; CHECK-LABEL: @test_simplify7( %conv = uitofp i8 %x to double %ret = call double @exp2(double %conv) ; CHECK: call double @ldexp @@ -68,7 +68,7 @@ define double @test_simplify7(i8 zeroext %x) { } define float @test_simplify8(i8 zeroext %x) { -; CHECK: @test_simplify8 +; CHECK-LABEL: @test_simplify8( %conv = uitofp i8 %x to float %ret = call float @exp2f(float %conv) ; CHECK: call float @ldexpf diff --git a/test/Transforms/InstCombine/exp2-2.ll b/test/Transforms/InstCombine/exp2-2.ll index bed0637..19368dc 100644 --- a/test/Transforms/InstCombine/exp2-2.ll +++ b/test/Transforms/InstCombine/exp2-2.ll @@ -9,7 +9,7 @@ declare float @exp2(double) ; Check that exp2 functions with the wrong prototype aren't simplified. define float @test_no_simplify1(i32 %x) { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %conv = sitofp i32 %x to double %ret = call float @exp2(double %conv) ; CHECK: call float @exp2(double %conv) diff --git a/test/Transforms/InstCombine/extractvalue.ll b/test/Transforms/InstCombine/extractvalue.ll index 5e4c677..04c7ffa 100644 --- a/test/Transforms/InstCombine/extractvalue.ll +++ b/test/Transforms/InstCombine/extractvalue.ll @@ -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]] diff --git a/test/Transforms/InstCombine/fast-math.ll b/test/Transforms/InstCombine/fast-math.ll index edcbcc7..a9a7015 100644 --- a/test/Transforms/InstCombine/fast-math.ll +++ b/test/Transforms/InstCombine/fast-math.ll @@ -6,14 +6,14 @@ define float @fold(float %a) { %mul = fmul fast float %a, 0x3FF3333340000000 %mul1 = fmul fast float %mul, 0x4002666660000000 ret float %mul1 -; CHECK: @fold +; CHECK-LABEL: @fold( ; CHECK: fmul fast float %a, 0x4006147AE0000000 } ; Same testing-case as the one used in fold() except that the operators have ; fixed FP mode. define float @notfold(float %a) { -; CHECK: @notfold +; CHECK-LABEL: @notfold( ; CHECK: %mul = fmul fast float %a, 0x3FF3333340000000 %mul = fmul fast float %a, 0x3FF3333340000000 %mul1 = fmul float %mul, 0x4002666660000000 @@ -21,7 +21,7 @@ define float @notfold(float %a) { } define float @fold2(float %a) { -; CHECK: @fold2 +; CHECK-LABEL: @fold2( ; CHECK: fmul fast float %a, 0x4006147AE0000000 %mul = fmul float %a, 0x3FF3333340000000 %mul1 = fmul fast float %mul, 0x4002666660000000 @@ -33,7 +33,7 @@ define double @fold3(double %f1) { %t1 = fmul fast double 2.000000e+00, %f1 %t2 = fadd fast double %f1, %t1 ret double %t2 -; CHECK: @fold3 +; CHECK-LABEL: @fold3( ; CHECK: fmul fast double %f1, 3.000000e+00 } @@ -43,7 +43,7 @@ define float @fold4(float %f1, float %f2) { %sub1 = fsub float 5.000000e+00, %f2 %add = fadd fast float %sub, %sub1 ret float %add -; CHECK: @fold4 +; CHECK-LABEL: @fold4( ; CHECK: %1 = fadd fast float %f1, %f2 ; CHECK: fsub fast float 9.000000e+00, %1 } @@ -53,7 +53,7 @@ define float @fold5(float %f1, float %f2) { %add = fadd float %f1, 4.000000e+00 %add1 = fadd fast float %add, 5.000000e+00 ret float %add1 -; CHECK: @fold5 +; CHECK-LABEL: @fold5( ; CHECK: fadd fast float %f1, 9.000000e+00 } @@ -62,7 +62,7 @@ define float @fold6(float %f1) { %t1 = fadd fast float %f1, %f1 %t2 = fadd fast float %f1, %t1 ret float %t2 -; CHECK: @fold6 +; CHECK-LABEL: @fold6( ; CHECK: fmul fast float %f1, 3.000000e+00 } @@ -72,7 +72,7 @@ define float @fold7(float %f1) { %t2 = fadd fast float %f1, %f1 %t3 = fadd fast float %t1, %t2 ret float %t3 -; CHECK: @fold7 +; CHECK-LABEL: @fold7( ; CHECK: fmul fast float %f1, 7.000000e+00 } @@ -92,7 +92,7 @@ define float @fold9(float %f1, float %f2) { %t3 = fsub fast float %f1, %t1 ret float %t3 -; CHECK: @fold9 +; CHECK-LABEL: @fold9( ; CHECK: fsub fast float 0.000000e+00, %f2 } @@ -106,7 +106,7 @@ define float @fold10(float %f1, float %f2) { %t2 = fsub fast float %f2, 3.000000e+00 %t3 = fadd fast float %t1, %t2 ret float %t3 -; CHECK: @fold10 +; CHECK-LABEL: @fold10( ; CHECK: %t3 = fadd fast float %t2, -1.000000e+00 ; CHECK: ret float %t3 } @@ -117,7 +117,7 @@ define float @fail1(float %f1, float %f2) { %add = fadd fast float %conv3, %conv3 %add2 = fadd fast float %add, %conv3 ret float %add2 -; CHECK: @fail1 +; CHECK-LABEL: @fail1( ; CHECK: ret } @@ -126,7 +126,7 @@ define double @fail2(double %f1, double %f2) { %t2 = fadd fast double %f1, %f2 %t3 = fsub fast double %t1, %t2 ret double %t3 -; CHECK: @fail2 +; CHECK-LABEL: @fail2( ; CHECK: ret } @@ -152,7 +152,7 @@ define float @fmul_distribute1(float %f1) { %t2 = fadd float %t1, 2.0e+3 %t3 = fmul fast float %t2, 5.0e+3 ret float %t3 -; CHECK: @fmul_distribute1 +; CHECK-LABEL: @fmul_distribute1( ; CHECK: %1 = fmul fast float %f1, 3.000000e+07 ; CHECK: %t3 = fadd fast float %1, 1.000000e+07 } @@ -165,7 +165,7 @@ define double @fmul_distribute2(double %f1, double %f2) { %t3 = fmul fast double %t2, 0x10000000000000 ret double %t3 -; CHECK: @fmul_distribute2 +; CHECK-LABEL: @fmul_distribute2( ; CHECK: %1 = fdiv fast double %f1, 0x7FE8000000000000 ; CHECK: fadd fast double %1, 0x69000000000000 } @@ -178,7 +178,7 @@ define double @fmul_distribute3(double %f1) { %t3 = fmul fast double %t2, 0x10000000000000 ret double %t3 -; CHECK: @fmul_distribute3 +; CHECK-LABEL: @fmul_distribute3( ; CHECK: fmul fast double %t2, 0x10000000000000 } @@ -188,7 +188,7 @@ define float @fmul_distribute4(float %f1) { %t2 = fsub float 2.0e+3, %t1 %t3 = fmul fast float %t2, 5.0e+3 ret float %t3 -; CHECK: @fmul_distribute4 +; CHECK-LABEL: @fmul_distribute4( ; CHECK: %1 = fmul fast float %f1, 3.000000e+07 ; CHECK: %t3 = fsub fast float 1.000000e+07, %1 } @@ -198,7 +198,7 @@ define float @fmul2(float %f1) { %t1 = fdiv float 2.0e+3, %f1 %t3 = fmul fast float %t1, 6.0e+3 ret float %t3 -; CHECK: @fmul2 +; CHECK-LABEL: @fmul2( ; CHECK: fdiv fast float 1.200000e+07, %f1 } @@ -207,7 +207,7 @@ define float @fmul3(float %f1, float %f2) { %t1 = fdiv float %f1, 2.0e+3 %t3 = fmul fast float %t1, 6.0e+3 ret float %t3 -; CHECK: @fmul3 +; CHECK-LABEL: @fmul3( ; CHECK: fmul fast float %f1, 3.000000e+00 } @@ -218,7 +218,7 @@ define float @fmul4(float %f1, float %f2) { %t1 = fdiv float %f1, 2.0e+3 %t3 = fmul fast float %t1, 0x3810000000000000 ret float %t3 -; CHECK: @fmul4 +; CHECK-LABEL: @fmul4( ; CHECK: fmul fast float %t1, 0x3810000000000000 } @@ -229,7 +229,7 @@ define float @fmul5(float %f1, float %f2) { %t1 = fdiv float %f1, 3.0e+0 %t3 = fmul fast float %t1, 0x3810000000000000 ret float %t3 -; CHECK: @fmul5 +; CHECK-LABEL: @fmul5( ; CHECK: fdiv fast float %f1, 0x47E8000000000000 } @@ -238,7 +238,7 @@ define float @fmul6(float %f1, float %f2) { %mul = fmul float %f1, %f2 %mul1 = fmul fast float %mul, %f1 ret float %mul1 -; CHECK: @fmul6 +; CHECK-LABEL: @fmul6( ; CHECK: fmul fast float %f1, %f1 } @@ -248,7 +248,7 @@ define float @fmul7(float %f1, float %f2) { %mul1 = fmul fast float %mul, %f1 %add = fadd float %mul1, %mul ret float %add -; CHECK: @fmul7 +; CHECK-LABEL: @fmul7( ; CHECK: fmul fast float %mul, %f1 } @@ -262,7 +262,7 @@ define float @fneg1(float %f1, float %f2) { %sub1 = fsub nsz float 0.000000e+00, %f2 %mul = fmul float %sub, %sub1 ret float %mul -; CHECK: @fneg1 +; CHECK-LABEL: @fneg1( ; CHECK: fmul float %f1, %f2 } @@ -280,7 +280,7 @@ define float @fdiv1(float %x) { ; 0x3FF3333340000000 = 1.2f ; 0x4002666660000000 = 2.3f ; 0x3FD7303B60000000 = 0.36231884057971014492 -; CHECK: @fdiv1 +; CHECK-LABEL: @fdiv1( ; CHECK: fmul fast float %x, 0x3FD7303B60000000 } @@ -293,7 +293,7 @@ define float @fdiv2(float %x) { ; 0x3FF3333340000000 = 1.2f ; 0x4002666660000000 = 2.3f ; 0x3FE0B21660000000 = 0.52173918485641479492 -; CHECK: @fdiv2 +; CHECK-LABEL: @fdiv2( ; CHECK: fmul fast float %x, 0x3FE0B21660000000 } @@ -303,7 +303,7 @@ define float @fdiv3(float %x) { %div = fdiv float %x, 0x47EFFFFFE0000000 %div1 = fdiv fast float %div, 0x4002666660000000 ret float %div1 -; CHECK: @fdiv3 +; CHECK-LABEL: @fdiv3( ; CHECK: fdiv float %x, 0x47EFFFFFE0000000 } @@ -312,7 +312,7 @@ define float @fdiv4(float %x) { %mul = fmul float %x, 0x47EFFFFFE0000000 %div = fdiv float %mul, 0x3FC99999A0000000 ret float %div -; CHECK: @fdiv4 +; CHECK-LABEL: @fdiv4( ; CHECK: fmul float %x, 0x47EFFFFFE0000000 } @@ -321,7 +321,7 @@ define float @fdiv5(float %f1, float %f2, float %f3) { %t1 = fdiv float %f1, %f2 %t2 = fdiv fast float %t1, %f3 ret float %t2 -; CHECK: @fdiv5 +; CHECK-LABEL: @fdiv5( ; CHECK: fmul float %f2, %f3 } @@ -330,7 +330,7 @@ define float @fdiv6(float %f1, float %f2, float %f3) { %t1 = fdiv float %f1, %f2 %t2 = fdiv fast float %f3, %t1 ret float %t2 -; CHECK: @fdiv6 +; CHECK-LABEL: @fdiv6( ; CHECK: fmul float %f3, %f2 } @@ -339,7 +339,7 @@ define float @fdiv7(float %x) { %t1 = fmul float %x, 3.0e0 %t2 = fdiv fast float 15.0e0, %t1 ret float %t2 -; CHECK: @fdiv7 +; CHECK-LABEL: @fdiv7( ; CHECK: fdiv fast float 5.000000e+00, %x } @@ -348,7 +348,7 @@ define float @fdiv8(float %x) { %t1 = fdiv float %x, 3.0e0 %t2 = fdiv fast float 15.0e0, %t1 ret float %t2 -; CHECK: @fdiv8 +; CHECK-LABEL: @fdiv8( ; CHECK: fdiv fast float 4.500000e+01, %x } @@ -357,7 +357,7 @@ define float @fdiv9(float %x) { %t1 = fdiv float 3.0e0, %x %t2 = fdiv fast float 15.0e0, %t1 ret float %t2 -; CHECK: @fdiv9 +; CHECK-LABEL: @fdiv9( ; CHECK: fmul fast float %x, 5.000000e+00 } @@ -372,7 +372,7 @@ define float @fact_mul1(float %x, float %y, float %z) { %t2 = fmul fast float %y, %z %t3 = fadd fast float %t1, %t2 ret float %t3 -; CHECK: @fact_mul1 +; CHECK-LABEL: @fact_mul1( ; CHECK: fmul fast float %1, %z } @@ -382,7 +382,7 @@ define float @fact_mul2(float %x, float %y, float %z) { %t2 = fmul fast float %y, %z %t3 = fsub fast float %t1, %t2 ret float %t3 -; CHECK: @fact_mul2 +; CHECK-LABEL: @fact_mul2( ; CHECK: fmul fast float %1, %z } @@ -392,7 +392,7 @@ define float @fact_mul3(float %x, float %y, float %z) { %t1 = fmul fast float %z, %x %t3 = fsub fast float %t1, %t2 ret float %t3 -; CHECK: @fact_mul3 +; CHECK-LABEL: @fact_mul3( ; CHECK: fmul fast float %1, %z } @@ -402,7 +402,7 @@ define float @fact_mul4(float %x, float %y, float %z) { %t2 = fmul fast float %z, %y %t3 = fsub fast float %t1, %t2 ret float %t3 -; CHECK: @fact_mul4 +; CHECK-LABEL: @fact_mul4( ; CHECK: fmul fast float %1, %z } diff --git a/test/Transforms/InstCombine/fcmp.ll b/test/Transforms/InstCombine/fcmp.ll index 376fa07..afc6782 100644 --- a/test/Transforms/InstCombine/fcmp.ll +++ b/test/Transforms/InstCombine/fcmp.ll @@ -5,7 +5,7 @@ define i1 @test1(float %x, float %y) nounwind { %ext2 = fpext float %y to double %cmp = fcmp ogt double %ext1, %ext2 ret i1 %cmp -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK-NEXT: fcmp ogt float %x, %y } @@ -13,7 +13,7 @@ define i1 @test2(float %a) nounwind { %ext = fpext float %a to double %cmp = fcmp ogt double %ext, 1.000000e+00 ret i1 %cmp -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK-NEXT: fcmp ogt float %a, 1.0 } @@ -21,7 +21,7 @@ define i1 @test3(float %a) nounwind { %ext = fpext float %a to double %cmp = fcmp ogt double %ext, 0x3FF0000000000001 ; more precision than float. ret i1 %cmp -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK-NEXT: fpext float %a to double } @@ -29,7 +29,7 @@ define i1 @test4(float %a) nounwind { %ext = fpext float %a to double %cmp = fcmp ogt double %ext, 0x36A0000000000000 ; denormal in float. ret i1 %cmp -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK-NEXT: fpext float %a to double } @@ -37,7 +37,7 @@ define i1 @test5(float %a) nounwind { %neg = fsub float -0.000000e+00, %a %cmp = fcmp ogt float %neg, 1.000000e+00 ret i1 %cmp -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK-NEXT: fcmp olt float %a, -1.0 } @@ -46,7 +46,7 @@ define i1 @test6(float %x, float %y) nounwind { %neg2 = fsub float -0.000000e+00, %y %cmp = fcmp olt float %neg1, %neg2 ret i1 %cmp -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK-NEXT: fcmp ogt float %x, %y } @@ -54,7 +54,7 @@ define i1 @test7(float %x) nounwind readnone ssp noredzone { %ext = fpext float %x to ppc_fp128 %cmp = fcmp ogt ppc_fp128 %ext, 0xM00000000000000000000000000000000 ret i1 %cmp -; CHECK: @test7 +; CHECK-LABEL: @test7( ; CHECK-NEXT: fcmp ogt float %x, 0.000000e+00 } @@ -65,7 +65,7 @@ define float @test8(float %x) nounwind readnone optsize ssp { %conv2 = sitofp i32 %conv1 to float ret float %conv2 ; Float comparison to zero shouldn't cast to double. -; CHECK: @test8 +; CHECK-LABEL: @test8( ; CHECK-NEXT: fcmp olt float %x, 0.000000e+00 } @@ -76,7 +76,7 @@ define i32 @test9(double %a) nounwind { %cmp = fcmp olt double %call, 0.000000e+00 %conv = zext i1 %cmp to i32 ret i32 %conv -; CHECK: @test9 +; CHECK-LABEL: @test9( ; CHECK-NOT: fabs ; CHECK: ret i32 0 } @@ -86,7 +86,7 @@ define i32 @test10(double %a) nounwind { %cmp = fcmp ole double %call, 0.000000e+00 %conv = zext i1 %cmp to i32 ret i32 %conv -; CHECK: @test10 +; CHECK-LABEL: @test10( ; CHECK-NOT: fabs ; CHECK: fcmp oeq double %a, 0.000000e+00 } @@ -96,7 +96,7 @@ define i32 @test11(double %a) nounwind { %cmp = fcmp ogt double %call, 0.000000e+00 %conv = zext i1 %cmp to i32 ret i32 %conv -; CHECK: @test11 +; CHECK-LABEL: @test11( ; CHECK-NOT: fabs ; CHECK: fcmp one double %a, 0.000000e+00 } @@ -106,7 +106,7 @@ define i32 @test12(double %a) nounwind { %cmp = fcmp oge double %call, 0.000000e+00 %conv = zext i1 %cmp to i32 ret i32 %conv -; CHECK: @test12 +; CHECK-LABEL: @test12( ; CHECK-NOT: fabs ; CHECK: fcmp ord double %a, 0.000000e+00 } @@ -116,7 +116,7 @@ define i32 @test13(double %a) nounwind { %cmp = fcmp une double %call, 0.000000e+00 %conv = zext i1 %cmp to i32 ret i32 %conv -; CHECK: @test13 +; CHECK-LABEL: @test13( ; CHECK-NOT: fabs ; CHECK: fcmp une double %a, 0.000000e+00 } @@ -126,7 +126,7 @@ define i32 @test14(double %a) nounwind { %cmp = fcmp oeq double %call, 0.000000e+00 %conv = zext i1 %cmp to i32 ret i32 %conv -; CHECK: @test14 +; CHECK-LABEL: @test14( ; CHECK-NOT: fabs ; CHECK: fcmp oeq double %a, 0.000000e+00 } @@ -136,7 +136,7 @@ define i32 @test15(double %a) nounwind { %cmp = fcmp one double %call, 0.000000e+00 %conv = zext i1 %cmp to i32 ret i32 %conv -; CHECK: @test15 +; CHECK-LABEL: @test15( ; CHECK-NOT: fabs ; CHECK: fcmp one double %a, 0.000000e+00 } @@ -146,7 +146,7 @@ define i32 @test16(double %a) nounwind { %cmp = fcmp ueq double %call, 0.000000e+00 %conv = zext i1 %cmp to i32 ret i32 %conv -; CHECK: @test16 +; CHECK-LABEL: @test16( ; CHECK-NOT: fabs ; CHECK: fcmp ueq double %a, 0.000000e+00 } diff --git a/test/Transforms/InstCombine/fdiv.ll b/test/Transforms/InstCombine/fdiv.ll index a2cce01..1edbc5e 100644 --- a/test/Transforms/InstCombine/fdiv.ll +++ b/test/Transforms/InstCombine/fdiv.ll @@ -4,7 +4,7 @@ define float @test1(float %x) nounwind readnone ssp { %div = fdiv float %x, 0x3810000000000000 ret float %div -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK-NEXT: fmul float %x, 0x47D0000000000000 } @@ -12,7 +12,7 @@ define float @test2(float %x) nounwind readnone ssp { %div = fdiv float %x, 0x47E0000000000000 ret float %div -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK-NEXT: fdiv float %x, 0x47E0000000000000 } @@ -20,6 +20,6 @@ define float @test3(float %x) nounwind readnone ssp { %div = fdiv float %x, 0x36A0000000000000 ret float %div -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK-NEXT: fdiv float %x, 0x36A0000000000000 } diff --git a/test/Transforms/InstCombine/ffs-1.ll b/test/Transforms/InstCombine/ffs-1.ll index 0510df3..8f0b38f 100644 --- a/test/Transforms/InstCombine/ffs-1.ll +++ b/test/Transforms/InstCombine/ffs-1.ll @@ -12,21 +12,21 @@ declare i32 @ffsll(i64) ; Check ffs(0) -> 0. define i32 @test_simplify1() { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %ret = call i32 @ffs(i32 0) ret i32 %ret ; CHECK-NEXT: ret i32 0 } define i32 @test_simplify2() { -; CHECK-LINUX: @test_simplify2 +; CHECK-LINUX-LABEL: @test_simplify2( %ret = call i32 @ffsl(i32 0) ret i32 %ret ; CHECK-LINUX-NEXT: ret i32 0 } define i32 @test_simplify3() { -; CHECK-LINUX: @test_simplify3 +; CHECK-LINUX-LABEL: @test_simplify3( %ret = call i32 @ffsll(i64 0) ret i32 %ret ; CHECK-LINUX-NEXT: ret i32 0 @@ -35,63 +35,63 @@ define i32 @test_simplify3() { ; Check ffs(c) -> cttz(c) + 1, where 'c' is a constant. define i32 @test_simplify4() { -; CHECK: @test_simplify4 +; CHECK-LABEL: @test_simplify4( %ret = call i32 @ffs(i32 1) ret i32 %ret ; CHECK-NEXT: ret i32 1 } define i32 @test_simplify5() { -; CHECK: @test_simplify5 +; CHECK-LABEL: @test_simplify5( %ret = call i32 @ffs(i32 2048) ret i32 %ret ; CHECK-NEXT: ret i32 12 } define i32 @test_simplify6() { -; CHECK: @test_simplify6 +; CHECK-LABEL: @test_simplify6( %ret = call i32 @ffs(i32 65536) ret i32 %ret ; CHECK-NEXT: ret i32 17 } define i32 @test_simplify7() { -; CHECK-LINUX: @test_simplify7 +; CHECK-LINUX-LABEL: @test_simplify7( %ret = call i32 @ffsl(i32 65536) ret i32 %ret ; CHECK-LINUX-NEXT: ret i32 17 } define i32 @test_simplify8() { -; CHECK-LINUX: @test_simplify8 +; CHECK-LINUX-LABEL: @test_simplify8( %ret = call i32 @ffsll(i64 1024) ret i32 %ret ; CHECK-LINUX-NEXT: ret i32 11 } define i32 @test_simplify9() { -; CHECK-LINUX: @test_simplify9 +; CHECK-LINUX-LABEL: @test_simplify9( %ret = call i32 @ffsll(i64 65536) ret i32 %ret ; CHECK-LINUX-NEXT: ret i32 17 } define i32 @test_simplify10() { -; CHECK-LINUX: @test_simplify10 +; CHECK-LINUX-LABEL: @test_simplify10( %ret = call i32 @ffsll(i64 17179869184) ret i32 %ret ; CHECK-LINUX-NEXT: ret i32 35 } define i32 @test_simplify11() { -; CHECK-LINUX: @test_simplify11 +; CHECK-LINUX-LABEL: @test_simplify11( %ret = call i32 @ffsll(i64 281474976710656) ret i32 %ret ; CHECK-LINUX-NEXT: ret i32 49 } define i32 @test_simplify12() { -; CHECK-LINUX: @test_simplify12 +; CHECK-LINUX-LABEL: @test_simplify12( %ret = call i32 @ffsll(i64 1152921504606846976) ret i32 %ret ; CHECK-LINUX-NEXT: ret i32 61 @@ -100,7 +100,7 @@ define i32 @test_simplify12() { ; Check ffs(x) -> x != 0 ? (i32)llvm.cttz(x) + 1 : 0. define i32 @test_simplify13(i32 %x) { -; CHECK: @test_simplify13 +; CHECK-LABEL: @test_simplify13( %ret = call i32 @ffs(i32 %x) ; CHECK-NEXT: [[CTTZ:%[a-z0-9]+]] = call i32 @llvm.cttz.i32(i32 %x, i1 false) ; CHECK-NEXT: [[INC:%[a-z0-9]+]] = add i32 [[CTTZ]], 1 @@ -111,7 +111,7 @@ define i32 @test_simplify13(i32 %x) { } define i32 @test_simplify14(i32 %x) { -; CHECK-LINUX: @test_simplify14 +; CHECK-LINUX-LABEL: @test_simplify14( %ret = call i32 @ffsl(i32 %x) ; CHECK-LINUX-NEXT: [[CTTZ:%[a-z0-9]+]] = call i32 @llvm.cttz.i32(i32 %x, i1 false) ; CHECK-LINUX-NEXT: [[INC:%[a-z0-9]+]] = add i32 [[CTTZ]], 1 @@ -122,7 +122,7 @@ define i32 @test_simplify14(i32 %x) { } define i32 @test_simplify15(i64 %x) { -; CHECK-LINUX: @test_simplify15 +; CHECK-LINUX-LABEL: @test_simplify15( %ret = call i32 @ffsll(i64 %x) ; CHECK-LINUX-NEXT: [[CTTZ:%[a-z0-9]+]] = call i64 @llvm.cttz.i64(i64 %x, i1 false) ; CHECK-LINUX-NEXT: [[INC:%[a-z0-9]+]] = add i64 [[CTTZ]], 1 diff --git a/test/Transforms/InstCombine/float-shrink-compare.ll b/test/Transforms/InstCombine/float-shrink-compare.ll index 0b93e84..26f77a7 100644 --- a/test/Transforms/InstCombine/float-shrink-compare.ll +++ b/test/Transforms/InstCombine/float-shrink-compare.ll @@ -9,7 +9,7 @@ define i32 @test1(float %x, float %y) nounwind uwtable { %4 = fcmp oeq double %2, %3 %5 = zext i1 %4 to i32 ret i32 %5 -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK-NEXT: %ceilf = call float @ceilf(float %x) ; CHECK-NEXT: fcmp oeq float %ceilf, %y } @@ -21,7 +21,7 @@ define i32 @test2(float %x, float %y) nounwind uwtable { %4 = fcmp oeq double %2, %3 %5 = zext i1 %4 to i32 ret i32 %5 -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK-NEXT: %fabsf = call float @fabsf(float %x) ; CHECK-NEXT: fcmp oeq float %fabsf, %y } @@ -33,7 +33,7 @@ define i32 @test3(float %x, float %y) nounwind uwtable { %4 = fcmp oeq double %2, %3 %5 = zext i1 %4 to i32 ret i32 %5 -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK-NEXT: %floorf = call float @floorf(float %x) ; CHECK-NEXT: fcmp oeq float %floorf, %y } @@ -45,7 +45,7 @@ define i32 @test4(float %x, float %y) nounwind uwtable { %4 = fcmp oeq double %2, %3 %5 = zext i1 %4 to i32 ret i32 %5 -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK-NEXT: %nearbyintf = call float @nearbyintf(float %x) ; CHECK-NEXT: fcmp oeq float %nearbyintf, %y } @@ -57,7 +57,7 @@ define i32 @test5(float %x, float %y) nounwind uwtable { %4 = fcmp oeq double %2, %3 %5 = zext i1 %4 to i32 ret i32 %5 -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK-NEXT: %rintf = call float @rintf(float %x) ; CHECK-NEXT: fcmp oeq float %rintf, %y } @@ -69,7 +69,7 @@ define i32 @test6(float %x, float %y) nounwind uwtable { %4 = fcmp oeq double %2, %3 %5 = zext i1 %4 to i32 ret i32 %5 -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK-NEXT: %roundf = call float @roundf(float %x) ; CHECK-NEXT: fcmp oeq float %roundf, %y } @@ -81,7 +81,7 @@ define i32 @test7(float %x, float %y) nounwind uwtable { %4 = fcmp oeq double %2, %3 %5 = zext i1 %4 to i32 ret i32 %5 -; CHECK: @test7 +; CHECK-LABEL: @test7( ; CHECK-NEXT: %truncf = call float @truncf(float %x) ; CHECK-NEXT: fcmp oeq float %truncf, %y } @@ -93,7 +93,7 @@ define i32 @test8(float %x, float %y) nounwind uwtable { %4 = fcmp oeq double %1, %3 %5 = zext i1 %4 to i32 ret i32 %5 -; CHECK: @test8 +; CHECK-LABEL: @test8( ; CHECK-NEXT: %ceilf = call float @ceilf(float %x) ; CHECK-NEXT: fcmp oeq float %ceilf, %y } @@ -105,7 +105,7 @@ define i32 @test9(float %x, float %y) nounwind uwtable { %4 = fcmp oeq double %1, %3 %5 = zext i1 %4 to i32 ret i32 %5 -; CHECK: @test9 +; CHECK-LABEL: @test9( ; CHECK-NEXT: %fabsf = call float @fabsf(float %x) ; CHECK-NEXT: fcmp oeq float %fabsf, %y } @@ -117,7 +117,7 @@ define i32 @test10(float %x, float %y) nounwind uwtable { %4 = fcmp oeq double %1, %3 %5 = zext i1 %4 to i32 ret i32 %5 -; CHECK: @test10 +; CHECK-LABEL: @test10( ; CHECK-NEXT: %floorf = call float @floorf(float %x) ; CHECK-NEXT: fcmp oeq float %floorf, %y } @@ -129,7 +129,7 @@ define i32 @test11(float %x, float %y) nounwind uwtable { %4 = fcmp oeq double %1, %3 %5 = zext i1 %4 to i32 ret i32 %5 -; CHECK: @test11 +; CHECK-LABEL: @test11( ; CHECK-NEXT: %nearbyintf = call float @nearbyintf(float %x) ; CHECK-NEXT: fcmp oeq float %nearbyintf, %y } @@ -141,7 +141,7 @@ define i32 @test12(float %x, float %y) nounwind uwtable { %4 = fcmp oeq double %1, %3 %5 = zext i1 %4 to i32 ret i32 %5 -; CHECK: @test12 +; CHECK-LABEL: @test12( ; CHECK-NEXT: %rintf = call float @rintf(float %x) ; CHECK-NEXT: fcmp oeq float %rintf, %y } @@ -153,7 +153,7 @@ define i32 @test13(float %x, float %y) nounwind uwtable { %4 = fcmp oeq double %1, %3 %5 = zext i1 %4 to i32 ret i32 %5 -; CHECK: @test13 +; CHECK-LABEL: @test13( ; CHECK-NEXT: %roundf = call float @roundf(float %x) ; CHECK-NEXT: fcmp oeq float %roundf, %y } @@ -165,7 +165,7 @@ define i32 @test14(float %x, float %y) nounwind uwtable { %4 = fcmp oeq double %1, %3 %5 = zext i1 %4 to i32 ret i32 %5 -; CHECK: @test14 +; CHECK-LABEL: @test14( ; CHECK-NEXT: %truncf = call float @truncf(float %x) ; CHECK-NEXT: fcmp oeq float %truncf, %y } diff --git a/test/Transforms/InstCombine/fmul.ll b/test/Transforms/InstCombine/fmul.ll index 3671b4c..cf57bed 100644 --- a/test/Transforms/InstCombine/fmul.ll +++ b/test/Transforms/InstCombine/fmul.ll @@ -6,7 +6,7 @@ define float @test1(float %x) { %mul = fmul float %sub, 2.0e+1 ret float %mul -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK: fmul float %x, -2.000000e+01 } @@ -16,7 +16,7 @@ define float @test2(float %x) { %mul = fmul float %sub, 2.0e+1 ret float %mul -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK: fmul float %x, -2.000000e+01 } @@ -26,7 +26,7 @@ define float @test3(float %x, float %y) { %sub2 = fsub float -0.000000e+00, %y %mul = fmul float %sub1, %sub2 ret float %mul -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK: fmul float %x, %y } @@ -36,7 +36,7 @@ define float @test4(float %x, float %y) { %sub2 = fsub nsz float 0.000000e+00, %y %mul = fmul float %sub1, %sub2 ret float %mul -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK: fmul float %x, %y } @@ -45,7 +45,7 @@ define float @test5(float %x, float %y) { %sub1 = fsub float -0.000000e+00, %x %mul = fmul float %sub1, %y ret float %mul -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK: %1 = fmul float %x, %y ; CHECK: %mul = fsub float -0.000000e+00, %1 } @@ -55,7 +55,7 @@ define float @test6(float %x, float %y) { %sub1 = fsub nsz float 0.000000e+00, %x %mul = fmul float %sub1, %y ret float %mul -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK: %1 = fmul float %x, %y ; CHECK: %mul = fsub float -0.000000e+00, %1 } @@ -67,6 +67,6 @@ define float @test7(float %x, float %y) { %mul = fmul float %sub1, %y %mul2 = fmul float %mul, %sub1 ret float %mul2 -; CHECK: @test7 +; CHECK-LABEL: @test7( ; CHECK: fsub float -0.000000e+00, %x } diff --git a/test/Transforms/InstCombine/fneg-ext.ll b/test/Transforms/InstCombine/fneg-ext.ll new file mode 100644 index 0000000..922d26a --- /dev/null +++ b/test/Transforms/InstCombine/fneg-ext.ll @@ -0,0 +1,23 @@ +; RUN: opt -instcombine -S < %s | FileCheck %s + +; CHECK: test1 +define double @test1(float %a, double %b) nounwind readnone ssp uwtable { +; CHECK-NOT: fsub +; CHECK: fpext +; CHECK: fadd + %1 = fsub float -0.000000e+00, %a + %2 = fpext float %1 to double + %3 = fsub double %b, %2 + ret double %3 +} + +; CHECK: test2 +define double @test2(float %a, double %b) nounwind readnone ssp uwtable { +; CHECK-NOT: fsub +; CHECK: fpext +; CHECK: fadd fast + %1 = fsub float -0.000000e+00, %a + %2 = fpext float %1 to double + %3 = fsub fast double %b, %2 + ret double %3 +} diff --git a/test/Transforms/InstCombine/fold-bin-operand.ll b/test/Transforms/InstCombine/fold-bin-operand.ll index a8bad0d..d330326 100644 --- a/test/Transforms/InstCombine/fold-bin-operand.ll +++ b/test/Transforms/InstCombine/fold-bin-operand.ll @@ -2,14 +2,14 @@ target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" define i1 @f(i1 %x) { -; CHECK: @f +; CHECK-LABEL: @f( ; CHECK: ret i1 false %b = and i1 %x, icmp eq (i8* inttoptr (i32 1 to i8*), i8* inttoptr (i32 2 to i8*)) ret i1 %b } define i32 @g(i32 %x) { -; CHECK: @g +; CHECK-LABEL: @g( ; CHECK: ret i32 %x %b = add i32 %x, zext (i1 icmp eq (i8* inttoptr (i32 1000000 to i8*), i8* inttoptr (i32 2000000 to i8*)) to i32) ret i32 %b diff --git a/test/Transforms/InstCombine/fold-calls.ll b/test/Transforms/InstCombine/fold-calls.ll index 504f874..1a9a9fd 100644 --- a/test/Transforms/InstCombine/fold-calls.ll +++ b/test/Transforms/InstCombine/fold-calls.ll @@ -1,7 +1,7 @@ ; RUN: opt -instcombine -S < %s | FileCheck %s ; This shouldn't fold, because sin(inf) is invalid. -; CHECK: @foo +; CHECK-LABEL: @foo( ; CHECK: %t = call double @sin(double 0x7FF0000000000000) define double @foo() { %t = call double @sin(double 0x7FF0000000000000) @@ -9,7 +9,7 @@ define double @foo() { } ; This should fold. -; CHECK: @bar +; CHECK-LABEL: @bar( ; CHECK: ret double 0.0 define double @bar() { %t = call double @sin(double 0.0) diff --git a/test/Transforms/InstCombine/fold-fops-into-selects.ll b/test/Transforms/InstCombine/fold-fops-into-selects.ll new file mode 100644 index 0000000..07aebb1 --- /dev/null +++ b/test/Transforms/InstCombine/fold-fops-into-selects.ll @@ -0,0 +1,71 @@ +; RUN: opt < %s -instcombine -S | FileCheck %s + +define float @test1(i1 %A) { +EntryBlock: + %cf = select i1 %A, float 1.000000e+00, float 0.000000e+00 + %op = fsub float 1.000000e+00, %cf + ret float %op +; CHECK-LABEL: @test1( +; CHECK: select i1 %A, float 0.000000e+00, float 1.000000e+00 +} + +define float @test2(i1 %A, float %B) { +EntryBlock: + %cf = select i1 %A, float 1.000000e+00, float %B + %op = fadd float 2.000000e+00, %cf + ret float %op +; CHECK-LABEL: @test2( +; CHECK: [[OP:%.*]] = fadd float %B, 2.000000e+00 +; CHECK: select i1 %A, float 3.000000e+00, float [[OP]] +} + +define float @test3(i1 %A, float %B) { +EntryBlock: + %cf = select i1 %A, float 1.000000e+00, float %B + %op = fsub float 2.000000e+00, %cf + ret float %op +; CHECK-LABEL: @test3( +; CHECK: [[OP:%.*]] = fsub float 2.000000e+00, %B +; CHECK: select i1 %A, float 1.000000e+00, float [[OP]] +} + +define float @test4(i1 %A, float %B) { +EntryBlock: + %cf = select i1 %A, float 1.000000e+00, float %B + %op = fmul float 2.000000e+00, %cf + ret float %op +; CHECK-LABEL: @test4( +; CHECK: [[OP:%.*]] = fmul float %B, 2.000000e+00 +; CHECK: select i1 %A, float 2.000000e+00, float [[OP]] +} + +define float @test5(i1 %A, float %B) { +EntryBlock: + %cf = select i1 %A, float 1.000000e+00, float %B + %op = fdiv float 2.000000e+00, %cf + ret float %op +; CHECK-LABEL: @test5( +; CHECK: [[OP:%.*]] = fdiv float 2.000000e+00, %B +; CHECK: select i1 %A, float 2.000000e+00, float [[OP]] +} + +define float @test6(i1 %A, float %B) { +EntryBlock: + %cf = select i1 %A, float 1.000000e+00, float %B + %op = fdiv float %cf, 2.000000e+00 + ret float %op +; CHECK-LABEL: @test6( +; CHECK: [[OP:%.*]] = fmul float %B, 5.000000e-01 +; CHECK: select i1 %A, float 5.000000e-01, float [[OP]] +} + +define float @test7(i1 %A, float %B) { +EntryBlock: + %cf = select i1 %A, float 1.000000e+00, float %B + %op = fdiv float %cf, 3.000000e+00 + ret float %op +; CHECK-LABEL: @test7( +; CHECK: [[OP:%.*]] = fdiv float %B, 3.000000e+00 +; CHECK: select i1 %A, float 0x3FD5555560000000, float [[OP]] +} + diff --git a/test/Transforms/InstCombine/fprintf-1.ll b/test/Transforms/InstCombine/fprintf-1.ll index e1dc191..1b7c104 100644 --- a/test/Transforms/InstCombine/fprintf-1.ll +++ b/test/Transforms/InstCombine/fprintf-1.ll @@ -18,7 +18,7 @@ declare i32 @fprintf(%FILE*, i8*, ...) ; Check fprintf(fp, "foo") -> fwrite("foo", 3, 1, fp). define void @test_simplify1(%FILE* %fp) { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %fmt = getelementptr [13 x i8]* @hello_world, i32 0, i32 0 call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* %fmt) ; CHECK-NEXT: call i32 @fwrite(i8* getelementptr inbounds ([13 x i8]* @hello_world, i32 0, i32 0), i32 12, i32 1, %FILE* %fp) @@ -29,7 +29,7 @@ define void @test_simplify1(%FILE* %fp) { ; Check fprintf(fp, "%c", chr) -> fputc(chr, fp). define void @test_simplify2(%FILE* %fp) { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( %fmt = getelementptr [3 x i8]* @percent_c, i32 0, i32 0 call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* %fmt, i8 104) ; CHECK-NEXT: call i32 @fputc(i32 104, %FILE* %fp) @@ -41,7 +41,7 @@ define void @test_simplify2(%FILE* %fp) { ; NOTE: The fputs simplifier simplifies this further to fwrite. define void @test_simplify3(%FILE* %fp) { -; CHECK: @test_simplify3 +; CHECK-LABEL: @test_simplify3( %fmt = getelementptr [3 x i8]* @percent_s, i32 0, i32 0 %str = getelementptr [13 x i8]* @hello_world, i32 0, i32 0 call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* %fmt, i8* %str) @@ -53,7 +53,7 @@ define void @test_simplify3(%FILE* %fp) { ; Check fprintf(fp, fmt, ...) -> fiprintf(fp, fmt, ...) if no floating point. define void @test_simplify4(%FILE* %fp) { -; CHECK-IPRINTF: @test_simplify4 +; CHECK-IPRINTF-LABEL: @test_simplify4( %fmt = getelementptr [3 x i8]* @percent_d, i32 0, i32 0 call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* %fmt, i32 187) ; CHECK-NEXT-IPRINTF: call i32 (%FILE*, i8*, ...)* @fiprintf(%FILE* %fp, i8* getelementptr inbounds ([3 x i8]* @percent_d, i32 0, i32 0), i32 187) @@ -62,7 +62,7 @@ define void @test_simplify4(%FILE* %fp) { } define void @test_no_simplify1(%FILE* %fp) { -; CHECK-IPRINTF: @test_no_simplify1 +; CHECK-IPRINTF-LABEL: @test_no_simplify1( %fmt = getelementptr [3 x i8]* @percent_f, i32 0, i32 0 call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* %fmt, double 1.87) ; CHECK-NEXT-IPRINTF: call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* getelementptr inbounds ([3 x i8]* @percent_f, i32 0, i32 0), double 1.870000e+00) @@ -71,7 +71,7 @@ define void @test_no_simplify1(%FILE* %fp) { } define void @test_no_simplify2(%FILE* %fp, double %d) { -; CHECK: @test_no_simplify2 +; CHECK-LABEL: @test_no_simplify2( %fmt = getelementptr [3 x i8]* @percent_f, i32 0, i32 0 call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* %fmt, double %d) ; CHECK-NEXT: call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* getelementptr inbounds ([3 x i8]* @percent_f, i32 0, i32 0), double %d) @@ -80,7 +80,7 @@ define void @test_no_simplify2(%FILE* %fp, double %d) { } define i32 @test_no_simplify3(%FILE* %fp) { -; CHECK: @test_no_simplify3 +; CHECK-LABEL: @test_no_simplify3( %fmt = getelementptr [13 x i8]* @hello_world, i32 0, i32 0 %1 = call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* %fmt) ; CHECK-NEXT: call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* getelementptr inbounds ([13 x i8]* @hello_world, i32 0, i32 0)) diff --git a/test/Transforms/InstCombine/fputs-1.ll b/test/Transforms/InstCombine/fputs-1.ll index c7c5bec..473610e 100644 --- a/test/Transforms/InstCombine/fputs-1.ll +++ b/test/Transforms/InstCombine/fputs-1.ll @@ -15,7 +15,7 @@ declare i32 @fputs(i8*, %FILE*) ; Check fputs(str, fp) --> fwrite(str, 1, strlen(s), fp). define void @test_simplify1(%FILE* %fp) { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %str = getelementptr [1 x i8]* @empty, i32 0, i32 0 call i32 @fputs(i8* %str, %FILE* %fp) ret void @@ -25,7 +25,7 @@ define void @test_simplify1(%FILE* %fp) { ; NOTE: The fwrite simplifier simplifies this further to fputc. define void @test_simplify2(%FILE* %fp) { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( %str = getelementptr [2 x i8]* @A, i32 0, i32 0 call i32 @fputs(i8* %str, %FILE* %fp) ; CHECK-NEXT: call i32 @fputc(i32 65, %FILE* %fp) @@ -34,7 +34,7 @@ define void @test_simplify2(%FILE* %fp) { } define void @test_simplify3(%FILE* %fp) { -; CHECK: @test_simplify3 +; CHECK-LABEL: @test_simplify3( %str = getelementptr [7 x i8]* @hello, i32 0, i32 0 call i32 @fputs(i8* %str, %FILE* %fp) ; CHECK-NEXT: call i32 @fwrite(i8* getelementptr inbounds ([7 x i8]* @hello, i32 0, i32 0), i32 6, i32 1, %FILE* %fp) diff --git a/test/Transforms/InstCombine/fwrite-1.ll b/test/Transforms/InstCombine/fwrite-1.ll index 528cdec..6f9a8e4 100644 --- a/test/Transforms/InstCombine/fwrite-1.ll +++ b/test/Transforms/InstCombine/fwrite-1.ll @@ -14,7 +14,7 @@ declare i64 @fwrite(i8*, i64, i64, %FILE *) ; Check fwrite(S, 1, 1, fp) -> fputc(S[0], fp). define void @test_simplify1(%FILE* %fp) { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %str = getelementptr inbounds [1 x i8]* @str, i64 0, i64 0 call i64 @fwrite(i8* %str, i64 1, i64 1, %FILE* %fp) ; CHECK-NEXT: call i32 @fputc(i32 0, %FILE* %fp) @@ -23,7 +23,7 @@ define void @test_simplify1(%FILE* %fp) { } define void @test_simplify2(%FILE* %fp) { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( %str = getelementptr inbounds [0 x i8]* @empty, i64 0, i64 0 call i64 @fwrite(i8* %str, i64 1, i64 0, %FILE* %fp) ret void @@ -31,7 +31,7 @@ define void @test_simplify2(%FILE* %fp) { } define void @test_simplify3(%FILE* %fp) { -; CHECK: @test_simplify3 +; CHECK-LABEL: @test_simplify3( %str = getelementptr inbounds [0 x i8]* @empty, i64 0, i64 0 call i64 @fwrite(i8* %str, i64 0, i64 1, %FILE* %fp) ret void @@ -39,7 +39,7 @@ define void @test_simplify3(%FILE* %fp) { } define i64 @test_no_simplify1(%FILE* %fp) { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %str = getelementptr inbounds [1 x i8]* @str, i64 0, i64 0 %ret = call i64 @fwrite(i8* %str, i64 1, i64 1, %FILE* %fp) ; CHECK-NEXT: call i64 @fwrite @@ -48,7 +48,7 @@ define i64 @test_no_simplify1(%FILE* %fp) { } define void @test_no_simplify2(%FILE* %fp, i64 %size) { -; CHECK: @test_no_simplify2 +; CHECK-LABEL: @test_no_simplify2( %str = getelementptr inbounds [1 x i8]* @str, i64 0, i64 0 call i64 @fwrite(i8* %str, i64 %size, i64 1, %FILE* %fp) ; CHECK-NEXT: call i64 @fwrite diff --git a/test/Transforms/InstCombine/getelementptr.ll b/test/Transforms/InstCombine/getelementptr.ll index bb07736..90f144a 100644 --- a/test/Transforms/InstCombine/getelementptr.ll +++ b/test/Transforms/InstCombine/getelementptr.ll @@ -13,7 +13,7 @@ target datalayout = "e-p:64:64" define i32* @test1(i32* %I) { %A = getelementptr i32* %I, i64 0 ret i32* %A -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK: ret i32* %I } @@ -21,7 +21,7 @@ define i32* @test1(i32* %I) { define i32* @test2(i32* %I) { %A = getelementptr i32* %I ret i32* %A -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK: ret i32* %I } @@ -30,7 +30,7 @@ define i32* @test3(i32* %I) { %A = getelementptr i32* %I, i64 17 %B = getelementptr i32* %A, i64 4 ret i32* %B -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK: getelementptr i32* %I, i64 21 } @@ -39,7 +39,7 @@ define i32* @test4({ i32 }* %I) { %A = getelementptr { i32 }* %I, i64 1 %B = getelementptr { i32 }* %A, i64 0, i32 0 ret i32* %B -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK: getelementptr { i32 }* %I, i64 1, i32 0 } @@ -48,7 +48,7 @@ define void @test5(i8 %B) { %A = getelementptr [10 x i8]* @Global, i64 0, i64 4 store i8 %B, i8* %A ret void -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK: store i8 %B, i8* getelementptr inbounds ([10 x i8]* @Global, i64 0, i64 4) } @@ -57,7 +57,7 @@ define i32* @test7(i32* %I, i64 %C, i64 %D) { %A = getelementptr i32* %I, i64 %C %B = getelementptr i32* %A, i64 %D ret i32* %B -; CHECK: @test7 +; CHECK-LABEL: @test7( ; CHECK: %A.sum = add i64 %C, %D ; CHECK: getelementptr i32* %I, i64 %A.sum } @@ -67,7 +67,7 @@ define i8* @test8([10 x i32]* %X) { %A = getelementptr [10 x i32]* %X, i64 0, i64 0 %B = bitcast i32* %A to i8* ret i8* %B -; CHECK: @test8 +; CHECK-LABEL: @test8( ; CHECK: bitcast [10 x i32]* %X to i8* } @@ -75,7 +75,7 @@ define i32 @test9() { %A = getelementptr { i32, double }* null, i32 0, i32 1 %B = ptrtoint double* %A to i32 ret i32 %B -; CHECK: @test9 +; CHECK-LABEL: @test9( ; CHECK: ret i32 8 } @@ -85,7 +85,7 @@ define i1 @test10({ i32, i32 }* %x, { i32, i32 }* %y) { ;; seteq x, y %tmp.4 = icmp eq i32* %tmp.1, %tmp.3 ret i1 %tmp.4 -; CHECK: @test10 +; CHECK-LABEL: @test10( ; CHECK: icmp eq { i32, i32 }* %x, %y } @@ -93,7 +93,7 @@ define i1 @test11({ i32, i32 }* %X) { %P = getelementptr { i32, i32 }* %X, i32 0, i32 0 %Q = icmp eq i32* %P, null ret i1 %Q -; CHECK: @test11 +; CHECK-LABEL: @test11( ; CHECK: icmp eq { i32, i32 }* %X, null } @@ -111,7 +111,7 @@ entry: %g5 = getelementptr %struct.A* %new_a, i32 0, i32 1 %a_a = load i32* %g5, align 4 ret i32 %a_a -; CHECK: @test12 +; CHECK-LABEL: @test12( ; CHECK: getelementptr %struct.A* %a, i64 0, i32 1 ; CHECK-NEXT: store i32 10, i32* %g3 ; CHECK-NEXT: ret i32 10 @@ -125,7 +125,7 @@ define i1 @test13(i64 %X, %S* %P) { %B = getelementptr inbounds %S* %P, i32 0, i32 0 %C = icmp eq i32* %A, %B ret i1 %C -; CHECK: @test13 +; CHECK-LABEL: @test13( ; CHECK: %C = icmp eq i64 %X, -1 } @@ -135,7 +135,7 @@ define i8* @test14(i32 %Idx) { %idx = zext i32 %Idx to i64 %tmp = getelementptr i8* getelementptr ([3 x i8]* @G, i32 0, i32 0), i64 %idx ret i8* %tmp -; CHECK: @test14 +; CHECK-LABEL: @test14( ; CHECK: getelementptr [3 x i8]* @G, i64 0, i64 %idx } @@ -145,7 +145,7 @@ define i8* @test14(i32 %Idx) { define i32 *@test15(i64 %X) { %A = getelementptr i32* getelementptr ([40 x i32]* @Array, i64 0, i64 0), i64 %X ret i32* %A -; CHECK: @test15 +; CHECK-LABEL: @test15( ; CHECK: getelementptr [40 x i32]* @Array, i64 0, i64 %X } @@ -153,7 +153,7 @@ define i32 *@test15(i64 %X) { define i32* @test16(i32* %X, i32 %Idx) { %R = getelementptr i32* %X, i32 %Idx ret i32* %R -; CHECK: @test16 +; CHECK-LABEL: @test16( ; CHECK: sext i32 %Idx to i64 } @@ -163,7 +163,7 @@ define i1 @test17(i16* %P, i32 %I, i32 %J) { %Y = getelementptr inbounds i16* %P, i32 %J %C = icmp ult i16* %X, %Y ret i1 %C -; CHECK: @test17 +; CHECK-LABEL: @test17( ; CHECK: %C = icmp slt i32 %I, %J } @@ -171,7 +171,7 @@ define i1 @test18(i16* %P, i32 %I) { %X = getelementptr inbounds i16* %P, i32 %I %C = icmp ult i16* %X, %P ret i1 %C -; CHECK: @test18 +; CHECK-LABEL: @test18( ; CHECK: %C = icmp slt i32 %I, 0 } @@ -181,7 +181,7 @@ define i32 @test19(i32* %P, i32 %A, i32 %B) { %tmp.10 = icmp eq i32* %tmp.4, %tmp.9 %tmp.11 = zext i1 %tmp.10 to i32 ret i32 %tmp.11 -; CHECK: @test19 +; CHECK-LABEL: @test19( ; CHECK: icmp eq i32 %A, %B } @@ -190,7 +190,7 @@ define i32 @test20(i32* %P, i32 %A, i32 %B) { %tmp.6 = icmp eq i32* %tmp.4, %P %tmp.7 = zext i1 %tmp.6 to i32 ret i32 %tmp.7 -; CHECK: @test20 +; CHECK-LABEL: @test20( ; CHECK: icmp eq i32 %A, 0 } @@ -201,7 +201,7 @@ define i32 @test21() { %pbobel = getelementptr %intstruct* %pbob2, i64 0, i32 0 %rval = load i32* %pbobel ret i32 %rval -; CHECK: @test21 +; CHECK-LABEL: @test21( ; CHECK: getelementptr %intstruct* %pbob1, i64 0, i32 0 } @@ -213,7 +213,7 @@ define i1 @test22() { %C = icmp ult i32* getelementptr (i32* @A, i64 1), getelementptr (i32* @B, i64 2) ret i1 %C -; CHECK: @test22 +; CHECK-LABEL: @test22( ; CHECK: icmp ult (i32* getelementptr inbounds (i32* @A, i64 1), i32* getelementptr (i32* @B, i64 2)) } @@ -224,7 +224,7 @@ define i1 @test23() { %A = getelementptr %X* null, i64 0, i32 0, i64 0 ; <i32*> [#uses=1] %B = icmp ne i32* %A, null ; <i1> [#uses=1] ret i1 %B -; CHECK: @test23 +; CHECK-LABEL: @test23( ; CHECK: ret i1 false } @@ -239,7 +239,7 @@ entry: %tmp27.i = sext i32 %sext to i64 ; <i64> [#uses=1] tail call void @foo25( i32 0, i64 %tmp27.i ) unreachable -; CHECK: @test25 +; CHECK-LABEL: @test25( } declare void @foo25(i32, i64) @@ -251,7 +251,7 @@ define i1 @test26(i8* %arr) { %Y = getelementptr i8* %arr, i32 1 %test = icmp uge i8* %X, %Y ret i1 %test -; CHECK: @test26 +; CHECK-LABEL: @test26( ; CHECK: ret i1 true } @@ -275,7 +275,7 @@ entry: "=r,ir,*m,i,0,~{dirflag},~{fpsr},~{flags}"( i32 %tmp351, %struct.__large_struct* null, i32 -14, i32 0 ) unreachable -; CHECK: @test27 +; CHECK-LABEL: @test27( } ; PR1978 @@ -303,7 +303,7 @@ bb10: bb17: ret i32 0 -; CHECK: @test28 +; CHECK-LABEL: @test28( ; CHECK: icmp eq i32 %indvar, 0 } @@ -332,7 +332,7 @@ if.then216: if.end363: ret i32 0 -; CHECK: @test29 +; CHECK-LABEL: @test29( } @@ -345,7 +345,7 @@ entry: %2 = getelementptr [0 x i32]* %1, i32 0, i32 %m %3 = load i32* %2, align 4 ret i32 %3 -; CHECK: @test30 +; CHECK-LABEL: @test30( ; CHECK: getelementptr i32 } @@ -358,7 +358,7 @@ define i1 @test31(i32* %A) { %C = getelementptr i32* %A, i64 1 %V = icmp eq i32* %B, %C ret i1 %V -; CHECK: @test31 +; CHECK-LABEL: @test31( ; CHECK: ret i1 true } @@ -375,7 +375,7 @@ define i8* @test32(i8* %v) { %F = getelementptr [4 x i8*]* %A, i32 0, i32 2 %G = load i8** %F ret i8* %G -; CHECK: @test32 +; CHECK-LABEL: @test32( ; CHECK: %D = getelementptr [4 x i8*]* %A, i64 0, i64 1 ; CHECK: %F = getelementptr [4 x i8*]* %A, i64 0, i64 2 } @@ -388,7 +388,7 @@ define i32 *@test33(%struct.Key *%A) { %B = bitcast %struct.Key* %A to %struct.anon* %C = getelementptr %struct.anon* %B, i32 0, i32 2 ret i32 *%C -; CHECK: @test33 +; CHECK-LABEL: @test33( ; CHECK: getelementptr %struct.Key* %A, i64 0, i32 0, i32 1 } @@ -404,7 +404,7 @@ entry: store i64 %V, i64* %mrv_gep %C = load i8** %B, align 8 ret i8* %C -; CHECK: @test34 +; CHECK-LABEL: @test34( ; CHECK: %V.c = inttoptr i64 %V to i8* ; CHECK: ret i8* %V.c } @@ -423,7 +423,7 @@ define i32 @test35() nounwind { call i32 (i8*, ...)* @printf(i8* getelementptr ([17 x i8]* @"\01LC8", i32 0, i32 0), i8* getelementptr (%t1* bitcast (%t0* @s to %t1*), i32 0, i32 1, i32 0)) nounwind ret i32 0 -; CHECK: @test35 +; CHECK-LABEL: @test35( ; CHECK: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([17 x i8]* @"\01LC8", i64 0, i64 0), i8* getelementptr inbounds (%t0* @s, i64 0, i32 1, i64 0)) [[NUW:#[0-9]+]] } @@ -434,14 +434,14 @@ define i32 @test35() nounwind { define i8* @test36() nounwind { ret i8* getelementptr ([11 x i8]* @array, i32 0, i64 -1) -; CHECK: @test36 +; CHECK-LABEL: @test36( ; CHECK: ret i8* getelementptr ([11 x i8]* @array, i64 1676976733973595601, i64 4) } ; Instcombine shouldn't assume that gep(A,0,1) != gep(A,1,0). @A37 = external constant [1 x i8] define i1 @test37() nounwind { -; CHECK: @test37 +; CHECK-LABEL: @test37( ; CHECK: ret i1 true %t = icmp eq i8* getelementptr ([1 x i8]* @A37, i64 0, i64 1), getelementptr ([1 x i8]* @A37, i64 1, i64 0) @@ -452,7 +452,7 @@ define i1 @test37() nounwind { define i32* @test38(i32* %I, i32 %n) { %A = getelementptr i32* %I, i32 %n ret i32* %A -; CHECK: @test38 +; CHECK-LABEL: @test38( ; CHECK: = sext i32 %n to i64 ; CHECK: %A = getelementptr i32* %I, i64 % } @@ -469,7 +469,7 @@ entry: call void @pr10322_f3(i8** %tmp2) nounwind ret void -; CHECK: @pr10322_f1 +; CHECK-LABEL: @pr10322_f1( ; CHECK: %tmp2 = getelementptr inbounds %pr10322_t* %arrayidx8, i64 0, i32 0 } @@ -485,7 +485,7 @@ define void @three_gep_f(%three_gep_t2* %x) { %gep3 = getelementptr %three_gep_t* %gep2, i64 0, i32 0 call void @three_gep_g(i32* %gep3) -; CHECK: @three_gep_f +; CHECK-LABEL: @three_gep_f( ; CHECK: %gep3 = getelementptr %three_gep_t2* %gep1, i64 0, i32 0, i32 0 ret void } @@ -504,9 +504,19 @@ define void @test39(%struct.ham* %arg, i8 %arg1) nounwind { store i8 %arg1, i8* %tmp4, align 8 ret void -; CHECK: @test39 +; CHECK-LABEL: @test39( ; CHECK: getelementptr inbounds %struct.ham* %arg, i64 0, i32 2 ; CHECK: getelementptr inbounds i8* %tmp3, i64 -8 } +define i1 @pr16483([1 x i8]* %a, [1 x i8]* %b) { + %c = getelementptr [1 x i8]* %a, i32 0, i32 0 + %d = getelementptr [1 x i8]* %b, i32 0, i32 0 + %cmp = icmp ult i8* %c, %d + ret i1 %cmp + +; CHECK-LABEL: @pr16483( +; CHECK-NEXT: icmp ult [1 x i8]* %a, %b +} + ; CHECK: attributes [[NUW]] = { nounwind } diff --git a/test/Transforms/InstCombine/icmp.ll b/test/Transforms/InstCombine/icmp.ll index 5248a89..dfeac67 100644 --- a/test/Transforms/InstCombine/icmp.ll +++ b/test/Transforms/InstCombine/icmp.ll @@ -8,7 +8,7 @@ entry: icmp slt i32 %X, 0 ; <i1>:0 [#uses=1] zext i1 %0 to i32 ; <i32>:1 [#uses=1] ret i32 %1 -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK: lshr i32 %X, 31 ; CHECK-NEXT: ret i32 } @@ -18,7 +18,7 @@ entry: icmp ult i32 %X, -2147483648 ; <i1>:0 [#uses=1] zext i1 %0 to i32 ; <i32>:1 [#uses=1] ret i32 %1 -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK: lshr i32 %X, 31 ; CHECK-NEXT: xor i32 ; CHECK-NEXT: ret i32 @@ -29,7 +29,7 @@ entry: icmp slt i32 %X, 0 ; <i1>:0 [#uses=1] sext i1 %0 to i32 ; <i32>:1 [#uses=1] ret i32 %1 -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK: ashr i32 %X, 31 ; CHECK-NEXT: ret i32 } @@ -39,7 +39,7 @@ entry: icmp ult i32 %X, -2147483648 ; <i1>:0 [#uses=1] sext i1 %0 to i32 ; <i32>:1 [#uses=1] ret i32 %1 -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK: ashr i32 %X, 31 ; CHECK-NEXT: xor i32 ; CHECK-NEXT: ret i32 @@ -50,7 +50,7 @@ define <2 x i1> @test5(<2 x i64> %x) { entry: %V = icmp eq <2 x i64> %x, undef ret <2 x i1> %V -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK: ret <2 x i1> <i1 true, i1 true> } @@ -60,7 +60,7 @@ define i32 @test6(i32 %a, i32 %b) { %e = sub i32 0, %d %f = and i32 %e, %b ret i32 %f -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK-NEXT: ashr i32 %a, 31 ; CHECK-NEXT: %f = and i32 %e, %b ; CHECK-NEXT: ret i32 %f @@ -72,7 +72,7 @@ entry: %a = add i32 %x, -1 %b = icmp ult i32 %a, %x ret i1 %b -; CHECK: @test7 +; CHECK-LABEL: @test7( ; CHECK: %b = icmp ne i32 %x, 0 ; CHECK: ret i1 %b } @@ -82,7 +82,7 @@ entry: %a = add i32 %x, -1 %b = icmp eq i32 %a, %x ret i1 %b -; CHECK: @test8 +; CHECK-LABEL: @test8( ; CHECK: ret i1 false } @@ -91,7 +91,7 @@ entry: %a = add i32 %x, -2 %b = icmp ugt i32 %x, %a ret i1 %b -; CHECK: @test9 +; CHECK-LABEL: @test9( ; CHECK: icmp ugt i32 %x, 1 ; CHECK: ret i1 %b } @@ -102,7 +102,7 @@ entry: %b = icmp slt i32 %a, %x ret i1 %b -; CHECK: @test10 +; CHECK-LABEL: @test10( ; CHECK: %b = icmp ne i32 %x, -2147483648 ; CHECK: ret i1 %b } @@ -111,7 +111,7 @@ define i1 @test11(i32 %x) { %a = add nsw i32 %x, 8 %b = icmp slt i32 %x, %a ret i1 %b -; CHECK: @test11 +; CHECK-LABEL: @test11( ; CHECK: ret i1 true } @@ -120,7 +120,7 @@ define i1 @test12(i1 %A) { %S = select i1 %A, i64 -4294967295, i64 8589934591 %B = icmp ne i64 bitcast (<2 x i32> <i32 1, i32 -1> to i64), %S ret i1 %B -; CHECK: @test12 +; CHECK-LABEL: @test12( ; CHECK-NEXT: = xor i1 %A, true ; CHECK-NEXT: ret i1 } @@ -130,7 +130,7 @@ define i1 @test13(i8 %X) nounwind readnone { entry: %cmp = icmp slt i8 undef, %X ret i1 %cmp -; CHECK: @test13 +; CHECK-LABEL: @test13( ; CHECK: ret i1 false } @@ -138,7 +138,7 @@ define i1 @test14(i8 %X) nounwind readnone { entry: %cmp = icmp slt i8 undef, -128 ret i1 %cmp -; CHECK: @test14 +; CHECK-LABEL: @test14( ; CHECK: ret i1 false } @@ -146,7 +146,7 @@ define i1 @test15() nounwind readnone { entry: %cmp = icmp eq i8 undef, -128 ret i1 %cmp -; CHECK: @test15 +; CHECK-LABEL: @test15( ; CHECK: ret i1 undef } @@ -154,7 +154,7 @@ define i1 @test16() nounwind readnone { entry: %cmp = icmp ne i8 undef, -128 ret i1 %cmp -; CHECK: @test16 +; CHECK-LABEL: @test16( ; CHECK: ret i1 undef } @@ -163,7 +163,7 @@ define i1 @test17(i32 %x) nounwind { %and = and i32 %shl, 8 %cmp = icmp eq i32 %and, 0 ret i1 %cmp -; CHECK: @test17 +; CHECK-LABEL: @test17( ; CHECK-NEXT: %cmp = icmp ne i32 %x, 3 } @@ -173,7 +173,7 @@ define i1 @test18(i32 %x) nounwind { %and = and i32 %sh, 1 %cmp = icmp eq i32 %and, 0 ret i1 %cmp -; CHECK: @test18 +; CHECK-LABEL: @test18( ; CHECK-NEXT: %cmp = icmp ne i32 %x, 3 } @@ -182,7 +182,7 @@ define i1 @test19(i32 %x) nounwind { %and = and i32 %shl, 8 %cmp = icmp eq i32 %and, 8 ret i1 %cmp -; CHECK: @test19 +; CHECK-LABEL: @test19( ; CHECK-NEXT: %cmp = icmp eq i32 %x, 3 } @@ -191,12 +191,12 @@ define i1 @test20(i32 %x) nounwind { %and = and i32 %shl, 8 %cmp = icmp ne i32 %and, 0 ret i1 %cmp -; CHECK: @test20 +; CHECK-LABEL: @test20( ; CHECK-NEXT: %cmp = icmp eq i32 %x, 3 } define i1 @test21(i8 %x, i8 %y) { -; CHECK: @test21 +; CHECK-LABEL: @test21( ; CHECK-NOT: or i8 ; CHECK: icmp ugt %A = or i8 %x, 1 @@ -205,7 +205,7 @@ define i1 @test21(i8 %x, i8 %y) { } define i1 @test22(i8 %x, i8 %y) { -; CHECK: @test22 +; CHECK-LABEL: @test22( ; CHECK-NOT: or i8 ; CHECK: icmp ult %A = or i8 %x, 1 @@ -214,7 +214,7 @@ define i1 @test22(i8 %x, i8 %y) { } ; PR2740 -; CHECK: @test23 +; CHECK-LABEL: @test23( ; CHECK: icmp sgt i32 %x, 1328634634 define i1 @test23(i32 %x) nounwind { %i3 = sdiv i32 %x, -1328634635 @@ -225,7 +225,7 @@ define i1 @test23(i32 %x) nounwind { @X = global [1000 x i32] zeroinitializer ; PR8882 -; CHECK: @test24 +; CHECK-LABEL: @test24( ; CHECK: %cmp = icmp eq i64 %i, 1000 ; CHECK: ret i1 %cmp define i1 @test24(i64 %i) { @@ -234,7 +234,7 @@ define i1 @test24(i64 %i) { ret i1 %cmp } -; CHECK: @test25 +; CHECK-LABEL: @test25( ; X + Z > Y + Z -> X > Y if there is no overflow. ; CHECK: %c = icmp sgt i32 %x, %y ; CHECK: ret i1 %c @@ -245,7 +245,7 @@ define i1 @test25(i32 %x, i32 %y, i32 %z) { ret i1 %c } -; CHECK: @test26 +; CHECK-LABEL: @test26( ; X + Z > Y + Z -> X > Y if there is no overflow. ; CHECK: %c = icmp ugt i32 %x, %y ; CHECK: ret i1 %c @@ -256,7 +256,7 @@ define i1 @test26(i32 %x, i32 %y, i32 %z) { ret i1 %c } -; CHECK: @test27 +; CHECK-LABEL: @test27( ; X - Z > Y - Z -> X > Y if there is no overflow. ; CHECK: %c = icmp sgt i32 %x, %y ; CHECK: ret i1 %c @@ -267,7 +267,7 @@ define i1 @test27(i32 %x, i32 %y, i32 %z) { ret i1 %c } -; CHECK: @test28 +; CHECK-LABEL: @test28( ; X - Z > Y - Z -> X > Y if there is no overflow. ; CHECK: %c = icmp ugt i32 %x, %y ; CHECK: ret i1 %c @@ -278,7 +278,7 @@ define i1 @test28(i32 %x, i32 %y, i32 %z) { ret i1 %c } -; CHECK: @test29 +; CHECK-LABEL: @test29( ; X + Y > X -> Y > 0 if there is no overflow. ; CHECK: %c = icmp sgt i32 %y, 0 ; CHECK: ret i1 %c @@ -288,7 +288,7 @@ define i1 @test29(i32 %x, i32 %y) { ret i1 %c } -; CHECK: @test30 +; CHECK-LABEL: @test30( ; X + Y > X -> Y > 0 if there is no overflow. ; CHECK: %c = icmp ne i32 %y, 0 ; CHECK: ret i1 %c @@ -298,7 +298,7 @@ define i1 @test30(i32 %x, i32 %y) { ret i1 %c } -; CHECK: @test31 +; CHECK-LABEL: @test31( ; X > X + Y -> 0 > Y if there is no overflow. ; CHECK: %c = icmp slt i32 %y, 0 ; CHECK: ret i1 %c @@ -308,7 +308,7 @@ define i1 @test31(i32 %x, i32 %y) { ret i1 %c } -; CHECK: @test32 +; CHECK-LABEL: @test32( ; X > X + Y -> 0 > Y if there is no overflow. ; CHECK: ret i1 false define i1 @test32(i32 %x, i32 %y) { @@ -317,7 +317,7 @@ define i1 @test32(i32 %x, i32 %y) { ret i1 %c } -; CHECK: @test33 +; CHECK-LABEL: @test33( ; X - Y > X -> 0 > Y if there is no overflow. ; CHECK: %c = icmp slt i32 %y, 0 ; CHECK: ret i1 %c @@ -327,7 +327,7 @@ define i1 @test33(i32 %x, i32 %y) { ret i1 %c } -; CHECK: @test34 +; CHECK-LABEL: @test34( ; X - Y > X -> 0 > Y if there is no overflow. ; CHECK: ret i1 false define i1 @test34(i32 %x, i32 %y) { @@ -336,7 +336,7 @@ define i1 @test34(i32 %x, i32 %y) { ret i1 %c } -; CHECK: @test35 +; CHECK-LABEL: @test35( ; X > X - Y -> Y > 0 if there is no overflow. ; CHECK: %c = icmp sgt i32 %y, 0 ; CHECK: ret i1 %c @@ -346,7 +346,7 @@ define i1 @test35(i32 %x, i32 %y) { ret i1 %c } -; CHECK: @test36 +; CHECK-LABEL: @test36( ; X > X - Y -> Y > 0 if there is no overflow. ; CHECK: %c = icmp ne i32 %y, 0 ; CHECK: ret i1 %c @@ -356,7 +356,7 @@ define i1 @test36(i32 %x, i32 %y) { ret i1 %c } -; CHECK: @test37 +; CHECK-LABEL: @test37( ; X - Y > X - Z -> Z > Y if there is no overflow. ; CHECK: %c = icmp sgt i32 %z, %y ; CHECK: ret i1 %c @@ -367,7 +367,7 @@ define i1 @test37(i32 %x, i32 %y, i32 %z) { ret i1 %c } -; CHECK: @test38 +; CHECK-LABEL: @test38( ; X - Y > X - Z -> Z > Y if there is no overflow. ; CHECK: %c = icmp ugt i32 %z, %y ; CHECK: ret i1 %c @@ -379,7 +379,7 @@ define i1 @test38(i32 %x, i32 %y, i32 %z) { } ; PR9343 #1 -; CHECK: @test39 +; CHECK-LABEL: @test39( ; CHECK: %B = icmp eq i32 %X, 0 define i1 @test39(i32 %X, i32 %Y) { %A = ashr exact i32 %X, %Y @@ -387,7 +387,7 @@ define i1 @test39(i32 %X, i32 %Y) { ret i1 %B } -; CHECK: @test40 +; CHECK-LABEL: @test40( ; CHECK: %B = icmp ne i32 %X, 0 define i1 @test40(i32 %X, i32 %Y) { %A = lshr exact i32 %X, %Y @@ -396,7 +396,7 @@ define i1 @test40(i32 %X, i32 %Y) { } ; PR9343 #3 -; CHECK: @test41 +; CHECK-LABEL: @test41( ; CHECK: ret i1 true define i1 @test41(i32 %X, i32 %Y) { %A = urem i32 %X, %Y @@ -404,7 +404,7 @@ define i1 @test41(i32 %X, i32 %Y) { ret i1 %B } -; CHECK: @test42 +; CHECK-LABEL: @test42( ; CHECK: %B = icmp sgt i32 %Y, -1 define i1 @test42(i32 %X, i32 %Y) { %A = srem i32 %X, %Y @@ -412,7 +412,7 @@ define i1 @test42(i32 %X, i32 %Y) { ret i1 %B } -; CHECK: @test43 +; CHECK-LABEL: @test43( ; CHECK: %B = icmp slt i32 %Y, 0 define i1 @test43(i32 %X, i32 %Y) { %A = srem i32 %X, %Y @@ -420,7 +420,7 @@ define i1 @test43(i32 %X, i32 %Y) { ret i1 %B } -; CHECK: @test44 +; CHECK-LABEL: @test44( ; CHECK: %B = icmp sgt i32 %Y, -1 define i1 @test44(i32 %X, i32 %Y) { %A = srem i32 %X, %Y @@ -428,7 +428,7 @@ define i1 @test44(i32 %X, i32 %Y) { ret i1 %B } -; CHECK: @test45 +; CHECK-LABEL: @test45( ; CHECK: %B = icmp slt i32 %Y, 0 define i1 @test45(i32 %X, i32 %Y) { %A = srem i32 %X, %Y @@ -437,7 +437,7 @@ define i1 @test45(i32 %X, i32 %Y) { } ; PR9343 #4 -; CHECK: @test46 +; CHECK-LABEL: @test46( ; CHECK: %C = icmp ult i32 %X, %Y define i1 @test46(i32 %X, i32 %Y, i32 %Z) { %A = ashr exact i32 %X, %Z @@ -447,7 +447,7 @@ define i1 @test46(i32 %X, i32 %Y, i32 %Z) { } ; PR9343 #5 -; CHECK: @test47 +; CHECK-LABEL: @test47( ; CHECK: %C = icmp ugt i32 %X, %Y define i1 @test47(i32 %X, i32 %Y, i32 %Z) { %A = ashr exact i32 %X, %Z @@ -457,7 +457,7 @@ define i1 @test47(i32 %X, i32 %Y, i32 %Z) { } ; PR9343 #8 -; CHECK: @test48 +; CHECK-LABEL: @test48( ; CHECK: %C = icmp eq i32 %X, %Y define i1 @test48(i32 %X, i32 %Y, i32 %Z) { %A = sdiv exact i32 %X, %Z @@ -467,7 +467,7 @@ define i1 @test48(i32 %X, i32 %Y, i32 %Z) { } ; PR8469 -; CHECK: @test49 +; CHECK-LABEL: @test49( ; CHECK: ret <2 x i1> <i1 true, i1 true> define <2 x i1> @test49(<2 x i32> %tmp3) { entry: @@ -477,7 +477,7 @@ entry: } ; PR9343 #7 -; CHECK: @test50 +; CHECK-LABEL: @test50( ; CHECK: ret i1 true define i1 @test50(i16 %X, i32 %Y) { %A = zext i16 %X to i32 @@ -486,7 +486,7 @@ define i1 @test50(i16 %X, i32 %Y) { ret i1 %C } -; CHECK: @test51 +; CHECK-LABEL: @test51( ; CHECK: ret i1 %C define i1 @test51(i32 %X, i32 %Y) { %A = and i32 %X, 2147483648 @@ -495,7 +495,7 @@ define i1 @test51(i32 %X, i32 %Y) { ret i1 %C } -; CHECK: @test52 +; CHECK-LABEL: @test52( ; CHECK-NEXT: and i32 %x1, 16711935 ; CHECK-NEXT: icmp eq i32 {{.*}}, 4980863 ; CHECK-NEXT: ret i1 @@ -511,7 +511,7 @@ define i1 @test52(i32 %x1) nounwind { } ; PR9838 -; CHECK: @test53 +; CHECK-LABEL: @test53( ; CHECK-NEXT: ashr exact ; CHECK-NEXT: ashr ; CHECK-NEXT: icmp @@ -522,7 +522,7 @@ define i1 @test53(i32 %a, i32 %b) nounwind { ret i1 %z } -; CHECK: @test54 +; CHECK-LABEL: @test54( ; CHECK-NEXT: %and = and i8 %a, -64 ; CHECK-NEXT: icmp eq i8 %and, -128 define i1 @test54(i8 %a) nounwind { @@ -532,7 +532,7 @@ define i1 @test54(i8 %a) nounwind { ret i1 %ret } -; CHECK: @test55 +; CHECK-LABEL: @test55( ; CHECK-NEXT: icmp eq i32 %a, -123 define i1 @test55(i32 %a) { %sub = sub i32 0, %a @@ -540,7 +540,7 @@ define i1 @test55(i32 %a) { ret i1 %cmp } -; CHECK: @test56 +; CHECK-LABEL: @test56( ; CHECK-NEXT: icmp eq i32 %a, -113 define i1 @test56(i32 %a) { %sub = sub i32 10, %a @@ -550,7 +550,7 @@ define i1 @test56(i32 %a) { ; PR10267 Don't make icmps more expensive when no other inst is subsumed. declare void @foo(i32) -; CHECK: @test57 +; CHECK-LABEL: @test57( ; CHECK: %and = and i32 %a, -2 ; CHECK: %cmp = icmp ne i32 %and, 0 define i1 @test57(i32 %a) { @@ -561,7 +561,7 @@ define i1 @test57(i32 %a) { } ; rdar://problem/10482509 -; CHECK: @cmpabs1 +; CHECK-LABEL: @cmpabs1( ; CHECK-NEXT: icmp ne define zeroext i1 @cmpabs1(i64 %val) { %sub = sub nsw i64 0, %val @@ -571,7 +571,7 @@ define zeroext i1 @cmpabs1(i64 %val) { ret i1 %tobool } -; CHECK: @cmpabs2 +; CHECK-LABEL: @cmpabs2( ; CHECK-NEXT: icmp ne define zeroext i1 @cmpabs2(i64 %val) { %sub = sub nsw i64 0, %val @@ -581,7 +581,7 @@ define zeroext i1 @cmpabs2(i64 %val) { ret i1 %tobool } -; CHECK: @test58 +; CHECK-LABEL: @test58( ; CHECK-NEXT: call i32 @test58_d(i64 36029346783166592) define void @test58() nounwind { %cast = bitcast <1 x i64> <i64 36029346783166592> to i64 @@ -599,7 +599,7 @@ define i1 @test59(i8* %foo) { %use = ptrtoint i8* %cast1 to i64 %call = call i32 @test58_d(i64 %use) nounwind ret i1 %cmp -; CHECK: @test59 +; CHECK-LABEL: @test59( ; CHECK: ret i1 true } @@ -610,7 +610,7 @@ define i1 @test60(i8* %foo, i64 %i, i64 %j) { %cast1 = bitcast i32* %gep1 to i8* %cmp = icmp ult i8* %cast1, %gep2 ret i1 %cmp -; CHECK: @test60 +; CHECK-LABEL: @test60( ; CHECK-NEXT: %gep1.idx = shl nuw i64 %i, 2 ; CHECK-NEXT: icmp slt i64 %gep1.idx, %j ; CHECK-NEXT: ret i1 @@ -624,7 +624,7 @@ define i1 @test61(i8* %foo, i64 %i, i64 %j) { %cmp = icmp ult i8* %cast1, %gep2 ret i1 %cmp ; Don't transform non-inbounds GEPs. -; CHECK: @test61 +; CHECK-LABEL: @test61( ; CHECK: icmp ult i8* %cast1, %gep2 ; CHECK-NEXT: ret i1 } @@ -634,7 +634,7 @@ define i1 @test62(i8* %a) { %arrayidx2 = getelementptr inbounds i8* %a, i64 10 %cmp = icmp slt i8* %arrayidx1, %arrayidx2 ret i1 %cmp -; CHECK: @test62 +; CHECK-LABEL: @test62( ; CHECK-NEXT: ret i1 true } @@ -643,7 +643,7 @@ define i1 @test63(i8 %a, i32 %b) nounwind { %t = and i32 %b, 255 %c = icmp eq i32 %z, %t ret i1 %c -; CHECK: @test63 +; CHECK-LABEL: @test63( ; CHECK-NEXT: %1 = trunc i32 %b to i8 ; CHECK-NEXT: %c = icmp eq i8 %1, %a ; CHECK-NEXT: ret i1 %c @@ -654,7 +654,7 @@ define i1 @test64(i8 %a, i32 %b) nounwind { %z = zext i8 %a to i32 %c = icmp eq i32 %t, %z ret i1 %c -; CHECK: @test64 +; CHECK-LABEL: @test64( ; CHECK-NEXT: %1 = trunc i32 %b to i8 ; CHECK-NEXT: %c = icmp eq i8 %1, %a ; CHECK-NEXT: ret i1 %c @@ -664,7 +664,7 @@ define i1 @test65(i64 %A, i64 %B) { %s1 = add i64 %A, %B %s2 = add i64 %A, %B %cmp = icmp eq i64 %s1, %s2 -; CHECK: @test65 +; CHECK-LABEL: @test65( ; CHECK-NEXT: ret i1 true ret i1 %cmp } @@ -673,12 +673,12 @@ define i1 @test66(i64 %A, i64 %B) { %s1 = add i64 %A, %B %s2 = add i64 %B, %A %cmp = icmp eq i64 %s1, %s2 -; CHECK: @test66 +; CHECK-LABEL: @test66( ; CHECK-NEXT: ret i1 true ret i1 %cmp } -; CHECK: @test67 +; CHECK-LABEL: @test67( ; CHECK: %and = and i32 %x, 96 ; CHECK: %cmp = icmp ne i32 %and, 0 define i1 @test67(i32 %x) nounwind uwtable { @@ -687,7 +687,7 @@ define i1 @test67(i32 %x) nounwind uwtable { ret i1 %cmp } -; CHECK: @test68 +; CHECK-LABEL: @test68( ; CHECK: %cmp = icmp ugt i32 %and, 30 define i1 @test68(i32 %x) nounwind uwtable { %and = and i32 %x, 127 @@ -696,7 +696,7 @@ define i1 @test68(i32 %x) nounwind uwtable { } ; PR14708 -; CHECK: @test69 +; CHECK-LABEL: @test69( ; CHECK: %1 = and i32 %c, -33 ; CHECK: %2 = icmp eq i32 %1, 65 ; CHECK: ret i1 %2 @@ -708,7 +708,7 @@ define i1 @test69(i32 %c) nounwind uwtable { } ; PR15940 -; CHECK: @test70 +; CHECK-LABEL: @test70( ; CHECK-NEXT: %A = srem i32 5, %X ; CHECK-NEXT: %C = icmp ne i32 %A, 2 ; CHECK-NEXT: ret i1 %C @@ -719,7 +719,7 @@ define i1 @test70(i32 %X) { ret i1 %C } -; CHECK: @icmp_sext16trunc +; CHECK-LABEL: @icmp_sext16trunc( ; CHECK-NEXT: %1 = trunc i32 %x to i16 ; CHECK-NEXT: %cmp = icmp slt i16 %1, 36 define i1 @icmp_sext16trunc(i32 %x) { @@ -729,7 +729,7 @@ define i1 @icmp_sext16trunc(i32 %x) { ret i1 %cmp } -; CHECK: @icmp_sext8trunc +; CHECK-LABEL: @icmp_sext8trunc( ; CHECK-NEXT: %1 = trunc i32 %x to i8 ; CHECK-NEXT: %cmp = icmp slt i8 %1, 36 define i1 @icmp_sext8trunc(i32 %x) { @@ -739,7 +739,7 @@ define i1 @icmp_sext8trunc(i32 %x) { ret i1 %cmp } -; CHECK: @icmp_shl16 +; CHECK-LABEL: @icmp_shl16( ; CHECK-NEXT: %1 = trunc i32 %x to i16 ; CHECK-NEXT: %cmp = icmp slt i16 %1, 36 define i1 @icmp_shl16(i32 %x) { @@ -748,7 +748,7 @@ define i1 @icmp_shl16(i32 %x) { ret i1 %cmp } -; CHECK: @icmp_shl24 +; CHECK-LABEL: @icmp_shl24( ; CHECK-NEXT: %1 = trunc i32 %x to i8 ; CHECK-NEXT: %cmp = icmp slt i8 %1, 36 define i1 @icmp_shl24(i32 %x) { @@ -759,7 +759,7 @@ define i1 @icmp_shl24(i32 %x) { ; If the (shl x, C) preserved the sign and this is a sign test, ; compare the LHS operand instead -; CHECK: @icmp_shl_nsw_sgt +; CHECK-LABEL: @icmp_shl_nsw_sgt( ; CHECK-NEXT: icmp sgt i32 %x, 0 define i1 @icmp_shl_nsw_sgt(i32 %x) { %shl = shl nsw i32 %x, 21 @@ -767,7 +767,7 @@ define i1 @icmp_shl_nsw_sgt(i32 %x) { ret i1 %cmp } -; CHECK: @icmp_shl_nsw_sge0 +; CHECK-LABEL: @icmp_shl_nsw_sge0( ; CHECK-NEXT: icmp sgt i32 %x, -1 define i1 @icmp_shl_nsw_sge0(i32 %x) { %shl = shl nsw i32 %x, 21 @@ -775,7 +775,7 @@ define i1 @icmp_shl_nsw_sge0(i32 %x) { ret i1 %cmp } -; CHECK: @icmp_shl_nsw_sge1 +; CHECK-LABEL: @icmp_shl_nsw_sge1( ; CHECK-NEXT: icmp sgt i32 %x, 0 define i1 @icmp_shl_nsw_sge1(i32 %x) { %shl = shl nsw i32 %x, 21 @@ -784,7 +784,7 @@ define i1 @icmp_shl_nsw_sge1(i32 %x) { } ; Checks for icmp (eq|ne) (shl x, C), 0 -; CHECK: @icmp_shl_nsw_eq +; CHECK-LABEL: @icmp_shl_nsw_eq( ; CHECK-NEXT: icmp eq i32 %x, 0 define i1 @icmp_shl_nsw_eq(i32 %x) { %mul = shl nsw i32 %x, 5 @@ -792,7 +792,7 @@ define i1 @icmp_shl_nsw_eq(i32 %x) { ret i1 %cmp } -; CHECK: @icmp_shl_eq +; CHECK-LABEL: @icmp_shl_eq( ; CHECK-NOT: icmp eq i32 %mul, 0 define i1 @icmp_shl_eq(i32 %x) { %mul = shl i32 %x, 5 @@ -800,7 +800,7 @@ define i1 @icmp_shl_eq(i32 %x) { ret i1 %cmp } -; CHECK: @icmp_shl_nsw_ne +; CHECK-LABEL: @icmp_shl_nsw_ne( ; CHECK-NEXT: icmp ne i32 %x, 0 define i1 @icmp_shl_nsw_ne(i32 %x) { %mul = shl nsw i32 %x, 7 @@ -808,7 +808,7 @@ define i1 @icmp_shl_nsw_ne(i32 %x) { ret i1 %cmp } -; CHECK: @icmp_shl_ne +; CHECK-LABEL: @icmp_shl_ne( ; CHECK-NOT: icmp ne i32 %x, 0 define i1 @icmp_shl_ne(i32 %x) { %mul = shl i32 %x, 7 @@ -818,7 +818,7 @@ define i1 @icmp_shl_ne(i32 %x) { ; If the (mul x, C) preserved the sign and this is sign test, ; compare the LHS operand instead -; CHECK: @icmp_mul_nsw +; CHECK-LABEL: @icmp_mul_nsw( ; CHECK-NEXT: icmp sgt i32 %x, 0 define i1 @icmp_mul_nsw(i32 %x) { %mul = mul nsw i32 %x, 12 @@ -826,7 +826,7 @@ define i1 @icmp_mul_nsw(i32 %x) { ret i1 %cmp } -; CHECK: @icmp_mul_nsw1 +; CHECK-LABEL: @icmp_mul_nsw1( ; CHECK-NEXT: icmp slt i32 %x, 0 define i1 @icmp_mul_nsw1(i32 %x) { %mul = mul nsw i32 %x, 12 @@ -834,7 +834,7 @@ define i1 @icmp_mul_nsw1(i32 %x) { ret i1 %cmp } -; CHECK: @icmp_mul_nsw_neg +; CHECK-LABEL: @icmp_mul_nsw_neg( ; CHECK-NEXT: icmp slt i32 %x, 1 define i1 @icmp_mul_nsw_neg(i32 %x) { %mul = mul nsw i32 %x, -12 @@ -842,7 +842,7 @@ define i1 @icmp_mul_nsw_neg(i32 %x) { ret i1 %cmp } -; CHECK: @icmp_mul_nsw_neg1 +; CHECK-LABEL: @icmp_mul_nsw_neg1( ; CHECK-NEXT: icmp slt i32 %x, 0 define i1 @icmp_mul_nsw_neg1(i32 %x) { %mul = mul nsw i32 %x, -12 @@ -850,7 +850,7 @@ define i1 @icmp_mul_nsw_neg1(i32 %x) { ret i1 %cmp } -; CHECK: @icmp_mul_nsw_0 +; CHECK-LABEL: @icmp_mul_nsw_0( ; CHECK-NOT: icmp sgt i32 %x, 0 define i1 @icmp_mul_nsw_0(i32 %x) { %mul = mul nsw i32 %x, 0 @@ -858,7 +858,7 @@ define i1 @icmp_mul_nsw_0(i32 %x) { ret i1 %cmp } -; CHECK: @icmp_mul +; CHECK-LABEL: @icmp_mul( ; CHECK-NEXT: %mul = mul i32 %x, -12 define i1 @icmp_mul(i32 %x) { %mul = mul i32 %x, -12 @@ -867,7 +867,7 @@ define i1 @icmp_mul(i32 %x) { } ; Checks for icmp (eq|ne) (mul x, C), 0 -; CHECK: @icmp_mul_neq0 +; CHECK-LABEL: @icmp_mul_neq0( ; CHECK-NEXT: icmp ne i32 %x, 0 define i1 @icmp_mul_neq0(i32 %x) { %mul = mul nsw i32 %x, -12 @@ -875,7 +875,7 @@ define i1 @icmp_mul_neq0(i32 %x) { ret i1 %cmp } -; CHECK: @icmp_mul_eq0 +; CHECK-LABEL: @icmp_mul_eq0( ; CHECK-NEXT: icmp eq i32 %x, 0 define i1 @icmp_mul_eq0(i32 %x) { %mul = mul nsw i32 %x, 12 @@ -883,7 +883,7 @@ define i1 @icmp_mul_eq0(i32 %x) { ret i1 %cmp } -; CHECK: @icmp_mul0_eq0 +; CHECK-LABEL: @icmp_mul0_eq0( ; CHECK-NEXT: ret i1 true define i1 @icmp_mul0_eq0(i32 %x) { %mul = mul i32 %x, 0 @@ -891,7 +891,7 @@ define i1 @icmp_mul0_eq0(i32 %x) { ret i1 %cmp } -; CHECK: @icmp_mul0_ne0 +; CHECK-LABEL: @icmp_mul0_ne0( ; CHECK-NEXT: ret i1 false define i1 @icmp_mul0_ne0(i32 %x) { %mul = mul i32 %x, 0 @@ -899,7 +899,7 @@ define i1 @icmp_mul0_ne0(i32 %x) { ret i1 %cmp } -; CHECK: @icmp_sub1_sge +; CHECK-LABEL: @icmp_sub1_sge( ; CHECK-NEXT: icmp sgt i32 %x, %y define i1 @icmp_sub1_sge(i32 %x, i32 %y) { %sub = add nsw i32 %x, -1 @@ -907,7 +907,7 @@ define i1 @icmp_sub1_sge(i32 %x, i32 %y) { ret i1 %cmp } -; CHECK: @icmp_add1_sgt +; CHECK-LABEL: @icmp_add1_sgt( ; CHECK-NEXT: icmp sge i32 %x, %y define i1 @icmp_add1_sgt(i32 %x, i32 %y) { %add = add nsw i32 %x, 1 @@ -915,7 +915,7 @@ define i1 @icmp_add1_sgt(i32 %x, i32 %y) { ret i1 %cmp } -; CHECK: @icmp_sub1_slt +; CHECK-LABEL: @icmp_sub1_slt( ; CHECK-NEXT: icmp sle i32 %x, %y define i1 @icmp_sub1_slt(i32 %x, i32 %y) { %sub = add nsw i32 %x, -1 @@ -923,7 +923,7 @@ define i1 @icmp_sub1_slt(i32 %x, i32 %y) { ret i1 %cmp } -; CHECK: @icmp_add1_sle +; CHECK-LABEL: @icmp_add1_sle( ; CHECK-NEXT: icmp slt i32 %x, %y define i1 @icmp_add1_sle(i32 %x, i32 %y) { %add = add nsw i32 %x, 1 @@ -931,7 +931,7 @@ define i1 @icmp_add1_sle(i32 %x, i32 %y) { ret i1 %cmp } -; CHECK: @icmp_add20_sge_add57 +; CHECK-LABEL: @icmp_add20_sge_add57( ; CHECK-NEXT: [[ADD:%[a-z0-9]+]] = add nsw i32 %y, 37 ; CHECK-NEXT: icmp sle i32 [[ADD]], %x define i1 @icmp_add20_sge_add57(i32 %x, i32 %y) { @@ -941,7 +941,7 @@ define i1 @icmp_add20_sge_add57(i32 %x, i32 %y) { ret i1 %cmp } -; CHECK: @icmp_sub57_sge_sub20 +; CHECK-LABEL: @icmp_sub57_sge_sub20( ; CHECK-NEXT: [[SUB:%[a-z0-9]+]] = add nsw i32 %x, -37 ; CHECK-NEXT: icmp sge i32 [[SUB]], %y define i1 @icmp_sub57_sge_sub20(i32 %x, i32 %y) { @@ -951,7 +951,7 @@ define i1 @icmp_sub57_sge_sub20(i32 %x, i32 %y) { ret i1 %cmp } -; CHECK: @icmp_and_shl_neg_ne_0 +; CHECK-LABEL: @icmp_and_shl_neg_ne_0( ; CHECK-NEXT: [[SHL:%[a-z0-9]+]] = shl i32 1, %B ; CHECK-NEXT: [[AND:%[a-z0-9]+]] = and i32 [[SHL]], %A ; CHECK-NEXT: [[CMP:%[a-z0-9]+]] = icmp eq i32 [[AND]], 0 @@ -964,7 +964,7 @@ define i1 @icmp_and_shl_neg_ne_0(i32 %A, i32 %B) { ret i1 %cmp } -; CHECK: @icmp_and_shl_neg_eq_0 +; CHECK-LABEL: @icmp_and_shl_neg_eq_0( ; CHECK-NEXT: [[SHL:%[a-z0-9]+]] = shl i32 1, %B ; CHECK-NEXT: [[AND:%[a-z0-9]+]] = and i32 [[SHL]], %A ; CHECK-NEXT: [[CMP:%[a-z0-9]+]] = icmp ne i32 [[AND]], 0 @@ -977,7 +977,7 @@ define i1 @icmp_and_shl_neg_eq_0(i32 %A, i32 %B) { ret i1 %cmp } -; CHECK: @icmp_add_and_shr_ne_0 +; CHECK-LABEL: @icmp_add_and_shr_ne_0( ; CHECK-NEXT: [[AND:%[a-z0-9]+]] = and i32 %X, 240 ; CHECK-NEXT: [[CMP:%[a-z0-9]+]] = icmp ne i32 [[AND]], 224 ; CHECK-NEXT: ret i1 [[CMP]] @@ -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 @@ -998,3 +998,204 @@ define i1 @test71(i8* %x) { %c = icmp ugt i8* %a, %b ret i1 %c } + +; CHECK-LABEL: @icmp_shl_1_V_ult_32( +; CHECK-NEXT: [[CMP:%[a-z0-9]+]] = icmp ult i32 %V, 5 +; CHECK-NEXT: ret i1 [[CMP]] +define i1 @icmp_shl_1_V_ult_32(i32 %V) { + %shl = shl i32 1, %V + %cmp = icmp ult i32 %shl, 32 + ret i1 %cmp +} + +; CHECK-LABEL: @icmp_shl_1_V_eq_32( +; CHECK-NEXT: [[CMP:%[a-z0-9]+]] = icmp eq i32 %V, 5 +; CHECK-NEXT: ret i1 [[CMP]] +define i1 @icmp_shl_1_V_eq_32(i32 %V) { + %shl = shl i32 1, %V + %cmp = icmp eq i32 %shl, 32 + ret i1 %cmp +} + +; CHECK-LABEL: @icmp_shl_1_V_eq_31( +; CHECK-NEXT: ret i1 false +define i1 @icmp_shl_1_V_eq_31(i32 %V) { + %shl = shl i32 1, %V + %cmp = icmp eq i32 %shl, 31 + ret i1 %cmp +} + +; CHECK-LABEL: @icmp_shl_1_V_ne_31( +; CHECK-NEXT: ret i1 true +define i1 @icmp_shl_1_V_ne_31(i32 %V) { + %shl = shl i32 1, %V + %cmp = icmp ne i32 %shl, 31 + ret i1 %cmp +} + +; CHECK-LABEL: @icmp_shl_1_V_ult_30( +; CHECK-NEXT: [[CMP:%[a-z0-9]+]] = icmp ult i32 %V, 5 +; CHECK-NEXT: ret i1 [[CMP]] +define i1 @icmp_shl_1_V_ult_30(i32 %V) { + %shl = shl i32 1, %V + %cmp = icmp ult i32 %shl, 30 + ret i1 %cmp +} + +; CHECK-LABEL: @icmp_shl_1_V_ugt_30( +; CHECK-NEXT: [[CMP:%[a-z0-9]+]] = icmp ugt i32 %V, 4 +; CHECK-NEXT: ret i1 [[CMP]] +define i1 @icmp_shl_1_V_ugt_30(i32 %V) { + %shl = shl i32 1, %V + %cmp = icmp ugt i32 %shl, 30 + ret i1 %cmp +} + +; CHECK-LABEL: @icmp_shl_1_V_ule_30( +; CHECK-NEXT: [[CMP:%[a-z0-9]+]] = icmp ult i32 %V, 5 +; CHECK-NEXT: ret i1 [[CMP]] +define i1 @icmp_shl_1_V_ule_30(i32 %V) { + %shl = shl i32 1, %V + %cmp = icmp ule i32 %shl, 30 + ret i1 %cmp +} + +; CHECK-LABEL: @icmp_shl_1_V_uge_30( +; CHECK-NEXT: [[CMP:%[a-z0-9]+]] = icmp ugt i32 %V, 4 +; CHECK-NEXT: ret i1 [[CMP]] +define i1 @icmp_shl_1_V_uge_30(i32 %V) { + %shl = shl i32 1, %V + %cmp = icmp uge i32 %shl, 30 + ret i1 %cmp +} + +; CHECK-LABEL: @icmp_shl_1_V_uge_2147483648( +; CHECK-NEXT: [[CMP:%[a-z0-9]+]] = icmp eq i32 %V, 31 +; CHECK-NEXT: ret i1 [[CMP]] +define i1 @icmp_shl_1_V_uge_2147483648(i32 %V) { + %shl = shl i32 1, %V + %cmp = icmp uge i32 %shl, 2147483648 + ret i1 %cmp +} + +; CHECK-LABEL: @icmp_shl_1_V_ugt_2147483648( +; CHECK-NEXT: ret i1 false +define i1 @icmp_shl_1_V_ugt_2147483648(i32 %V) { + %shl = shl i32 1, %V + %cmp = icmp ugt i32 %shl, 2147483648 + ret i1 %cmp +} + +; CHECK-LABEL: @icmp_shl_1_V_ule_2147483648( +; CHECK-NEXT: ret i1 true +define i1 @icmp_shl_1_V_ule_2147483648(i32 %V) { + %shl = shl i32 1, %V + %cmp = icmp ule i32 %shl, 2147483648 + ret i1 %cmp +} + +; CHECK-LABEL: @icmp_shl_1_V_ult_2147483648( +; CHECK-NEXT: [[CMP:%[a-z0-9]+]] = icmp ne i32 %V, 31 +; CHECK-NEXT: ret i1 [[CMP]] +define i1 @icmp_shl_1_V_ult_2147483648(i32 %V) { + %shl = shl i32 1, %V + %cmp = icmp ult i32 %shl, 2147483648 + ret i1 %cmp +} + +; CHECK-LABEL: @or_icmp_eq_B_0_icmp_ult_A_B( +; CHECK-NEXT: [[SUB:%[a-z0-9]+]] = add i64 %b, -1 +; CHECK-NEXT: [[CMP:%[a-z0-9]+]] = icmp uge i64 [[SUB]], %a +; CHECK-NEXT: ret i1 [[CMP]] +define i1 @or_icmp_eq_B_0_icmp_ult_A_B(i64 %a, i64 %b) { + %1 = icmp eq i64 %b, 0 + %2 = icmp ult i64 %a, %b + %3 = or i1 %1, %2 + ret i1 %3 +} + +; CHECK-LABEL: @icmp_add_ult_2( +; CHECK-NEXT: [[AND:%[a-z0-9]+]] = and i32 %X, -2 +; CHECK-NEXT: [[CMP:%[a-z0-9]+]] = icmp eq i32 [[AND]], 14 +; CHECK-NEXT: ret i1 [[CMP]] +define i1 @icmp_add_ult_2(i32 %X) { + %add = add i32 %X, -14 + %cmp = icmp ult i32 %add, 2 + ret i1 %cmp +} + +; CHECK: @icmp_add_X_-14_ult_2 +; CHECK-NEXT: [[AND:%[a-z0-9]+]] = and i32 %X, -2 +; CHECK-NEXT: [[CMP:%[a-z0-9]+]] = icmp eq i32 [[AND]], 14 +; CHECK-NEXT: ret i1 [[CMP]] +define i1 @icmp_add_X_-14_ult_2(i32 %X) { + %add = add i32 %X, -14 + %cmp = icmp ult i32 %add, 2 + ret i1 %cmp +} + +; CHECK-LABEL: @icmp_sub_3_X_ult_2( +; CHECK-NEXT: [[OR:%[a-z0-9]+]] = or i32 %X, 1 +; CHECK-NEXT: [[CMP:%[a-z0-9]+]] = icmp eq i32 [[OR]], 3 +; CHECK-NEXT: ret i1 [[CMP]] +define i1 @icmp_sub_3_X_ult_2(i32 %X) { + %add = sub i32 3, %X + %cmp = icmp ult i32 %add, 2 + ret i1 %cmp +} + +; CHECK: @icmp_add_X_-14_uge_2 +; CHECK-NEXT: [[AND:%[a-z0-9]+]] = and i32 %X, -2 +; CHECK-NEXT: [[CMP:%[a-z0-9]+]] = icmp ne i32 [[AND]], 14 +; CHECK-NEXT: ret i1 [[CMP]] +define i1 @icmp_add_X_-14_uge_2(i32 %X) { + %add = add i32 %X, -14 + %cmp = icmp uge i32 %add, 2 + ret i1 %cmp +} + +; CHECK-LABEL: @icmp_sub_3_X_uge_2( +; CHECK-NEXT: [[OR:%[a-z0-9]+]] = or i32 %X, 1 +; CHECK-NEXT: [[CMP:%[a-z0-9]+]] = icmp ne i32 [[OR]], 3 +; CHECK-NEXT: ret i1 [[CMP]] +define i1 @icmp_sub_3_X_uge_2(i32 %X) { + %add = sub i32 3, %X + %cmp = icmp uge i32 %add, 2 + ret i1 %cmp +} + +; CHECK: @icmp_and_X_-16_eq-16 +; CHECK-NEXT: [[CMP:%[a-z0-9]+]] = icmp ugt i32 %X, -17 +; CHECK-NEXT: ret i1 [[CMP]] +define i1 @icmp_and_X_-16_eq-16(i32 %X) { + %and = and i32 %X, -16 + %cmp = icmp eq i32 %and, -16 + ret i1 %cmp +} + +; CHECK: @icmp_and_X_-16_ne-16 +; CHECK-NEXT: [[CMP:%[a-z0-9]+]] = icmp ult i32 %X, -16 +; CHECK-NEXT: ret i1 [[CMP]] +define i1 @icmp_and_X_-16_ne-16(i32 %X) { + %and = and i32 %X, -16 + %cmp = icmp ne i32 %and, -16 + ret i1 %cmp +} + +; CHECK: @icmp_sub_-1_X_ult_4 +; CHECK-NEXT: [[CMP:%[a-z0-9]+]] = icmp ugt i32 %X, -5 +; CHECK-NEXT: ret i1 [[CMP]] +define i1 @icmp_sub_-1_X_ult_4(i32 %X) { + %sub = sub i32 -1, %X + %cmp = icmp ult i32 %sub, 4 + ret i1 %cmp +} + +; CHECK: @icmp_sub_-1_X_uge_4 +; CHECK-NEXT: [[CMP:%[a-z0-9]+]] = icmp ult i32 %X, -4 +; CHECK-NEXT: ret i1 [[CMP]] +define i1 @icmp_sub_-1_X_uge_4(i32 %X) { + %sub = sub i32 -1, %X + %cmp = icmp uge i32 %sub, 4 + ret i1 %cmp +} diff --git a/test/Transforms/InstCombine/idioms.ll b/test/Transforms/InstCombine/idioms.ll index 1a21166..5848544 100644 --- a/test/Transforms/InstCombine/idioms.ll +++ b/test/Transforms/InstCombine/idioms.ll @@ -25,7 +25,7 @@ bb3: bb4: %f = phi i32 [ %not2, %bb2 ], [ %e, %bb3 ] ret i32 %f -; CHECK: @test_asr +; CHECK-LABEL: @test_asr( ; CHECK: bb4: ; CHECK: %f = ashr i32 %a, %b ; CHECK: ret i32 %f diff --git a/test/Transforms/InstCombine/intrinsics.ll b/test/Transforms/InstCombine/intrinsics.ll index f334b3b..91c4470 100644 --- a/test/Transforms/InstCombine/intrinsics.ll +++ b/test/Transforms/InstCombine/intrinsics.ll @@ -14,7 +14,7 @@ define i8 @uaddtest1(i8 %A, i8 %B) { %x = call %overflow.result @llvm.uadd.with.overflow.i8(i8 %A, i8 %B) %y = extractvalue %overflow.result %x, 0 ret i8 %y -; CHECK: @uaddtest1 +; CHECK-LABEL: @uaddtest1( ; CHECK-NEXT: %y = add i8 %A, %B ; CHECK-NEXT: ret i8 %y } @@ -27,7 +27,7 @@ define i8 @uaddtest2(i8 %A, i8 %B, i1* %overflowPtr) { %z = extractvalue %overflow.result %x, 1 store i1 %z, i1* %overflowPtr ret i8 %y -; CHECK: @uaddtest2 +; CHECK-LABEL: @uaddtest2( ; CHECK-NEXT: %and.A = and i8 %A, 127 ; CHECK-NEXT: %and.B = and i8 %B, 127 ; CHECK-NEXT: %x = add nuw i8 %and.A, %and.B @@ -43,7 +43,7 @@ define i8 @uaddtest3(i8 %A, i8 %B, i1* %overflowPtr) { %z = extractvalue %overflow.result %x, 1 store i1 %z, i1* %overflowPtr ret i8 %y -; CHECK: @uaddtest3 +; CHECK-LABEL: @uaddtest3( ; CHECK-NEXT: %or.A = or i8 %A, -128 ; CHECK-NEXT: %or.B = or i8 %B, -128 ; CHECK-NEXT: %x = add i8 %or.A, %or.B @@ -57,7 +57,7 @@ define i8 @uaddtest4(i8 %A, i1* %overflowPtr) { %z = extractvalue %overflow.result %x, 1 store i1 %z, i1* %overflowPtr ret i8 %y -; CHECK: @uaddtest4 +; CHECK-LABEL: @uaddtest4( ; CHECK-NEXT: ret i8 undef } @@ -67,7 +67,7 @@ define i8 @uaddtest5(i8 %A, i1* %overflowPtr) { %z = extractvalue %overflow.result %x, 1 store i1 %z, i1* %overflowPtr ret i8 %y -; CHECK: @uaddtest5 +; CHECK-LABEL: @uaddtest5( ; CHECK: ret i8 %A } @@ -75,7 +75,7 @@ define i1 @uaddtest6(i8 %A, i8 %B) { %x = call %overflow.result @llvm.uadd.with.overflow.i8(i8 %A, i8 -4) %z = extractvalue %overflow.result %x, 1 ret i1 %z -; CHECK: @uaddtest6 +; CHECK-LABEL: @uaddtest6( ; CHECK-NEXT: %z = icmp ugt i8 %A, 3 ; CHECK-NEXT: ret i1 %z } @@ -84,7 +84,7 @@ define i8 @uaddtest7(i8 %A, i8 %B) { %x = call %overflow.result @llvm.uadd.with.overflow.i8(i8 %A, i8 %B) %z = extractvalue %overflow.result %x, 0 ret i8 %z -; CHECK: @uaddtest7 +; CHECK-LABEL: @uaddtest7( ; CHECK-NEXT: %z = add i8 %A, %B ; CHECK-NEXT: ret i8 %z } @@ -96,7 +96,7 @@ define i8 @umultest1(i8 %A, i1* %overflowPtr) { %z = extractvalue %overflow.result %x, 1 store i1 %z, i1* %overflowPtr ret i8 %y -; CHECK: @umultest1 +; CHECK-LABEL: @umultest1( ; CHECK-NEXT: store i1 false, i1* %overflowPtr ; CHECK-NEXT: ret i8 0 } @@ -107,7 +107,7 @@ define i8 @umultest2(i8 %A, i1* %overflowPtr) { %z = extractvalue %overflow.result %x, 1 store i1 %z, i1* %overflowPtr ret i8 %y -; CHECK: @umultest2 +; CHECK-LABEL: @umultest2( ; CHECK-NEXT: store i1 false, i1* %overflowPtr ; CHECK-NEXT: ret i8 %A } @@ -122,7 +122,7 @@ define i32 @umultest3(i32 %n) nounwind { %res = extractvalue %ov.result.32 %mul, 0 %ret = select i1 %ov, i32 -1, i32 %res ret i32 %ret -; CHECK: @umultest3 +; CHECK-LABEL: @umultest3( ; CHECK-NEXT: shr ; CHECK-NEXT: mul nuw ; CHECK-NEXT: ret @@ -135,7 +135,7 @@ define i32 @umultest4(i32 %n) nounwind { %res = extractvalue %ov.result.32 %mul, 0 %ret = select i1 %ov, i32 -1, i32 %res ret i32 %ret -; CHECK: @umultest4 +; CHECK-LABEL: @umultest4( ; CHECK: umul.with.overflow } @@ -150,7 +150,7 @@ entry: %C = tail call double @llvm.powi.f64(double %V, i32 1) nounwind store volatile double %C, double* %P ret void -; CHECK: @powi +; CHECK-LABEL: @powi( ; CHECK: %A = fdiv double 1.0{{.*}}, %V ; CHECK: store volatile double %A, ; CHECK: store volatile double 1.0 @@ -163,7 +163,7 @@ entry: %and = and i32 %or, -8 %count = tail call i32 @llvm.cttz.i32(i32 %and, i1 true) nounwind readnone ret i32 %count -; CHECK: @cttz +; CHECK-LABEL: @cttz( ; CHECK-NEXT: entry: ; CHECK-NEXT: ret i32 3 } @@ -174,7 +174,7 @@ entry: %and = and i8 %or, 63 %count = tail call i8 @llvm.ctlz.i8(i8 %and, i1 true) nounwind readnone ret i8 %count -; CHECK: @ctlz +; CHECK-LABEL: @ctlz( ; CHECK-NEXT: entry: ; CHECK-NEXT: ret i8 2 } @@ -206,7 +206,7 @@ define i32 @cttz_simplify1a(i32 %x) nounwind readnone ssp { %shr3 = lshr i32 %tmp1, 5 ret i32 %shr3 -; CHECK: @cttz_simplify1a +; CHECK-LABEL: @cttz_simplify1a( ; CHECK: icmp eq i32 %x, 0 ; CHECK-NEXT: zext i1 ; CHECK-NEXT: ret i32 @@ -217,7 +217,7 @@ define i32 @cttz_simplify1b(i32 %x) nounwind readnone ssp { %shr3 = lshr i32 %tmp1, 5 ret i32 %shr3 -; CHECK: @cttz_simplify1b +; CHECK-LABEL: @cttz_simplify1b( ; CHECK-NEXT: ret i32 0 } @@ -225,7 +225,7 @@ define i32 @ctlz_undef(i32 %Value) nounwind { %ctlz = call i32 @llvm.ctlz.i32(i32 0, i1 true) ret i32 %ctlz -; CHECK: @ctlz_undef +; CHECK-LABEL: @ctlz_undef( ; CHECK-NEXT: ret i32 undef } @@ -233,7 +233,7 @@ define i32 @cttz_undef(i32 %Value) nounwind { %cttz = call i32 @llvm.cttz.i32(i32 0, i1 true) ret i32 %cttz -; CHECK: @cttz_undef +; CHECK-LABEL: @cttz_undef( ; CHECK-NEXT: ret i32 undef } @@ -243,7 +243,7 @@ define i32 @ctlz_select(i32 %Value) nounwind { %s = select i1 %tobool, i32 %ctlz, i32 32 ret i32 %s -; CHECK: @ctlz_select +; CHECK-LABEL: @ctlz_select( ; CHECK: select i1 %tobool, i32 %ctlz, i32 32 } @@ -253,6 +253,6 @@ define i32 @cttz_select(i32 %Value) nounwind { %s = select i1 %tobool, i32 %cttz, i32 32 ret i32 %s -; CHECK: @cttz_select +; CHECK-LABEL: @cttz_select( ; CHECK: select i1 %tobool, i32 %cttz, i32 32 } diff --git a/test/Transforms/InstCombine/invoke.ll b/test/Transforms/InstCombine/invoke.ll index 04eaf86..c4b58de 100644 --- a/test/Transforms/InstCombine/invoke.ll +++ b/test/Transforms/InstCombine/invoke.ll @@ -7,7 +7,7 @@ declare i64 @llvm.objectsize.i64(i8*, i1) nounwind readonly declare i8* @_Znwm(i64) -; CHECK: @f1 +; CHECK-LABEL: @f1( define i64 @f1() nounwind uwtable ssp { entry: ; CHECK: nvoke noalias i8* undef() @@ -27,7 +27,7 @@ lpad: unreachable } -; CHECK: @f2 +; CHECK-LABEL: @f2( define i64 @f2() nounwind uwtable ssp { entry: ; CHECK: nvoke noalias i8* null() @@ -47,7 +47,7 @@ lpad: unreachable } -; CHECK: @f3 +; CHECK-LABEL: @f3( define void @f3() nounwind uwtable ssp { ; CHECK: invoke void @llvm.donothing() %call = invoke noalias i8* @_Znwm(i64 13) diff --git a/test/Transforms/InstCombine/isascii-1.ll b/test/Transforms/InstCombine/isascii-1.ll index 2a413d8..88f5ad6 100644 --- a/test/Transforms/InstCombine/isascii-1.ll +++ b/test/Transforms/InstCombine/isascii-1.ll @@ -9,21 +9,21 @@ declare i32 @isascii(i32) ; Check isascii(c) -> c <u 128. define i32 @test_simplify1() { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %ret = call i32 @isascii(i32 127) ret i32 %ret ; CHECK-NEXT: ret i32 1 } define i32 @test_simplify2() { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( %ret = call i32 @isascii(i32 128) ret i32 %ret ; CHECK-NEXT: ret i32 0 } define i32 @test_simplify3(i32 %x) { -; CHECK: @test_simplify3 +; CHECK-LABEL: @test_simplify3( %ret = call i32 @isascii(i32 %x) ; CHECK-NEXT: [[CMP:%[a-z0-9]+]] = icmp ult i32 %x, 128 ; CHECK-NEXT: [[ZEXT:%[a-z0-9]+]] = zext i1 [[CMP]] to i32 diff --git a/test/Transforms/InstCombine/isdigit-1.ll b/test/Transforms/InstCombine/isdigit-1.ll index f291296..6791307 100644 --- a/test/Transforms/InstCombine/isdigit-1.ll +++ b/test/Transforms/InstCombine/isdigit-1.ll @@ -9,35 +9,35 @@ declare i32 @isdigit(i32) ; Check isdigit(c) -> (c - '0') <u 10; define i32 @test_simplify1() { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %ret = call i32 @isdigit(i32 47) ret i32 %ret ; CHECK-NEXT: ret i32 0 } define i32 @test_simplify2() { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( %ret = call i32 @isdigit(i32 48) ret i32 %ret ; CHECK-NEXT: ret i32 1 } define i32 @test_simplify3() { -; CHECK: @test_simplify3 +; CHECK-LABEL: @test_simplify3( %ret = call i32 @isdigit(i32 57) ret i32 %ret ; CHECK-NEXT: ret i32 1 } define i32 @test_simplify4() { -; CHECK: @test_simplify4 +; CHECK-LABEL: @test_simplify4( %ret = call i32 @isdigit(i32 58) ret i32 %ret ; CHECK-NEXT: ret i32 0 } define i32 @test_simplify5(i32 %x) { -; CHECK: @test_simplify5 +; CHECK-LABEL: @test_simplify5( %ret = call i32 @isdigit(i32 %x) ; CHECK-NEXT: [[ADD:%[a-z0-9]+]] = add i32 %x, -48 diff --git a/test/Transforms/InstCombine/load-cmp.ll b/test/Transforms/InstCombine/load-cmp.ll index 869215c..95dc48c 100644 --- a/test/Transforms/InstCombine/load-cmp.ll +++ b/test/Transforms/InstCombine/load-cmp.ll @@ -10,7 +10,7 @@ define i1 @test1(i32 %X) { %Q = load i16* %P %R = icmp eq i16 %Q, 0 ret i1 %R -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK-NEXT: %R = icmp eq i32 %X, 9 ; CHECK-NEXT: ret i1 %R } @@ -20,7 +20,7 @@ define i1 @test2(i32 %X) { %Q = load i16* %P %R = icmp slt i16 %Q, 85 ret i1 %R -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK-NEXT: %R = icmp ne i32 %X, 4 ; CHECK-NEXT: ret i1 %R } @@ -30,7 +30,7 @@ define i1 @test3(i32 %X) { %Q = load double* %P %R = fcmp oeq double %Q, 1.0 ret i1 %R -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK-NEXT: %R = icmp eq i32 %X, 1 ; CHECK-NEXT: ret i1 %R } @@ -40,7 +40,7 @@ define i1 @test4(i32 %X) { %Q = load i16* %P %R = icmp sle i16 %Q, 73 ret i1 %R -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK-NEXT: lshr i32 933, %X ; CHECK-NEXT: and i32 {{.*}}, 1 ; CHECK-NEXT: %R = icmp ne i32 {{.*}}, 0 @@ -52,7 +52,7 @@ define i1 @test4_i16(i16 %X) { %Q = load i16* %P %R = icmp sle i16 %Q, 73 ret i1 %R -; CHECK: @test4_i16 +; CHECK-LABEL: @test4_i16( ; CHECK-NEXT: lshr i16 933, %X ; CHECK-NEXT: and i16 {{.*}}, 1 ; CHECK-NEXT: %R = icmp ne i16 {{.*}}, 0 @@ -64,7 +64,7 @@ define i1 @test5(i32 %X) { %Q = load i16* %P %R = icmp eq i16 %Q, 69 ret i1 %R -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK-NEXT: icmp eq i32 %X, 2 ; CHECK-NEXT: icmp eq i32 %X, 7 ; CHECK-NEXT: %R = or i1 @@ -76,7 +76,7 @@ define i1 @test6(i32 %X) { %Q = load double* %P %R = fcmp ogt double %Q, 0.0 ret i1 %R -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK-NEXT: add i32 %X, -1 ; CHECK-NEXT: %R = icmp ult i32 {{.*}}, 3 ; CHECK-NEXT: ret i1 %R @@ -87,7 +87,7 @@ define i1 @test7(i32 %X) { %Q = load double* %P %R = fcmp olt double %Q, 0.0 ret i1 %R -; CHECK: @test7 +; CHECK-LABEL: @test7( ; CHECK-NEXT: add i32 %X, -1 ; CHECK-NEXT: %R = icmp ugt i32 {{.*}}, 2 ; CHECK-NEXT: ret i1 %R @@ -99,7 +99,7 @@ define i1 @test8(i32 %X) { %R = and i16 %Q, 3 %S = icmp eq i16 %R, 0 ret i1 %S -; CHECK: @test8 +; CHECK-LABEL: @test8( ; CHECK-NEXT: and i32 %X, -2 ; CHECK-NEXT: icmp eq i32 {{.*}}, 8 ; CHECK-NEXT: ret i1 @@ -117,7 +117,7 @@ define i1 @test9(i32 %X) { %Q = load i32* %P %R = icmp eq i32 %Q, 1 ret i1 %R -; CHECK: @test9 +; CHECK-LABEL: @test9( ; CHECK-NEXT: add i32 %X, -1 ; CHECK-NEXT: icmp ult i32 {{.*}}, 2 ; CHECK-NEXT: ret i1 diff --git a/test/Transforms/InstCombine/load-select.ll b/test/Transforms/InstCombine/load-select.ll index f3d83dc..e8cbad3 100644 --- a/test/Transforms/InstCombine/load-select.ll +++ b/test/Transforms/InstCombine/load-select.ll @@ -5,7 +5,7 @@ target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32- @a = constant [2 x i32] [i32 3, i32 6] ; <[2 x i32]*> [#uses=2] define i32 @b(i32 %y) nounwind readonly { -; CHECK: @b +; CHECK-LABEL: @b( ; CHECK-NOT: load ; CHECK: ret i32 entry: diff --git a/test/Transforms/InstCombine/load3.ll b/test/Transforms/InstCombine/load3.ll index db74426..f79ef9a 100644 --- a/test/Transforms/InstCombine/load3.ll +++ b/test/Transforms/InstCombine/load3.ll @@ -11,7 +11,7 @@ define i32 @test1(i32* %p) { %x = load i32* %t1 %a = sub i32 %y, %x ret i32 %a -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK: ret i32 0 } @@ -22,7 +22,7 @@ define float @test2() { %tmp = load float* bitcast ([4 x i8]* @.str to float*), align 1 ret float %tmp -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK: ret float 0x3806965600000000 } @@ -41,6 +41,6 @@ define void @test3() nounwind { store i32 %l, i32* getelementptr ([36 x i32]* @rslts32, i32 29826161, i32 28), align 4 ret void -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK: store i32 1, i32* getelementptr inbounds ([36 x i32]* @rslts32, i32 0, i32 0) } diff --git a/test/Transforms/InstCombine/malloc-free-delete.ll b/test/Transforms/InstCombine/malloc-free-delete.ll index cd12b29..2085206 100644 --- a/test/Transforms/InstCombine/malloc-free-delete.ll +++ b/test/Transforms/InstCombine/malloc-free-delete.ll @@ -1,7 +1,7 @@ ; RUN: opt < %s -instcombine -S | FileCheck %s ; PR1201 define i32 @main(i32 %argc, i8** %argv) { -; CHECK: @main +; CHECK-LABEL: @main( %c_19 = alloca i8* %malloc_206 = tail call i8* @malloc(i32 mul (i32 ptrtoint (i8* getelementptr (i8* null, i32 1) to i32), i32 10)) store i8* %malloc_206, i8** %c_19 @@ -16,7 +16,7 @@ declare noalias i8* @malloc(i32) declare void @free(i8*) define i1 @foo() { -; CHECK: @foo +; CHECK-LABEL: @foo( ; CHECK-NEXT: ret i1 false %m = call i8* @malloc(i32 1) %z = icmp eq i8* %m, null @@ -32,7 +32,7 @@ declare void @llvm.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, declare void @llvm.memset.p0i8.i32(i8*, i8, i32, i32, i1) nounwind define void @test3(i8* %src) { -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK-NEXT: ret void %a = call noalias i8* @malloc(i32 10) call void @llvm.lifetime.start(i64 10, i8* %a) @@ -49,7 +49,7 @@ define void @test3(i8* %src) { ;; This used to crash. define void @test4() { -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK-NEXT: ret void %A = call i8* @malloc(i32 16000) %B = bitcast i8* %A to double* @@ -58,7 +58,7 @@ define void @test4() { ret void } -; CHECK: @test5 +; CHECK-LABEL: @test5( define void @test5(i8* %ptr, i8** %esc) { ; CHECK-NEXT: call i8* @malloc ; CHECK-NEXT: call i8* @malloc @@ -98,7 +98,7 @@ define void @test5(i8* %ptr, i8** %esc) { ;; Using simplifycfg will remove the empty basic block and the branch operation ;; Then, performing a dead elimination will remove the comparison. ;; This is what happens with -O1 and upper. -; CHECK: @test6 +; CHECK-LABEL: @test6( define void @test6(i8* %foo) minsize { ; CHECK: %tobool = icmp eq i8* %foo, null ;; Call to free moved @@ -120,3 +120,27 @@ if.then: ; preds = %entry if.end: ; preds = %entry, %if.then ret void } + +declare i8* @_ZnwmRKSt9nothrow_t(i64, i8*) nobuiltin +declare void @_ZdlPvRKSt9nothrow_t(i8*, i8*) nobuiltin +declare i32 @__gxx_personality_v0(...) +declare void @_ZN1AC2Ev(i8* %this) + +; CHECK-LABEL: @test7( +define void @test7() { +entry: + %nt = alloca i8 + ; CHECK-NOT: call {{.*}}@_ZnwmRKSt9nothrow_t( + %call.i = tail call i8* @_ZnwmRKSt9nothrow_t(i64 1, i8* %nt) builtin nounwind + invoke void @_ZN1AC2Ev(i8* undef) + to label %.noexc.i unwind label %lpad.i + +.noexc.i: ; preds = %entry + unreachable + +lpad.i: ; preds = %entry + %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) cleanup + ; CHECK-NOT: call {{.*}}@_ZdlPvRKSt9nothrow_t( + call void @_ZdlPvRKSt9nothrow_t(i8* %call.i, i8* %nt) builtin nounwind + resume { i8*, i32 } %0 +} diff --git a/test/Transforms/InstCombine/memcmp-1.ll b/test/Transforms/InstCombine/memcmp-1.ll index c97b201..65349c6 100644 --- a/test/Transforms/InstCombine/memcmp-1.ll +++ b/test/Transforms/InstCombine/memcmp-1.ll @@ -13,7 +13,7 @@ declare i32 @memcmp(i8*, i8*, i32) ; Check memcmp(mem, mem, size) -> 0. define i32 @test_simplify1(i8* %mem, i32 %size) { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %ret = call i32 @memcmp(i8* %mem, i8* %mem, i32 %size) ret i32 %ret ; CHECK: ret i32 0 @@ -22,7 +22,7 @@ define i32 @test_simplify1(i8* %mem, i32 %size) { ; Check memcmp(mem1, mem2, 0) -> 0. define i32 @test_simplify2(i8* %mem1, i8* %mem2) { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( %ret = call i32 @memcmp(i8* %mem1, i8* %mem2, i32 0) ret i32 %ret ; CHECK: ret i32 0 @@ -31,7 +31,7 @@ define i32 @test_simplify2(i8* %mem1, i8* %mem2) { ;; Check memcmp(mem1, mem2, 1) -> *(unsigned char*)mem1 - *(unsigned char*)mem2. define i32 @test_simplify3(i8* %mem1, i8* %mem2) { -; CHECK: @test_simplify3 +; CHECK-LABEL: @test_simplify3( %ret = call i32 @memcmp(i8* %mem1, i8* %mem2, i32 1) ; CHECK: [[LOAD1:%[a-z]+]] = load i8* %mem1, align 1 ; CHECK: [[ZEXT1:%[a-z]+]] = zext i8 [[LOAD1]] to i32 @@ -45,7 +45,7 @@ define i32 @test_simplify3(i8* %mem1, i8* %mem2) { ; Check memcmp(mem1, mem2, size) -> cnst, where all arguments are constants. define i32 @test_simplify4() { -; CHECK: @test_simplify4 +; CHECK-LABEL: @test_simplify4( %mem1 = getelementptr [4 x i8]* @hel, i32 0, i32 0 %mem2 = getelementptr [8 x i8]* @hello_u, i32 0, i32 0 %ret = call i32 @memcmp(i8* %mem1, i8* %mem2, i32 3) @@ -54,7 +54,7 @@ define i32 @test_simplify4() { } define i32 @test_simplify5() { -; CHECK: @test_simplify5 +; CHECK-LABEL: @test_simplify5( %mem1 = getelementptr [4 x i8]* @hel, i32 0, i32 0 %mem2 = getelementptr [4 x i8]* @foo, i32 0, i32 0 %ret = call i32 @memcmp(i8* %mem1, i8* %mem2, i32 3) @@ -63,7 +63,7 @@ define i32 @test_simplify5() { } define i32 @test_simplify6() { -; CHECK: @test_simplify6 +; CHECK-LABEL: @test_simplify6( %mem1 = getelementptr [4 x i8]* @foo, i32 0, i32 0 %mem2 = getelementptr [4 x i8]* @hel, i32 0, i32 0 %ret = call i32 @memcmp(i8* %mem1, i8* %mem2, i32 3) diff --git a/test/Transforms/InstCombine/memcmp-2.ll b/test/Transforms/InstCombine/memcmp-2.ll index 3796117..bed62eb 100644 --- a/test/Transforms/InstCombine/memcmp-2.ll +++ b/test/Transforms/InstCombine/memcmp-2.ll @@ -9,7 +9,7 @@ declare i32* @memcmp(i8*, i8*, i32) ; Check that memcmp functions with the wrong prototype aren't simplified. define i32* @test_no_simplify1(i8* %mem, i32 %size) { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %ret = call i32* @memcmp(i8* %mem, i8* %mem, i32 %size) ; CHECK-NEXT: call i32* @memcmp ret i32* %ret diff --git a/test/Transforms/InstCombine/memcpy-1.ll b/test/Transforms/InstCombine/memcpy-1.ll index 65b79ad..9efbcc8 100644 --- a/test/Transforms/InstCombine/memcpy-1.ll +++ b/test/Transforms/InstCombine/memcpy-1.ll @@ -9,7 +9,7 @@ declare i8* @memcpy(i8*, i8*, i32) ; Check memcpy(mem1, mem2, size) -> llvm.memcpy(mem1, mem2, size, 1). define i8* @test_simplify1(i8* %mem1, i8* %mem2, i32 %size) { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %ret = call i8* @memcpy(i8* %mem1, i8* %mem2, i32 %size) ; CHECK: call void @llvm.memcpy ret i8* %ret diff --git a/test/Transforms/InstCombine/memcpy-2.ll b/test/Transforms/InstCombine/memcpy-2.ll index 4a8a020..a31854c 100644 --- a/test/Transforms/InstCombine/memcpy-2.ll +++ b/test/Transforms/InstCombine/memcpy-2.ll @@ -9,7 +9,7 @@ declare i8 @memcpy(i8*, i8*, i32) ; Check that memcpy functions with the wrong prototype aren't simplified. define i8 @test_no_simplify1(i8* %mem1, i8* %mem2, i32 %size) { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %ret = call i8 @memcpy(i8* %mem1, i8* %mem2, i32 %size) ; CHECK: call i8 @memcpy ret i8 %ret diff --git a/test/Transforms/InstCombine/memcpy-from-global.ll b/test/Transforms/InstCombine/memcpy-from-global.ll index 557b160..58793ab 100644 --- a/test/Transforms/InstCombine/memcpy-from-global.ll +++ b/test/Transforms/InstCombine/memcpy-from-global.ll @@ -8,7 +8,7 @@ entry: %lookupTable1 = bitcast [128 x float]* %lookupTable to i8* ; <i8*> [#uses=1] call void @llvm.memcpy.p0i8.p0i8.i64(i8* %lookupTable1, i8* bitcast ([128 x float]* @C.0.1248 to i8*), i64 512, i32 16, i1 false) -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK-NOT: alloca ; CHECK-NOT: call{{.*}}@llvm.memcpy @@ -50,7 +50,7 @@ define void @test2() { %a = bitcast %T* %A to i8* %b = bitcast %T* %B to i8* -; CHECK: @test2 +; CHECK-LABEL: @test2( ; %A alloca is deleted ; CHECK-NEXT: alloca [124 x i8] @@ -73,7 +73,7 @@ define void @test3() { %a = bitcast %T* %A to i8* call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* bitcast (%T* @G to i8*), i64 124, i32 4, i1 false) call void @bar(i8* %a) readonly -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK-NEXT: call void @bar(i8* getelementptr inbounds (%T* @G, i64 0, i32 0)) ret void } @@ -83,7 +83,7 @@ define void @test4() { %a = bitcast %T* %A to i8* call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* bitcast (%T* @G to i8*), i64 124, i32 4, i1 false) call void @baz(i8* byval %a) -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK-NEXT: call void @baz(i8* byval getelementptr inbounds (%T* @G, i64 0, i32 0)) ret void } @@ -95,7 +95,7 @@ define void @test5() { call void @llvm.lifetime.start(i64 -1, i8* %a) call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* bitcast (%T* @G to i8*), i64 124, i32 4, i1 false) call void @baz(i8* byval %a) -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK-NEXT: call void @baz(i8* byval getelementptr inbounds (%T* @G, i64 0, i32 0)) ret void } @@ -109,7 +109,7 @@ define void @test6() { %a = bitcast %U* %A to i8* call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* bitcast ([2 x %U]* @H to i8*), i64 20, i32 16, i1 false) call void @bar(i8* %a) readonly -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK-NEXT: call void @bar(i8* bitcast ([2 x %U]* @H to i8*)) ret void } @@ -119,7 +119,7 @@ define void @test7() { %a = bitcast %U* %A to i8* call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* bitcast (%U* getelementptr ([2 x %U]* @H, i64 0, i32 0) to i8*), i64 20, i32 4, i1 false) call void @bar(i8* %a) readonly -; CHECK: @test7 +; CHECK-LABEL: @test7( ; CHECK-NEXT: call void @bar(i8* bitcast ([2 x %U]* @H to i8*)) ret void } @@ -129,7 +129,7 @@ define void @test8() { %a = bitcast %U* %A to i8* call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* bitcast (%U* getelementptr ([2 x %U]* @H, i64 0, i32 1) to i8*), i64 20, i32 4, i1 false) call void @bar(i8* %a) readonly -; CHECK: @test8 +; CHECK-LABEL: @test8( ; CHECK: llvm.memcpy ; CHECK: bar ret void @@ -140,7 +140,7 @@ define void @test9() { %a = bitcast %U* %A to i8* call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* bitcast (%U* getelementptr ([2 x %U]* @H, i64 0, i32 1) to i8*), i64 20, i32 4, i1 false) call void @bar(i8* %a) readonly -; CHECK: @test9 +; CHECK-LABEL: @test9( ; CHECK-NEXT: call void @bar(i8* bitcast (%U* getelementptr inbounds ([2 x %U]* @H, i64 0, i64 1) to i8*)) ret void } diff --git a/test/Transforms/InstCombine/memcpy.ll b/test/Transforms/InstCombine/memcpy.ll index 3a68ff9..f66e14c 100644 --- a/test/Transforms/InstCombine/memcpy.ll +++ b/test/Transforms/InstCombine/memcpy.ll @@ -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 } diff --git a/test/Transforms/InstCombine/memcpy_chk-1.ll b/test/Transforms/InstCombine/memcpy_chk-1.ll index 7c7d918..9216ae7 100644 --- a/test/Transforms/InstCombine/memcpy_chk-1.ll +++ b/test/Transforms/InstCombine/memcpy_chk-1.ll @@ -16,7 +16,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 ; Check cases where dstlen >= len. define void @test_simplify1() { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %dst = bitcast %struct.T1* @t1 to i8* %src = bitcast %struct.T2* @t2 to i8* @@ -26,7 +26,7 @@ define void @test_simplify1() { } define void @test_simplify2() { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( %dst = bitcast %struct.T1* @t1 to i8* %src = bitcast %struct.T3* @t3 to i8* @@ -38,7 +38,7 @@ define void @test_simplify2() { ; Check cases where dstlen < len. define void @test_no_simplify1() { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %dst = bitcast %struct.T3* @t3 to i8* %src = bitcast %struct.T1* @t1 to i8* @@ -48,7 +48,7 @@ define void @test_no_simplify1() { } define void @test_no_simplify2() { -; CHECK: @test_no_simplify2 +; CHECK-LABEL: @test_no_simplify2( %dst = bitcast %struct.T1* @t1 to i8* %src = bitcast %struct.T2* @t2 to i8* diff --git a/test/Transforms/InstCombine/memcpy_chk-2.ll b/test/Transforms/InstCombine/memcpy_chk-2.ll index aa43029..320b54f 100644 --- a/test/Transforms/InstCombine/memcpy_chk-2.ll +++ b/test/Transforms/InstCombine/memcpy_chk-2.ll @@ -12,7 +12,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 @t2 = common global %struct.T2 zeroinitializer define void @test_no_simplify() { -; CHECK: @test_no_simplify +; CHECK-LABEL: @test_no_simplify( %dst = bitcast %struct.T1* @t1 to i8* %src = bitcast %struct.T2* @t2 to i8* diff --git a/test/Transforms/InstCombine/memmove-1.ll b/test/Transforms/InstCombine/memmove-1.ll index 53f2f11..0445a60 100644 --- a/test/Transforms/InstCombine/memmove-1.ll +++ b/test/Transforms/InstCombine/memmove-1.ll @@ -9,7 +9,7 @@ declare i8* @memmove(i8*, i8*, i32) ; Check memmove(mem1, mem2, size) -> llvm.memmove(mem1, mem2, size, 1). define i8* @test_simplify1(i8* %mem1, i8* %mem2, i32 %size) { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %ret = call i8* @memmove(i8* %mem1, i8* %mem2, i32 %size) ; CHECK: call void @llvm.memmove ret i8* %ret diff --git a/test/Transforms/InstCombine/memmove-2.ll b/test/Transforms/InstCombine/memmove-2.ll index 23887bc..b20e96b 100644 --- a/test/Transforms/InstCombine/memmove-2.ll +++ b/test/Transforms/InstCombine/memmove-2.ll @@ -9,7 +9,7 @@ declare i8 @memmove(i8*, i8*, i32) ; Check that memmove functions with the wrong prototype aren't simplified. define i8 @test_no_simplify1(i8* %mem1, i8* %mem2, i32 %size) { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %ret = call i8 @memmove(i8* %mem1, i8* %mem2, i32 %size) ; CHECK: call i8 @memmove ret i8 %ret diff --git a/test/Transforms/InstCombine/memmove_chk-1.ll b/test/Transforms/InstCombine/memmove_chk-1.ll index f9ff9a1..6d93bbb 100644 --- a/test/Transforms/InstCombine/memmove_chk-1.ll +++ b/test/Transforms/InstCombine/memmove_chk-1.ll @@ -16,7 +16,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 ; Check cases where dstlen >= len. define void @test_simplify1() { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %dst = bitcast %struct.T1* @t1 to i8* %src = bitcast %struct.T2* @t2 to i8* @@ -26,7 +26,7 @@ define void @test_simplify1() { } define void @test_simplify2() { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( %dst = bitcast %struct.T1* @t1 to i8* %src = bitcast %struct.T3* @t3 to i8* @@ -38,7 +38,7 @@ define void @test_simplify2() { ; Check cases where dstlen < len. define void @test_no_simplify1() { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %dst = bitcast %struct.T3* @t3 to i8* %src = bitcast %struct.T1* @t1 to i8* @@ -48,7 +48,7 @@ define void @test_no_simplify1() { } define void @test_no_simplify2() { -; CHECK: @test_no_simplify2 +; CHECK-LABEL: @test_no_simplify2( %dst = bitcast %struct.T1* @t1 to i8* %src = bitcast %struct.T2* @t2 to i8* diff --git a/test/Transforms/InstCombine/memmove_chk-2.ll b/test/Transforms/InstCombine/memmove_chk-2.ll index f0a915f..adadf90 100644 --- a/test/Transforms/InstCombine/memmove_chk-2.ll +++ b/test/Transforms/InstCombine/memmove_chk-2.ll @@ -12,7 +12,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 @t2 = common global %struct.T2 zeroinitializer define void @test_no_simplify() { -; CHECK: @test_no_simplify +; CHECK-LABEL: @test_no_simplify( %dst = bitcast %struct.T1* @t1 to i8* %src = bitcast %struct.T2* @t2 to i8* diff --git a/test/Transforms/InstCombine/memset-1.ll b/test/Transforms/InstCombine/memset-1.ll index 48b433e..991567d 100644 --- a/test/Transforms/InstCombine/memset-1.ll +++ b/test/Transforms/InstCombine/memset-1.ll @@ -9,7 +9,7 @@ declare i8* @memset(i8*, i32, i32) ; Check memset(mem1, val, size) -> llvm.memset(mem1, val, size, 1). define i8* @test_simplify1(i8* %mem, i32 %val, i32 %size) { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %ret = call i8* @memset(i8* %mem, i32 %val, i32 %size) ; CHECK: call void @llvm.memset ret i8* %ret diff --git a/test/Transforms/InstCombine/memset-2.ll b/test/Transforms/InstCombine/memset-2.ll index 8a90333..5e446cb 100644 --- a/test/Transforms/InstCombine/memset-2.ll +++ b/test/Transforms/InstCombine/memset-2.ll @@ -9,7 +9,7 @@ declare i8 @memset(i8*, i32, i32) ; Check that memset functions with the wrong prototype aren't simplified. define i8 @test_no_simplify1(i8* %mem, i32 %val, i32 %size) { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %ret = call i8 @memset(i8* %mem, i32 %val, i32 %size) ; CHECK: call i8 @memset ret i8 %ret diff --git a/test/Transforms/InstCombine/memset_chk-1.ll b/test/Transforms/InstCombine/memset_chk-1.ll index be4c1cf..47cc7db 100644 --- a/test/Transforms/InstCombine/memset_chk-1.ll +++ b/test/Transforms/InstCombine/memset_chk-1.ll @@ -12,7 +12,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 ; Check cases where dstlen >= len. define void @test_simplify1() { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %dst = bitcast %struct.T* @t to i8* ; CHECK-NEXT: call void @llvm.memset.p0i8.i64 @@ -21,7 +21,7 @@ define void @test_simplify1() { } define void @test_simplify2() { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( %dst = bitcast %struct.T* @t to i8* ; CHECK-NEXT: call void @llvm.memset.p0i8.i64 @@ -30,7 +30,7 @@ define void @test_simplify2() { } define void @test_simplify3() { -; CHECK: @test_simplify3 +; CHECK-LABEL: @test_simplify3( %dst = bitcast %struct.T* @t to i8* ; CHECK-NEXT: call void @llvm.memset.p0i8.i64 @@ -41,7 +41,7 @@ define void @test_simplify3() { ; Check cases where dstlen < len. define void @test_no_simplify1() { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %dst = bitcast %struct.T* @t to i8* ; CHECK-NEXT: call i8* @__memset_chk @@ -50,7 +50,7 @@ define void @test_no_simplify1() { } define void @test_no_simplify2() { -; CHECK: @test_no_simplify2 +; CHECK-LABEL: @test_no_simplify2( %dst = bitcast %struct.T* @t to i8* ; CHECK-NEXT: call i8* @__memset_chk diff --git a/test/Transforms/InstCombine/memset_chk-2.ll b/test/Transforms/InstCombine/memset_chk-2.ll index 60fbf16..bb4f772 100644 --- a/test/Transforms/InstCombine/memset_chk-2.ll +++ b/test/Transforms/InstCombine/memset_chk-2.ll @@ -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 @t = common global %struct.T zeroinitializer define void @test_no_simplify() { -; CHECK: @test_no_simplify +; CHECK-LABEL: @test_no_simplify( %dst = bitcast %struct.T* @t to i8* ; CHECK-NEXT: call i8* @__memset_chk diff --git a/test/Transforms/InstCombine/merge-icmp.ll b/test/Transforms/InstCombine/merge-icmp.ll index 00020b1..b021fe04 100644 --- a/test/Transforms/InstCombine/merge-icmp.ll +++ b/test/Transforms/InstCombine/merge-icmp.ll @@ -8,7 +8,7 @@ define i1 @test1(i16* %x) { %cmp2 = icmp eq i16 %and, 17664 %or = and i1 %cmp1, %cmp2 ret i1 %or -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK-NEXT: load i16 ; CHECK-NEXT: icmp eq i16 %load, 17791 ; CHECK-NEXT: ret i1 @@ -22,7 +22,7 @@ define i1 @test2(i16* %x) { %cmp2 = icmp eq i8 %trunc, 69 %or = and i1 %cmp1, %cmp2 ret i1 %or -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK-NEXT: load i16 ; CHECK-NEXT: icmp eq i16 %load, 32581 ; CHECK-NEXT: ret i1 diff --git a/test/Transforms/InstCombine/mul.ll b/test/Transforms/InstCombine/mul.ll index 16213b8..94fc118 100644 --- a/test/Transforms/InstCombine/mul.ll +++ b/test/Transforms/InstCombine/mul.ll @@ -2,14 +2,14 @@ ; RUN: opt < %s -instcombine -S | FileCheck %s define i32 @test1(i32 %A) { -; CHECK: @test1 +; CHECK-LABEL: @test1( %B = mul i32 %A, 1 ; <i32> [#uses=1] ret i32 %B ; CHECK: ret i32 %A } define i32 @test2(i32 %A) { -; CHECK: @test2 +; CHECK-LABEL: @test2( ; Should convert to an add instruction %B = mul i32 %A, 2 ; <i32> [#uses=1] ret i32 %B @@ -17,7 +17,7 @@ define i32 @test2(i32 %A) { } define i32 @test3(i32 %A) { -; CHECK: @test3 +; CHECK-LABEL: @test3( ; This should disappear entirely %B = mul i32 %A, 0 ; <i32> [#uses=1] ret i32 %B @@ -25,7 +25,7 @@ define i32 @test3(i32 %A) { } define double @test4(double %A) { -; CHECK: @test4 +; CHECK-LABEL: @test4( ; This is safe for FP %B = fmul double 1.000000e+00, %A ; <double> [#uses=1] ret double %B @@ -33,14 +33,14 @@ define double @test4(double %A) { } define i32 @test5(i32 %A) { -; CHECK: @test5 +; CHECK-LABEL: @test5( %B = mul i32 %A, 8 ; <i32> [#uses=1] ret i32 %B ; CHECK: shl i32 %A, 3 } define i8 @test6(i8 %A) { -; CHECK: @test6 +; CHECK-LABEL: @test6( %B = mul i8 %A, 8 ; <i8> [#uses=1] %C = mul i8 %B, 8 ; <i8> [#uses=1] ret i8 %C @@ -48,28 +48,28 @@ define i8 @test6(i8 %A) { } define i32 @test7(i32 %i) { -; CHECK: @test7 +; CHECK-LABEL: @test7( %tmp = mul i32 %i, -1 ; <i32> [#uses=1] ret i32 %tmp ; CHECK: sub i32 0, %i } define i64 @test8(i64 %i) { -; CHECK: @test8 +; CHECK-LABEL: @test8( %j = mul i64 %i, -1 ; <i64> [#uses=1] ret i64 %j ; CHECK: sub i64 0, %i } define i32 @test9(i32 %i) { -; CHECK: @test9 +; CHECK-LABEL: @test9( %j = mul i32 %i, -1 ; <i32> [#uses=1] ret i32 %j ; CHECK: sub i32 0, %i } define i32 @test10(i32 %a, i32 %b) { -; CHECK: @test10 +; CHECK-LABEL: @test10( %c = icmp slt i32 %a, 0 ; <i1> [#uses=1] %d = zext i1 %c to i32 ; <i32> [#uses=1] ; e = b & (a >> 31) @@ -81,7 +81,7 @@ define i32 @test10(i32 %a, i32 %b) { } define i32 @test11(i32 %a, i32 %b) { -; CHECK: @test11 +; CHECK-LABEL: @test11( %c = icmp sle i32 %a, -1 ; <i1> [#uses=1] %d = zext i1 %c to i32 ; <i32> [#uses=1] ; e = b & (a >> 31) @@ -93,7 +93,7 @@ define i32 @test11(i32 %a, i32 %b) { } define i32 @test12(i32 %a, i32 %b) { -; CHECK: @test12 +; CHECK-LABEL: @test12( %c = icmp ugt i32 %a, 2147483647 ; <i1> [#uses=1] %d = zext i1 %c to i32 ; <i32> [#uses=1] %e = mul i32 %d, %b ; <i32> [#uses=1] @@ -106,7 +106,7 @@ define i32 @test12(i32 %a, i32 %b) { ; PR2642 define internal void @test13(<4 x float>*) { -; CHECK: @test13 +; CHECK-LABEL: @test13( load <4 x float>* %0, align 1 fmul <4 x float> %2, < float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00 > store <4 x float> %3, <4 x float>* %0, align 1 @@ -115,7 +115,7 @@ define internal void @test13(<4 x float>*) { } define <16 x i8> @test14(<16 x i8> %a) { -; CHECK: @test14 +; CHECK-LABEL: @test14( %b = mul <16 x i8> %a, zeroinitializer ret <16 x i8> %b ; CHECK-NEXT: ret <16 x i8> zeroinitializer @@ -123,7 +123,7 @@ define <16 x i8> @test14(<16 x i8> %a) { ; rdar://7293527 define i32 @test15(i32 %A, i32 %B) { -; CHECK: @test15 +; CHECK-LABEL: @test15( entry: %shl = shl i32 1, %B %m = mul i32 %shl, %A @@ -133,7 +133,7 @@ entry: ; X * Y (when Y is 0 or 1) --> x & (0-Y) define i32 @test16(i32 %b, i1 %c) { -; CHECK: @test16 +; CHECK-LABEL: @test16( %d = zext i1 %c to i32 ; <i32> [#uses=1] ; e = b & (a >> 31) %e = mul i32 %d, %b ; <i32> [#uses=1] @@ -144,7 +144,7 @@ define i32 @test16(i32 %b, i1 %c) { ; X * Y (when Y is 0 or 1) --> x & (0-Y) define i32 @test17(i32 %a, i32 %b) { -; CHECK: @test17 +; CHECK-LABEL: @test17( %a.lobit = lshr i32 %a, 31 %e = mul i32 %a.lobit, %b ret i32 %e @@ -154,7 +154,7 @@ define i32 @test17(i32 %a, i32 %b) { } define i32 @test18(i32 %A, i32 %B) { -; CHECK: @test18 +; CHECK-LABEL: @test18( %C = and i32 %A, 1 %D = and i32 %B, 1 @@ -168,7 +168,7 @@ declare {i32, i1} @llvm.smul.with.overflow.i32(i32, i32) declare void @use(i1) define i32 @test19(i32 %A, i32 %B) { -; CHECK: @test19 +; CHECK-LABEL: @test19( %C = and i32 %A, 1 %D = and i32 %B, 1 diff --git a/test/Transforms/InstCombine/no-negzero.ll b/test/Transforms/InstCombine/no-negzero.ll index f295130..4ed2836 100644 --- a/test/Transforms/InstCombine/no-negzero.ll +++ b/test/Transforms/InstCombine/no-negzero.ll @@ -4,7 +4,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" target triple = "i386-apple-darwin9.8" -; CHECK: @mysqrt +; CHECK-LABEL: @mysqrt( ; CHECK-NOT: fadd ; CHECK: ret define double @mysqrt(double %x) nounwind { diff --git a/test/Transforms/InstCombine/nsw.ll b/test/Transforms/InstCombine/nsw.ll index 0140c2f..0bed767 100644 --- a/test/Transforms/InstCombine/nsw.ll +++ b/test/Transforms/InstCombine/nsw.ll @@ -1,6 +1,6 @@ ; RUN: opt < %s -instcombine -S | FileCheck %s -; CHECK: @sub1 +; CHECK-LABEL: @sub1( ; CHECK: %y = sub i32 0, %x ; CHECK: %z = sdiv i32 %y, 337 ; CHECK: ret i32 %z @@ -10,7 +10,7 @@ define i32 @sub1(i32 %x) { ret i32 %z } -; CHECK: @sub2 +; CHECK-LABEL: @sub2( ; CHECK: %z = sdiv i32 %x, -337 ; CHECK: ret i32 %z define i32 @sub2(i32 %x) { @@ -19,7 +19,7 @@ define i32 @sub2(i32 %x) { ret i32 %z } -; CHECK: @shl_icmp +; CHECK-LABEL: @shl_icmp( ; CHECK: %B = icmp eq i64 %X, 0 ; CHECK: ret i1 %B define i1 @shl_icmp(i64 %X) nounwind { @@ -28,7 +28,7 @@ define i1 @shl_icmp(i64 %X) nounwind { ret i1 %B } -; CHECK: @shl1 +; CHECK-LABEL: @shl1( ; CHECK: %B = shl nuw nsw i64 %A, 8 ; CHECK: ret i64 %B define i64 @shl1(i64 %X, i64* %P) nounwind { @@ -38,7 +38,7 @@ define i64 @shl1(i64 %X, i64* %P) nounwind { ret i64 %B } -; CHECK: @preserve1 +; CHECK-LABEL: @preserve1( ; CHECK: add nsw i32 %x, 5 define i32 @preserve1(i32 %x) nounwind { %add = add nsw i32 %x, 2 @@ -46,7 +46,7 @@ define i32 @preserve1(i32 %x) nounwind { ret i32 %add3 } -; CHECK: @nopreserve1 +; CHECK-LABEL: @nopreserve1( ; CHECK: add i8 %x, -126 define i8 @nopreserve1(i8 %x) nounwind { %add = add nsw i8 %x, 127 @@ -54,7 +54,7 @@ define i8 @nopreserve1(i8 %x) nounwind { ret i8 %add3 } -; CHECK: @nopreserve2 +; CHECK-LABEL: @nopreserve2( ; CHECK: add i8 %x, 3 define i8 @nopreserve2(i8 %x) nounwind { %add = add i8 %x, 1 @@ -62,7 +62,7 @@ define i8 @nopreserve2(i8 %x) nounwind { ret i8 %add3 } -; CHECK: @nopreserve3 +; CHECK-LABEL: @nopreserve3( ; CHECK: add i8 %A, %B ; CHECK: add i8 define i8 @nopreserve3(i8 %A, i8 %B) nounwind { @@ -72,7 +72,7 @@ define i8 @nopreserve3(i8 %A, i8 %B) nounwind { ret i8 %add } -; CHECK: @nopreserve4 +; CHECK-LABEL: @nopreserve4( ; CHECK: add i8 %A, %B ; CHECK: add i8 define i8 @nopreserve4(i8 %A, i8 %B) nounwind { diff --git a/test/Transforms/InstCombine/objsize-64.ll b/test/Transforms/InstCombine/objsize-64.ll index 530e123..5046724 100644 --- a/test/Transforms/InstCombine/objsize-64.ll +++ b/test/Transforms/InstCombine/objsize-64.ll @@ -7,7 +7,7 @@ declare i32 @__gxx_personality_v0(...) declare void @__cxa_call_unexpected(i8*) declare i64 @llvm.objectsize.i64(i8*, i1) nounwind readonly -; CHECK: @f1 +; CHECK-LABEL: @f1( define i64 @f1(i8 **%esc) { %call = call i8* @malloc(i32 4) store i8* %call, i8** %esc @@ -17,7 +17,7 @@ define i64 @f1(i8 **%esc) { } -; CHECK: @f2 +; CHECK-LABEL: @f2( define i64 @f2(i8** %esc) nounwind uwtable ssp { entry: ; CHECK: invoke noalias i8* @_Znwm(i64 13) diff --git a/test/Transforms/InstCombine/objsize.ll b/test/Transforms/InstCombine/objsize.ll index 122c650..b5351e9 100644 --- a/test/Transforms/InstCombine/objsize.ll +++ b/test/Transforms/InstCombine/objsize.ll @@ -7,14 +7,14 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 @.str = private constant [8 x i8] c"abcdefg\00" ; <[8 x i8]*> define i32 @foo() nounwind { -; CHECK: @foo +; CHECK-LABEL: @foo( ; CHECK-NEXT: ret i32 60 %1 = call i32 @llvm.objectsize.i32(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i1 false) ret i32 %1 } define i8* @bar() nounwind { -; CHECK: @bar +; CHECK-LABEL: @bar( entry: %retval = alloca i8* %0 = call i32 @llvm.objectsize.i32(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i1 false) @@ -32,7 +32,7 @@ cond.false: } define i32 @f() nounwind { -; CHECK: @f +; CHECK-LABEL: @f( ; CHECK-NEXT: ret i32 0 %1 = call i32 @llvm.objectsize.i32(i8* getelementptr ([60 x i8]* @a, i32 1, i32 0), i1 false) ret i32 %1 @@ -41,7 +41,7 @@ define i32 @f() nounwind { @window = external global [0 x i8] define i1 @baz() nounwind { -; CHECK: @baz +; CHECK-LABEL: @baz( ; CHECK-NEXT: objectsize %1 = tail call i32 @llvm.objectsize.i32(i8* getelementptr inbounds ([0 x i8]* @window, i32 0, i32 0), i1 false) %2 = icmp eq i32 %1, -1 @@ -49,7 +49,7 @@ define i1 @baz() nounwind { } define void @test1(i8* %q, i32 %x) nounwind noinline { -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK: objectsize.i32 entry: %0 = call i32 @llvm.objectsize.i32(i8* getelementptr inbounds ([0 x i8]* @window, i32 0, i32 10), i1 false) ; <i64> [#uses=1] @@ -66,7 +66,7 @@ entry: @.str5 = private constant [9 x i32] [i32 97, i32 98, i32 99, i32 100, i32 0, i32 101, i32 102, i32 103, i32 0], align 4 define i32 @test2() nounwind { -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK-NEXT: ret i32 34 %1 = call i32 @llvm.objectsize.i32(i8* getelementptr (i8* bitcast ([9 x i32]* @.str5 to i8*), i32 2), i1 false) ret i32 %1 @@ -82,7 +82,7 @@ declare i32 @llvm.objectsize.i32(i8*, i1) nounwind readonly declare i8* @__inline_memcpy_chk(i8*, i8*, i32) nounwind inlinehint define void @test3() nounwind { -; CHECK: @test3 +; CHECK-LABEL: @test3( entry: br i1 undef, label %bb11, label %bb12 @@ -107,7 +107,7 @@ bb12: %struct.data = type { [100 x i32], [100 x i32], [1024 x i8] } define i32 @test4(i8** %esc) nounwind ssp { -; CHECK: @test4 +; CHECK-LABEL: @test4( entry: %0 = alloca %struct.data, align 8 %1 = bitcast %struct.data* %0 to i8* @@ -123,7 +123,7 @@ entry: @s = external global i8* define i8* @test5(i32 %n) nounwind ssp { -; CHECK: @test5 +; CHECK-LABEL: @test5( entry: %0 = tail call noalias i8* @malloc(i32 20) nounwind %1 = tail call i32 @llvm.objectsize.i32(i8* %0, i1 false) @@ -135,7 +135,7 @@ entry: } define void @test6(i32 %n) nounwind ssp { -; CHECK: @test6 +; CHECK-LABEL: @test6( entry: %0 = tail call noalias i8* @malloc(i32 20) nounwind %1 = tail call i32 @llvm.objectsize.i32(i8* %0, i1 false) @@ -151,7 +151,7 @@ declare i8* @__memset_chk(i8*, i32, i32, i32) nounwind declare noalias i8* @malloc(i32) nounwind define i32 @test7(i8** %esc) { -; CHECK: @test7 +; CHECK-LABEL: @test7( %alloc = call noalias i8* @malloc(i32 48) nounwind store i8* %alloc, i8** %esc %gep = getelementptr inbounds i8* %alloc, i32 16 @@ -163,7 +163,7 @@ define i32 @test7(i8** %esc) { declare noalias i8* @calloc(i32, i32) nounwind define i32 @test8(i8** %esc) { -; CHECK: @test8 +; CHECK-LABEL: @test8( %alloc = call noalias i8* @calloc(i32 5, i32 7) nounwind store i8* %alloc, i8** %esc %gep = getelementptr inbounds i8* %alloc, i32 5 @@ -175,7 +175,7 @@ define i32 @test8(i8** %esc) { declare noalias i8* @strdup(i8* nocapture) nounwind declare noalias i8* @strndup(i8* nocapture, i32) nounwind -; CHECK: @test9 +; CHECK-LABEL: @test9( define i32 @test9(i8** %esc) { %call = tail call i8* @strdup(i8* getelementptr inbounds ([8 x i8]* @.str, i64 0, i64 0)) nounwind store i8* %call, i8** %esc, align 8 @@ -184,7 +184,7 @@ define i32 @test9(i8** %esc) { ret i32 %1 } -; CHECK: @test10 +; CHECK-LABEL: @test10( define i32 @test10(i8** %esc) { %call = tail call i8* @strndup(i8* getelementptr inbounds ([8 x i8]* @.str, i64 0, i64 0), i32 3) nounwind store i8* %call, i8** %esc, align 8 @@ -193,7 +193,7 @@ define i32 @test10(i8** %esc) { ret i32 %1 } -; CHECK: @test11 +; CHECK-LABEL: @test11( define i32 @test11(i8** %esc) { %call = tail call i8* @strndup(i8* getelementptr inbounds ([8 x i8]* @.str, i64 0, i64 0), i32 7) nounwind store i8* %call, i8** %esc, align 8 @@ -202,7 +202,7 @@ define i32 @test11(i8** %esc) { ret i32 %1 } -; CHECK: @test12 +; CHECK-LABEL: @test12( define i32 @test12(i8** %esc) { %call = tail call i8* @strndup(i8* getelementptr inbounds ([8 x i8]* @.str, i64 0, i64 0), i32 8) nounwind store i8* %call, i8** %esc, align 8 @@ -211,7 +211,7 @@ define i32 @test12(i8** %esc) { ret i32 %1 } -; CHECK: @test13 +; CHECK-LABEL: @test13( define i32 @test13(i8** %esc) { %call = tail call i8* @strndup(i8* getelementptr inbounds ([8 x i8]* @.str, i64 0, i64 0), i32 57) nounwind store i8* %call, i8** %esc, align 8 @@ -220,7 +220,7 @@ define i32 @test13(i8** %esc) { ret i32 %1 } -; CHECK: @PR13390 +; CHECK-LABEL: @PR13390( define i32 @PR13390(i1 %bool, i8* %a) { entry: %cond = or i1 %bool, true @@ -239,7 +239,7 @@ return: ret i32 42 } -; CHECK: @PR13621 +; CHECK-LABEL: @PR13621( define i32 @PR13621(i1 %bool) nounwind { entry: %cond = or i1 %bool, true @@ -259,7 +259,7 @@ return: @globalalias = alias internal [60 x i8]* @a -; CHECK: @test18 +; CHECK-LABEL: @test18( ; CHECK-NEXT: ret i32 60 define i32 @test18() { %bc = bitcast [60 x i8]* @globalalias to i8* @@ -269,7 +269,7 @@ define i32 @test18() { @globalalias2 = alias weak [60 x i8]* @a -; CHECK: @test19 +; CHECK-LABEL: @test19( ; CHECK: llvm.objectsize define i32 @test19() { %bc = bitcast [60 x i8]* @globalalias2 to i8* diff --git a/test/Transforms/InstCombine/or-fcmp.ll b/test/Transforms/InstCombine/or-fcmp.ll index 09a3c99..29963f6 100644 --- a/test/Transforms/InstCombine/or-fcmp.ll +++ b/test/Transforms/InstCombine/or-fcmp.ll @@ -1,6 +1,6 @@ ; RUN: opt < %s -instcombine -S | FileCheck %s -; CHECK: @t1 +; CHECK-LABEL: @t1( define zeroext i8 @t1(float %x, float %y) nounwind { %a = fcmp ueq float %x, %y ; <i1> [#uses=1] %b = fcmp uno float %x, %y ; <i1> [#uses=1] @@ -11,7 +11,7 @@ define zeroext i8 @t1(float %x, float %y) nounwind { ret i8 %retval } -; CHECK: @t2 +; CHECK-LABEL: @t2( define zeroext i8 @t2(float %x, float %y) nounwind { %a = fcmp olt float %x, %y ; <i1> [#uses=1] %b = fcmp oeq float %x, %y ; <i1> [#uses=1] @@ -23,7 +23,7 @@ define zeroext i8 @t2(float %x, float %y) nounwind { ret i8 %retval } -; CHECK: @t3 +; CHECK-LABEL: @t3( define zeroext i8 @t3(float %x, float %y) nounwind { %a = fcmp ult float %x, %y ; <i1> [#uses=1] %b = fcmp uge float %x, %y ; <i1> [#uses=1] @@ -33,7 +33,7 @@ define zeroext i8 @t3(float %x, float %y) nounwind { ret i8 %retval } -; CHECK: @t4 +; CHECK-LABEL: @t4( define zeroext i8 @t4(float %x, float %y) nounwind { %a = fcmp ult float %x, %y ; <i1> [#uses=1] %b = fcmp ugt float %x, %y ; <i1> [#uses=1] @@ -45,7 +45,7 @@ define zeroext i8 @t4(float %x, float %y) nounwind { ret i8 %retval } -; CHECK: @t5 +; CHECK-LABEL: @t5( define zeroext i8 @t5(float %x, float %y) nounwind { %a = fcmp olt float %x, %y ; <i1> [#uses=1] %b = fcmp oge float %x, %y ; <i1> [#uses=1] diff --git a/test/Transforms/InstCombine/or-xor.ll b/test/Transforms/InstCombine/or-xor.ll index f496dd4..cec36f1 100644 --- a/test/Transforms/InstCombine/or-xor.ll +++ b/test/Transforms/InstCombine/or-xor.ll @@ -5,7 +5,7 @@ define i32 @test1(i32 %x, i32 %y) nounwind { %not = xor i32 %or, -1 %z = or i32 %x, %not ret i32 %z -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK-NEXT: %y.not = xor i32 %y, -1 ; CHECK-NEXT: %z = or i32 %y.not, %x ; CHECK-NEXT: ret i32 %z @@ -16,7 +16,7 @@ define i32 @test2(i32 %x, i32 %y) nounwind { %not = xor i32 %or, -1 %z = or i32 %y, %not ret i32 %z -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK-NEXT: %x.not = xor i32 %x, -1 ; CHECK-NEXT: %z = or i32 %x.not, %y ; CHECK-NEXT: ret i32 %z @@ -27,7 +27,7 @@ define i32 @test3(i32 %x, i32 %y) nounwind { %not = xor i32 %xor, -1 %z = or i32 %x, %not ret i32 %z -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK-NEXT: %y.not = xor i32 %y, -1 ; CHECK-NEXT: %z = or i32 %y.not, %x ; CHECK-NEXT: ret i32 %z @@ -38,7 +38,7 @@ define i32 @test4(i32 %x, i32 %y) nounwind { %not = xor i32 %xor, -1 %z = or i32 %y, %not ret i32 %z -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK-NEXT: %x.not = xor i32 %x, -1 ; CHECK-NEXT: %z = or i32 %x.not, %y ; CHECK-NEXT: ret i32 %z @@ -49,7 +49,7 @@ define i32 @test5(i32 %x, i32 %y) nounwind { %not = xor i32 %and, -1 %z = or i32 %x, %not ret i32 %z -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK-NEXT: ret i32 -1 } @@ -58,7 +58,7 @@ define i32 @test6(i32 %x, i32 %y) nounwind { %not = xor i32 %and, -1 %z = or i32 %y, %not ret i32 %z -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK-NEXT: ret i32 -1 } @@ -66,7 +66,7 @@ define i32 @test7(i32 %x, i32 %y) nounwind { %xor = xor i32 %x, %y %z = or i32 %y, %xor ret i32 %z -; CHECK: @test7 +; CHECK-LABEL: @test7( ; CHECK-NEXT: %z = or i32 %x, %y ; CHECK-NEXT: ret i32 %z } @@ -76,7 +76,7 @@ define i32 @test8(i32 %x, i32 %y) nounwind { %xor = xor i32 %x, %not %z = or i32 %y, %xor ret i32 %z -; CHECK: @test8 +; CHECK-LABEL: @test8( ; CHECK-NEXT: %x.not = xor i32 %x, -1 ; CHECK-NEXT: %z = or i32 %x.not, %y ; CHECK-NEXT: ret i32 %z @@ -87,7 +87,7 @@ define i32 @test9(i32 %x, i32 %y) nounwind { %xor = xor i32 %not, %y %z = or i32 %x, %xor ret i32 %z -; CHECK: @test9 +; CHECK-LABEL: @test9( ; CHECK-NEXT: %y.not = xor i32 %y, -1 ; CHECK-NEXT: %z = or i32 %y.not, %x ; CHECK-NEXT: ret i32 %z diff --git a/test/Transforms/InstCombine/or.ll b/test/Transforms/InstCombine/or.ll index 7226bd9..1cd897e 100644 --- a/test/Transforms/InstCombine/or.ll +++ b/test/Transforms/InstCombine/or.ll @@ -6,49 +6,49 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 define i32 @test1(i32 %A) { %B = or i32 %A, 0 ret i32 %B -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK: ret i32 %A } define i32 @test2(i32 %A) { %B = or i32 %A, -1 ret i32 %B -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK: ret i32 -1 } define i8 @test2a(i8 %A) { %B = or i8 %A, -1 ret i8 %B -; CHECK: @test2a +; CHECK-LABEL: @test2a( ; CHECK: ret i8 -1 } define i1 @test3(i1 %A) { %B = or i1 %A, false ret i1 %B -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK: ret i1 %A } define i1 @test4(i1 %A) { %B = or i1 %A, true ret i1 %B -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK: ret i1 true } define i1 @test5(i1 %A) { %B = or i1 %A, %A ret i1 %B -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK: ret i1 %A } define i32 @test6(i32 %A) { %B = or i32 %A, %A ret i32 %B -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK: ret i32 %A } @@ -57,7 +57,7 @@ define i32 @test7(i32 %A) { %NotA = xor i32 -1, %A %B = or i32 %A, %NotA ret i32 %B -; CHECK: @test7 +; CHECK-LABEL: @test7( ; CHECK: ret i32 -1 } @@ -65,7 +65,7 @@ define i8 @test8(i8 %A) { %B = or i8 %A, -2 %C = or i8 %B, 1 ret i8 %C -; CHECK: @test8 +; CHECK-LABEL: @test8( ; CHECK: ret i8 -1 } @@ -75,7 +75,7 @@ define i8 @test9(i8 %A, i8 %B) { %D = or i8 %B, -2 %E = or i8 %C, %D ret i8 %E -; CHECK: @test9 +; CHECK-LABEL: @test9( ; CHECK: ret i8 -1 } @@ -85,7 +85,7 @@ define i8 @test10(i8 %A) { ; (X & C1) | C2 --> (X | C2) & (C1|C2) %D = or i8 %C, -2 ret i8 %D -; CHECK: @test10 +; CHECK-LABEL: @test10( ; CHECK: ret i8 -2 } @@ -96,7 +96,7 @@ define i8 @test11(i8 %A) { %D = or i8 %C, 1 %E = xor i8 %D, 12 ret i8 %E -; CHECK: @test11 +; CHECK-LABEL: @test11( ; CHECK: ret i8 -1 } @@ -105,7 +105,7 @@ define i32 @test12(i32 %A) { %B = or i32 %A, 4 %C = and i32 %B, 8 ret i32 %C -; CHECK: @test12 +; CHECK-LABEL: @test12( ; CHECK: %C = and i32 %A, 8 ; CHECK: ret i32 %C } @@ -115,7 +115,7 @@ define i32 @test13(i32 %A) { ; Always equal to 8 %C = and i32 %B, 8 ret i32 %C -; CHECK: @test13 +; CHECK-LABEL: @test13( ; CHECK: ret i32 8 } @@ -125,7 +125,7 @@ define i1 @test14(i32 %A, i32 %B) { ; (A < B) | (A > B) === A != B %D = or i1 %C1, %C2 ret i1 %D -; CHECK: @test14 +; CHECK-LABEL: @test14( ; CHECK: icmp ne i32 %A, %B ; CHECK: ret i1 } @@ -136,7 +136,7 @@ define i1 @test15(i32 %A, i32 %B) { ; (A < B) | (A == B) === A <= B %D = or i1 %C1, %C2 ret i1 %D -; CHECK: @test15 +; CHECK-LABEL: @test15( ; CHECK: icmp ule i32 %A, %B ; CHECK: ret i1 } @@ -148,7 +148,7 @@ define i32 @test16(i32 %A) { ; %D = and int %B, -1 == %B %D = or i32 %B, %C ret i32 %D -; CHECK: @test16 +; CHECK-LABEL: @test16( ; CHECK: ret i32 %A } @@ -158,7 +158,7 @@ define i32 @test17(i32 %A) { ; %D = and int %B, 5 %D = or i32 %B, %C ret i32 %D -; CHECK: @test17 +; CHECK-LABEL: @test17( ; CHECK: %D = and i32 %A, 5 ; CHECK: ret i32 %D } @@ -169,7 +169,7 @@ define i1 @test18(i32 %A) { ;; (A-50) >u 50 %D = or i1 %B, %C ret i1 %D -; CHECK: @test18 +; CHECK-LABEL: @test18( ; CHECK: add i32 ; CHECK: icmp ugt ; CHECK: ret i1 @@ -181,7 +181,7 @@ define i1 @test19(i32 %A) { ;; (A&-2) == 50 %D = or i1 %B, %C ret i1 %D -; CHECK: @test19 +; CHECK-LABEL: @test19( ; CHECK: and i32 ; CHECK: icmp eq ; CHECK: ret i1 @@ -191,7 +191,7 @@ define i32 @test20(i32 %x) { %y = and i32 %x, 123 %z = or i32 %y, %x ret i32 %z -; CHECK: @test20 +; CHECK-LABEL: @test20( ; CHECK: ret i32 %x } @@ -202,7 +202,7 @@ define i32 @test21(i32 %tmp.1) { ;; add tmp.1, 2 %tmp.6 = or i32 %tmp.5, %tmp.3 ret i32 %tmp.6 -; CHECK: @test21 +; CHECK-LABEL: @test21( ; CHECK: add i32 %{{[^,]*}}, 2 ; CHECK: ret i32 } @@ -212,7 +212,7 @@ define i32 @test22(i32 %B) { %ELIM7 = and i32 %B, -2 %ELIM5 = or i32 %ELIM41, %ELIM7 ret i32 %ELIM5 -; CHECK: @test22 +; CHECK-LABEL: @test22( ; CHECK: ret i32 %B } @@ -222,7 +222,7 @@ define i16 @test23(i16 %A) { %C = or i16 %B, -32768 %D = xor i16 %C, 8193 ret i16 %D -; CHECK: @test23 +; CHECK-LABEL: @test23( ; CHECK: %B = lshr i16 %A, 1 ; CHECK: %D = xor i16 %B, -24575 ; CHECK: ret i16 %D @@ -235,7 +235,7 @@ define i1 @test24(double %X, double %Y) { %bothcond = or i1 %tmp13, %tmp9 ; <i1> [#uses=1] ret i1 %bothcond -; CHECK: @test24 +; CHECK-LABEL: @test24( ; CHECK: = fcmp uno double %Y, %X ; CHECK: ret i1 } @@ -248,7 +248,7 @@ define i1 @test25(i32 %A, i32 %B) { %F = xor i1 %E, -1 ret i1 %F -; CHECK: @test25 +; CHECK-LABEL: @test25( ; CHECK: icmp ne i32 %A, 0 ; CHECK-NEXT: icmp ne i32 %B, 57 ; CHECK-NEXT: %F = and i1 @@ -262,7 +262,7 @@ define i1 @test26(i32 %A, i32 %B) { ; (A == 0) & (A == 0) --> (A|B) == 0 %D = and i1 %C1, %C2 ret i1 %D -; CHECK: @test26 +; CHECK-LABEL: @test26( ; CHECK: or i32 %A, %B ; CHECK: icmp eq i32 {{.*}}, 0 ; CHECK: ret i1 @@ -274,7 +274,7 @@ define i1 @test27(i32* %A, i32* %B) { %D = or i32 %C1, %C2 %E = icmp eq i32 %D, 0 ret i1 %E -; CHECK: @test27 +; CHECK-LABEL: @test27( ; CHECK: icmp eq i32* %A, null ; CHECK: icmp eq i32* %B, null ; CHECK: and i1 @@ -288,7 +288,7 @@ define i1 @test28(i32 %A, i32 %B) { ; (A != 0) | (A != 0) --> (A|B) != 0 %D = or i1 %C1, %C2 ret i1 %D -; CHECK: @test28 +; CHECK-LABEL: @test28( ; CHECK: or i32 %A, %B ; CHECK: icmp ne i32 {{.*}}, 0 ; CHECK: ret i1 @@ -300,7 +300,7 @@ define i1 @test29(i32* %A, i32* %B) { %D = or i32 %C1, %C2 %E = icmp ne i32 %D, 0 ret i1 %E -; CHECK: @test29 +; CHECK-LABEL: @test29( ; CHECK: icmp ne i32* %A, null ; CHECK: icmp ne i32* %B, null ; CHECK: or i1 @@ -315,7 +315,7 @@ entry: %D = and i32 %B, 40186 %E = or i32 %D, %C ret i32 %E -; CHECK: @test30 +; CHECK-LABEL: @test30( ; CHECK: %D = and i32 %A, -58312 ; CHECK: %E = or i32 %D, 32962 ; CHECK: ret i32 %E @@ -331,7 +331,7 @@ define i64 @test31(i64 %A) nounwind readnone ssp noredzone { %F = or i64 %D, %E ret i64 %F -; CHECK: @test31 +; CHECK-LABEL: @test31( ; CHECK-NEXT: %E = and i64 %A, 4294908984 ; CHECK-NEXT: %F = or i64 %E, 32962 ; CHECK-NEXT: ret i64 %F @@ -345,7 +345,7 @@ define <4 x i32> @test32(<4 x i1> %and.i1352, <4 x i32> %vecinit6.i176, <4 x i32 %or.i = or <4 x i32> %and.i, %and.i129 ; <<4 x i32>> [#uses=1] ret <4 x i32> %or.i ; codegen is mature enough to handle vector selects. -; CHECK: @test32 +; CHECK-LABEL: @test32( ; CHECK: select <4 x i1> %and.i1352, <4 x i32> %vecinit6.i176, <4 x i32> %vecinit6.i191 } @@ -353,7 +353,7 @@ define i1 @test33(i1 %X, i1 %Y) { %a = or i1 %X, %Y %b = or i1 %a, %X ret i1 %b -; CHECK: @test33 +; CHECK-LABEL: @test33( ; CHECK-NEXT: or i1 %X, %Y ; CHECK-NEXT: ret } @@ -362,7 +362,7 @@ define i32 @test34(i32 %X, i32 %Y) { %a = or i32 %X, %Y %b = or i32 %Y, %a ret i32 %b -; CHECK: @test34 +; CHECK-LABEL: @test34( ; CHECK-NEXT: or i32 %X, %Y ; CHECK-NEXT: ret } @@ -371,7 +371,7 @@ define i32 @test35(i32 %a, i32 %b) { %1 = or i32 %a, 1135 %2 = or i32 %1, %b ret i32 %2 - ; CHECK: @test35 + ; CHECK-LABEL: @test35( ; CHECK-NEXT: or i32 %a, %b ; CHECK-NEXT: or i32 %1, 1135 } @@ -383,14 +383,14 @@ define i1 @test36(i32 %x) { %cmp3 = icmp eq i32 %x, 25 %ret2 = or i1 %ret1, %cmp3 ret i1 %ret2 -; CHECK: @test36 +; CHECK-LABEL: @test36( ; CHECK-NEXT: %x.off = add i32 %x, -23 ; CHECK-NEXT: icmp ult i32 %x.off, 3 ; CHECK-NEXT: ret i1 } define i32 @test37(i32* %xp, i32 %y) { -; CHECK: @test37 +; CHECK-LABEL: @test37( ; CHECK: select i1 %tobool, i32 -1, i32 %x %tobool = icmp ne i32 %y, 0 %sext = sext i1 %tobool to i32 @@ -400,7 +400,7 @@ define i32 @test37(i32* %xp, i32 %y) { } define i32 @test38(i32* %xp, i32 %y) { -; CHECK: @test38 +; CHECK-LABEL: @test38( ; CHECK: select i1 %tobool, i32 -1, i32 %x %tobool = icmp ne i32 %y, 0 %sext = sext i1 %tobool to i32 diff --git a/test/Transforms/InstCombine/osx-names.ll b/test/Transforms/InstCombine/osx-names.ll index 7b83526..926caad 100644 --- a/test/Transforms/InstCombine/osx-names.ll +++ b/test/Transforms/InstCombine/osx-names.ll @@ -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 diff --git a/test/Transforms/InstCombine/overflow.ll b/test/Transforms/InstCombine/overflow.ll index 81ceef8..3eddc80 100644 --- a/test/Transforms/InstCombine/overflow.ll +++ b/test/Transforms/InstCombine/overflow.ll @@ -3,7 +3,7 @@ declare void @throwAnExceptionOrWhatever() -; CHECK: @test1 +; CHECK-LABEL: @test1( define i32 @test1(i32 %a, i32 %b) nounwind ssp { entry: ; CHECK-NOT: sext @@ -26,7 +26,7 @@ if.end: ret i32 %conv9 } -; CHECK: @test2 +; CHECK-LABEL: @test2( ; This form should not be promoted for two reasons: 1) it is unprofitable to ; promote it since the add.off instruction has another use, and 2) it is unsafe ; because the add-with-off makes the high bits of the original add live. @@ -76,7 +76,7 @@ if.end: ; CHECK: ret i64 } -; CHECK: @test4 +; CHECK-LABEL: @test4( ; Should be able to form an i8 sadd computed in an i32. define zeroext i8 @test4(i8 signext %a, i8 signext %b) nounwind ssp { entry: @@ -97,7 +97,7 @@ if.end: ; preds = %entry ; CHECK: ret i8 } -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK: llvm.uadd.with.overflow ; CHECK: ret i64 define i64 @test5(i64 %a, i64 %b) nounwind ssp { @@ -108,7 +108,7 @@ entry: ret i64 %Q } -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK: llvm.uadd.with.overflow ; CHECK: ret i64 define i64 @test6(i64 %a, i64 %b) nounwind ssp { @@ -119,7 +119,7 @@ entry: ret i64 %Q } -; CHECK: @test7 +; CHECK-LABEL: @test7( ; CHECK: llvm.uadd.with.overflow ; CHECK: ret i64 define i64 @test7(i64 %a, i64 %b) nounwind ssp { @@ -130,7 +130,7 @@ entry: ret i64 %Q } -; CHECK: @test8 +; CHECK-LABEL: @test8( ; PR11438 ; This is @test1, but the operands are not sign-extended. Make sure ; we don't transform this case. diff --git a/test/Transforms/InstCombine/phi.ll b/test/Transforms/InstCombine/phi.ll index 1c307d4..6e31465 100644 --- a/test/Transforms/InstCombine/phi.ll +++ b/test/Transforms/InstCombine/phi.ll @@ -15,7 +15,7 @@ BB1: BB2: ret i32 %A -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK: BB1: ; CHECK-NEXT: ret i32 %A } @@ -31,7 +31,7 @@ BB2: ; Combine away PHI nodes with same values %B = phi i32 [ %A, %BB0 ], [ %A, %BB1 ] ret i32 %B -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK: BB2: ; CHECK-NEXT: ret i32 %A } @@ -47,7 +47,7 @@ Loop: Exit: ret i32 %B -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK: Exit: ; CHECK-NEXT: ret i32 %A } @@ -64,7 +64,7 @@ Loop: ; preds = %L2, %Loop L2: ; preds = %Loop br label %Loop -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK: Loop: ; CHECK-NEXT: br i1 %b } @@ -80,7 +80,7 @@ Loop: ; preds = %Loop, %BB0 Exit: ; preds = %Loop ret i32 %B -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK: Loop: ; CHECK-NEXT: br i1 %b ; CHECK: Exit: @@ -100,7 +100,7 @@ BB2: ;; Suck casts into phi %B = phi i32 [ %X, %BB0 ], [ %Y, %BB1 ] ret i32 %B -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK: BB2: ; CHECK: zext i16 %A to i32 ; CHECK-NEXT: ret i32 @@ -118,7 +118,7 @@ Loop: ; preds = %Loop, %BB0 Exit: ; preds = %Loop ret i32 0 -; CHECK: @test7 +; CHECK-LABEL: @test7( ; CHECK: Loop: ; CHECK-NEXT: br i1 %b } @@ -136,7 +136,7 @@ BB2: ;; Suck GEPs into phi %B = phi i32* [ %X, %BB0 ], [ %Y, %BB1 ] ret i32* %B -; CHECK: @test8 +; CHECK-LABEL: @test8( ; CHECK-NOT: phi ; CHECK: BB2: ; CHECK-NEXT: %B = getelementptr { i32, i32 }* %A @@ -159,7 +159,7 @@ bb1: bb2: %E = phi i32 [ %C, %bb ], [ %D, %bb1 ] ret i32 %E -; CHECK: @test9 +; CHECK-LABEL: @test9( ; CHECK: bb2: ; CHECK-NEXT: phi i32* [ %B, %bb ], [ %A, %bb1 ] ; CHECK-NEXT: %E = load i32* %{{[^,]*}}, align 1 @@ -183,7 +183,7 @@ bb1: bb2: %E = phi i32 [ %C, %bb ], [ %D, %bb1 ] ret i32 %E -; CHECK: @test10 +; CHECK-LABEL: @test10( ; CHECK: bb2: ; CHECK-NEXT: phi i32* [ %B, %bb ], [ %A, %bb1 ] ; CHECK-NEXT: %E = load i32* %{{[^,]*}}, align 16 @@ -219,7 +219,7 @@ end: store i32 10, i32* %g %z = call i1 @test11a() ret i1 %z -; CHECK: @test11 +; CHECK-LABEL: @test11( ; CHECK-NOT: phi i32 ; CHECK: ret i1 %z } @@ -245,7 +245,7 @@ end: %tmp2 = add i64 %tmp32, %tmp30 ret i64 %tmp2 -; CHECK: @test12 +; CHECK-LABEL: @test12( ; CHECK-NOT: zext ; CHECK: end: ; CHECK-NEXT: phi i64 [ 0, %entry ], [ %Val, %two ] @@ -276,7 +276,7 @@ end: call void @test13f(double %tmp31, i32 %tmp32) ret void -; CHECK: @test13 +; CHECK-LABEL: @test13( ; CHECK-NOT: zext ; CHECK: end: ; CHECK-NEXT: phi double [ 0.000000e+00, %entry ], [ %Vald, %two ] @@ -296,7 +296,7 @@ Loop: Exit: ; preds = %Loop ret i640 %C -; CHECK: @test14a +; CHECK-LABEL: @test14a( ; CHECK: Loop: ; CHECK-NEXT: phi i320 } @@ -313,7 +313,7 @@ Loop: Exit: ; preds = %Loop ret i160 %C -; CHECK: @test14b +; CHECK-LABEL: @test14b( ; CHECK: Loop: ; CHECK-NEXT: phi i160 } @@ -321,7 +321,7 @@ Exit: ; preds = %Loop declare i64 @test15a(i64) define i64 @test15b(i64 %A, i1 %b) { -; CHECK: @test15b +; CHECK-LABEL: @test15b( entry: %i0 = zext i64 %A to i128 %i1 = shl i128 %i0, 64 @@ -405,7 +405,7 @@ if.else: ; preds = %entry ; PR4413 declare i32 @ext() -; CHECK: @test17 +; CHECK-LABEL: @test17( define i32 @test17(i1 %a) { entry: br i1 %a, label %bb1, label %bb2 @@ -435,7 +435,7 @@ ret: %ptr = phi i32* [ %zero, %true ] , [ %one, %false ] %isnull = icmp eq i32* %ptr, null ret i1 %isnull -; CHECK: @test18 +; CHECK-LABEL: @test18( ; CHECK: ret i1 false } @@ -449,7 +449,7 @@ ret: %p = phi double [ %x, %true ], [ 0x7FF0000000000000, %false ]; RHS = +infty %cmp = fcmp ule double %x, %p ret i1 %cmp -; CHECK: @test19 +; CHECK-LABEL: @test19( ; CHECK: ret i1 true } @@ -466,7 +466,7 @@ ret: %p = phi i32* [ %a, %true ], [ %b, %false ] %r = icmp eq i32* %p, %c ret i1 %r -; CHECK: @test20 +; CHECK-LABEL: @test20( ; CHECK: ret i1 false } @@ -485,12 +485,12 @@ loop: br i1 %c2, label %ret, label %loop ret: ret i1 %r -; CHECK: @test21 +; CHECK-LABEL: @test21( ; CHECK: ret i1 false } define void @test22() { -; CHECK: @test22 +; CHECK-LABEL: @test22( entry: br label %loop loop: @@ -518,7 +518,7 @@ Loop: ; preds = %Loop, %BB0 Exit: ; preds = %Loop %E = add i32 %B, 19 ret i32 %E -; CHECK: @test23 +; CHECK-LABEL: @test23( ; CHECK: %phitmp = add i32 %A, 19 ; CHECK: Loop: ; CHECK-NEXT: %B = phi i32 [ %phitmp, %BB0 ], [ 61, %Loop ] @@ -538,7 +538,7 @@ BB1: BB2: %C = phi i32 [ %X, %BB0 ], [ %Y, %BB1 ] ret i32 %C -; CHECK: @test24 +; CHECK-LABEL: @test24( ; CHECK-NOT: phi ; CHECK: BB2: ; CHECK-NEXT: %C = add nuw i32 %A, 1 @@ -573,7 +573,7 @@ end: store i32 10, i32* %g %z = call i1 @test25a() ret i1 %z -; CHECK: @test25 +; CHECK-LABEL: @test25( ; CHECK-NOT: phi i32 ; CHECK: ret i1 %z } @@ -616,12 +616,12 @@ end: store i32 10, i32* %g %z = call i1 @test26a() ret i1 %z -; CHECK: @test26 +; CHECK-LABEL: @test26( ; CHECK-NOT: phi i32 ; CHECK: ret i1 %z } -; CHECK: @test27( +; CHECK-LABEL: @test27( ; CHECK: ret i32 undef define i32 @test27(i1 %b) { entry: diff --git a/test/Transforms/InstCombine/pow-1.ll b/test/Transforms/InstCombine/pow-1.ll index 8a311f0..0fdafeb 100644 --- a/test/Transforms/InstCombine/pow-1.ll +++ b/test/Transforms/InstCombine/pow-1.ll @@ -12,14 +12,14 @@ declare double @pow(double, double) nounwind readonly ; Check pow(1.0, x) -> 1.0. define float @test_simplify1(float %x) { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %retval = call float @powf(float 1.0, float %x) ret float %retval ; CHECK-NEXT: ret float 1.000000e+00 } define double @test_simplify2(double %x) { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( %retval = call double @pow(double 1.0, double %x) ret double %retval ; CHECK-NEXT: ret double 1.000000e+00 @@ -28,7 +28,7 @@ define double @test_simplify2(double %x) { ; Check pow(2.0, x) -> exp2(x). define float @test_simplify3(float %x) { -; CHECK: @test_simplify3 +; CHECK-LABEL: @test_simplify3( %retval = call float @powf(float 2.0, float %x) ; CHECK-NEXT: [[EXP2F:%[a-z0-9]+]] = call float @exp2f(float %x) [[NUW_RO:#[0-9]+]] ret float %retval @@ -36,7 +36,7 @@ define float @test_simplify3(float %x) { } define double @test_simplify4(double %x) { -; CHECK: @test_simplify4 +; CHECK-LABEL: @test_simplify4( %retval = call double @pow(double 2.0, double %x) ; CHECK-NEXT: [[EXP2:%[a-z0-9]+]] = call double @exp2(double %x) [[NUW_RO]] ret double %retval @@ -46,14 +46,14 @@ define double @test_simplify4(double %x) { ; Check pow(x, 0.0) -> 1.0. define float @test_simplify5(float %x) { -; CHECK: @test_simplify5 +; CHECK-LABEL: @test_simplify5( %retval = call float @powf(float %x, float 0.0) ret float %retval ; CHECK-NEXT: ret float 1.000000e+00 } define double @test_simplify6(double %x) { -; CHECK: @test_simplify6 +; CHECK-LABEL: @test_simplify6( %retval = call double @pow(double %x, double 0.0) ret double %retval ; CHECK-NEXT: ret double 1.000000e+00 @@ -62,7 +62,7 @@ define double @test_simplify6(double %x) { ; Check pow(x, 0.5) -> fabs(sqrt(x)), where x != -infinity. define float @test_simplify7(float %x) { -; CHECK: @test_simplify7 +; CHECK-LABEL: @test_simplify7( %retval = call float @powf(float %x, float 0.5) ; CHECK-NEXT: [[SQRTF:%[a-z0-9]+]] = call float @sqrtf(float %x) [[NUW_RO]] ; CHECK-NEXT: [[FABSF:%[a-z0-9]+]] = call float @fabsf(float [[SQRTF]]) [[NUW_RO]] @@ -73,7 +73,7 @@ define float @test_simplify7(float %x) { } define double @test_simplify8(double %x) { -; CHECK: @test_simplify8 +; CHECK-LABEL: @test_simplify8( %retval = call double @pow(double %x, double 0.5) ; CHECK-NEXT: [[SQRT:%[a-z0-9]+]] = call double @sqrt(double %x) [[NUW_RO]] ; CHECK-NEXT: [[FABS:%[a-z0-9]+]] = call double @fabs(double [[SQRT]]) [[NUW_RO]] @@ -86,14 +86,14 @@ define double @test_simplify8(double %x) { ; Check pow(-infinity, 0.5) -> +infinity. define float @test_simplify9(float %x) { -; CHECK: @test_simplify9 +; CHECK-LABEL: @test_simplify9( %retval = call float @powf(float 0xFFF0000000000000, float 0.5) ret float %retval ; CHECK-NEXT: ret float 0x7FF0000000000000 } define double @test_simplify10(double %x) { -; CHECK: @test_simplify10 +; CHECK-LABEL: @test_simplify10( %retval = call double @pow(double 0xFFF0000000000000, double 0.5) ret double %retval ; CHECK-NEXT: ret double 0x7FF0000000000000 @@ -102,14 +102,14 @@ define double @test_simplify10(double %x) { ; Check pow(x, 1.0) -> x. define float @test_simplify11(float %x) { -; CHECK: @test_simplify11 +; CHECK-LABEL: @test_simplify11( %retval = call float @powf(float %x, float 1.0) ret float %retval ; CHECK-NEXT: ret float %x } define double @test_simplify12(double %x) { -; CHECK: @test_simplify12 +; CHECK-LABEL: @test_simplify12( %retval = call double @pow(double %x, double 1.0) ret double %retval ; CHECK-NEXT: ret double %x @@ -118,7 +118,7 @@ define double @test_simplify12(double %x) { ; Check pow(x, 2.0) -> x*x. define float @test_simplify13(float %x) { -; CHECK: @test_simplify13 +; CHECK-LABEL: @test_simplify13( %retval = call float @powf(float %x, float 2.0) ; CHECK-NEXT: [[SQUARE:%[a-z0-9]+]] = fmul float %x, %x ret float %retval @@ -126,7 +126,7 @@ define float @test_simplify13(float %x) { } define double @test_simplify14(double %x) { -; CHECK: @test_simplify14 +; CHECK-LABEL: @test_simplify14( %retval = call double @pow(double %x, double 2.0) ; CHECK-NEXT: [[SQUARE:%[a-z0-9]+]] = fmul double %x, %x ret double %retval @@ -136,7 +136,7 @@ define double @test_simplify14(double %x) { ; Check pow(x, -1.0) -> 1.0/x. define float @test_simplify15(float %x) { -; CHECK: @test_simplify15 +; CHECK-LABEL: @test_simplify15( %retval = call float @powf(float %x, float -1.0) ; CHECK-NEXT: [[RECIPROCAL:%[a-z0-9]+]] = fdiv float 1.000000e+00, %x ret float %retval @@ -144,7 +144,7 @@ define float @test_simplify15(float %x) { } define double @test_simplify16(double %x) { -; CHECK: @test_simplify16 +; CHECK-LABEL: @test_simplify16( %retval = call double @pow(double %x, double -1.0) ; CHECK-NEXT: [[RECIPROCAL:%[a-z0-9]+]] = fdiv double 1.000000e+00, %x ret double %retval diff --git a/test/Transforms/InstCombine/pow-2.ll b/test/Transforms/InstCombine/pow-2.ll index af64cda..d1ffde7 100644 --- a/test/Transforms/InstCombine/pow-2.ll +++ b/test/Transforms/InstCombine/pow-2.ll @@ -7,7 +7,7 @@ declare float @pow(double, double) ; Check that pow functions with the wrong prototype aren't simplified. define float @test_no_simplify1(double %x) { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %retval = call float @pow(double 1.0, double %x) ; CHECK-NEXT: call float @pow(double 1.000000e+00, double %x) ret float %retval diff --git a/test/Transforms/InstCombine/pr8547.ll b/test/Transforms/InstCombine/pr8547.ll index 485f4d9..7e9cbe1 100644 --- a/test/Transforms/InstCombine/pr8547.ll +++ b/test/Transforms/InstCombine/pr8547.ll @@ -23,4 +23,4 @@ for.cond: ; preds = %for.cond, %codeRepl codeRepl2: ; preds = %for.cond %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i64 0, i64 0), i32 %conv2) nounwind ret i32 0 -}
\ No newline at end of file +} diff --git a/test/Transforms/InstCombine/printf-1.ll b/test/Transforms/InstCombine/printf-1.ll index 3a910ea..59d0f16 100644 --- a/test/Transforms/InstCombine/printf-1.ll +++ b/test/Transforms/InstCombine/printf-1.ll @@ -20,7 +20,7 @@ declare i32 @printf(i8*, ...) ; Check printf("") -> noop. define void @test_simplify1() { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %fmt = getelementptr [1 x i8]* @empty, i32 0, i32 0 call i32 (i8*, ...)* @printf(i8* %fmt) ret void @@ -30,7 +30,7 @@ define void @test_simplify1() { ; Check printf("x") -> putchar('x'), even for '%'. define void @test_simplify2() { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( %fmt = getelementptr [2 x i8]* @h, i32 0, i32 0 call i32 (i8*, ...)* @printf(i8* %fmt) ; CHECK-NEXT: call i32 @putchar(i32 104) @@ -39,7 +39,7 @@ define void @test_simplify2() { } define void @test_simplify3() { -; CHECK: @test_simplify3 +; CHECK-LABEL: @test_simplify3( %fmt = getelementptr [2 x i8]* @percent, i32 0, i32 0 call i32 (i8*, ...)* @printf(i8* %fmt) ; CHECK-NEXT: call i32 @putchar(i32 37) @@ -50,7 +50,7 @@ define void @test_simplify3() { ; Check printf("foo\n") -> puts("foo"). define void @test_simplify4() { -; CHECK: @test_simplify4 +; CHECK-LABEL: @test_simplify4( %fmt = getelementptr [13 x i8]* @hello_world, i32 0, i32 0 call i32 (i8*, ...)* @printf(i8* %fmt) ; CHECK-NEXT: call i32 @puts(i8* getelementptr inbounds ([12 x i8]* [[STR]], i32 0, i32 0)) @@ -61,7 +61,7 @@ define void @test_simplify4() { ; Check printf("%c", chr) -> putchar(chr). define void @test_simplify5() { -; CHECK: @test_simplify5 +; CHECK-LABEL: @test_simplify5( %fmt = getelementptr [3 x i8]* @percent_c, i32 0, i32 0 call i32 (i8*, ...)* @printf(i8* %fmt, i8 104) ; CHECK-NEXT: call i32 @putchar(i32 104) @@ -72,7 +72,7 @@ define void @test_simplify5() { ; Check printf("%s\n", str) -> puts(str). define void @test_simplify6() { -; CHECK: @test_simplify6 +; CHECK-LABEL: @test_simplify6( %fmt = getelementptr [4 x i8]* @percent_s, i32 0, i32 0 %str = getelementptr [13 x i8]* @hello_world, i32 0, i32 0 call i32 (i8*, ...)* @printf(i8* %fmt, i8* %str) @@ -84,7 +84,7 @@ define void @test_simplify6() { ; Check printf(format, ...) -> iprintf(format, ...) if no floating point. define void @test_simplify7() { -; CHECK-IPRINTF: @test_simplify7 +; CHECK-IPRINTF-LABEL: @test_simplify7( %fmt = getelementptr [3 x i8]* @percent_d, i32 0, i32 0 call i32 (i8*, ...)* @printf(i8* %fmt, i32 187) ; CHECK-NEXT-IPRINTF: call i32 (i8*, ...)* @iprintf(i8* getelementptr inbounds ([3 x i8]* @percent_d, i32 0, i32 0), i32 187) @@ -93,7 +93,7 @@ define void @test_simplify7() { } define void @test_no_simplify1() { -; CHECK-IPRINTF: @test_no_simplify1 +; CHECK-IPRINTF-LABEL: @test_no_simplify1( %fmt = getelementptr [3 x i8]* @percent_f, i32 0, i32 0 call i32 (i8*, ...)* @printf(i8* %fmt, double 1.87) ; CHECK-NEXT-IPRINTF: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([3 x i8]* @percent_f, i32 0, i32 0), double 1.870000e+00) @@ -102,7 +102,7 @@ define void @test_no_simplify1() { } define void @test_no_simplify2(i8* %fmt, double %d) { -; CHECK: @test_no_simplify2 +; CHECK-LABEL: @test_no_simplify2( call i32 (i8*, ...)* @printf(i8* %fmt, double %d) ; CHECK-NEXT: call i32 (i8*, ...)* @printf(i8* %fmt, double %d) ret void @@ -110,7 +110,7 @@ define void @test_no_simplify2(i8* %fmt, double %d) { } define i32 @test_no_simplify3() { -; CHECK: @test_no_simplify3 +; CHECK-LABEL: @test_no_simplify3( %fmt = getelementptr [2 x i8]* @h, i32 0, i32 0 %ret = call i32 (i8*, ...)* @printf(i8* %fmt) ; CHECK-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([2 x i8]* @h, i32 0, i32 0)) diff --git a/test/Transforms/InstCombine/printf-2.ll b/test/Transforms/InstCombine/printf-2.ll index 466ee1c..7e018eb 100644 --- a/test/Transforms/InstCombine/printf-2.ll +++ b/test/Transforms/InstCombine/printf-2.ll @@ -13,7 +13,7 @@ declare void @printf(i8*, ...) ; Check simplification of printf with void return type. define void @test_simplify1() { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %fmt = getelementptr [2 x i8]* @h, i32 0, i32 0 call void (i8*, ...)* @printf(i8* %fmt) ; CHECK-NEXT: call i32 @putchar(i32 104) @@ -22,7 +22,7 @@ define void @test_simplify1() { } define void @test_simplify2() { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( %fmt = getelementptr [13 x i8]* @hello_world, i32 0, i32 0 call void (i8*, ...)* @printf(i8* %fmt) ; CHECK-NEXT: call i32 @puts(i8* getelementptr inbounds ([12 x i8]* @str, i32 0, i32 0)) @@ -31,7 +31,7 @@ define void @test_simplify2() { } define void @test_simplify6() { -; CHECK: @test_simplify6 +; CHECK-LABEL: @test_simplify6( %fmt = getelementptr [4 x i8]* @percent_s, i32 0, i32 0 %str = getelementptr [13 x i8]* @hello_world, i32 0, i32 0 call void (i8*, ...)* @printf(i8* %fmt, i8* %str) diff --git a/test/Transforms/InstCombine/ptr-int-cast.ll b/test/Transforms/InstCombine/ptr-int-cast.ll index 7a6ecff..826c004 100644 --- a/test/Transforms/InstCombine/ptr-int-cast.ll +++ b/test/Transforms/InstCombine/ptr-int-cast.ll @@ -28,7 +28,7 @@ define i64 @f0(i32 %a0) nounwind { } define <4 x i32> @test4(<4 x i8*> %arg) nounwind { -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK: ptrtoint <4 x i8*> %arg to <4 x i64> ; CHECK: trunc <4 x i64> %1 to <4 x i32> %p1 = ptrtoint <4 x i8*> %arg to <4 x i32> @@ -36,7 +36,7 @@ define <4 x i32> @test4(<4 x i8*> %arg) nounwind { } define <4 x i128> @test5(<4 x i8*> %arg) nounwind { -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK: ptrtoint <4 x i8*> %arg to <4 x i64> ; CHECK: zext <4 x i64> %1 to <4 x i128> %p1 = ptrtoint <4 x i8*> %arg to <4 x i128> @@ -44,7 +44,7 @@ define <4 x i128> @test5(<4 x i8*> %arg) nounwind { } define <4 x i8*> @test6(<4 x i32> %arg) nounwind { -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK: zext <4 x i32> %arg to <4 x i64> ; CHECK: inttoptr <4 x i64> %1 to <4 x i8*> %p1 = inttoptr <4 x i32> %arg to <4 x i8*> @@ -52,7 +52,7 @@ define <4 x i8*> @test6(<4 x i32> %arg) nounwind { } define <4 x i8*> @test7(<4 x i128> %arg) nounwind { -; CHECK: @test7 +; CHECK-LABEL: @test7( ; CHECK: trunc <4 x i128> %arg to <4 x i64> ; CHECK: inttoptr <4 x i64> %1 to <4 x i8*> %p1 = inttoptr <4 x i128> %arg to <4 x i8*> diff --git a/test/Transforms/InstCombine/puts-1.ll b/test/Transforms/InstCombine/puts-1.ll index ef4e1bb..bd7557e 100644 --- a/test/Transforms/InstCombine/puts-1.ll +++ b/test/Transforms/InstCombine/puts-1.ll @@ -11,7 +11,7 @@ declare i32 @puts(i8*) ; Check puts("") -> putchar('\n'). define void @test_simplify1() { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %str = getelementptr [1 x i8]* @empty, i32 0, i32 0 call i32 @puts(i8* %str) ; CHECK-NEXT: call i32 @putchar(i32 10) @@ -22,7 +22,7 @@ define void @test_simplify1() { ; Don't simplify if the return value is used. define i32 @test_no_simplify1() { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %str = getelementptr [1 x i8]* @empty, i32 0, i32 0 %ret = call i32 @puts(i8* %str) ; CHECK-NEXT: call i32 @puts(i8* getelementptr inbounds ([1 x i8]* @empty, i32 0, i32 0)) diff --git a/test/Transforms/InstCombine/rem.ll b/test/Transforms/InstCombine/rem.ll index 808d51e..22fd90b 100644 --- a/test/Transforms/InstCombine/rem.ll +++ b/test/Transforms/InstCombine/rem.ll @@ -4,21 +4,21 @@ ; END. define i32 @test1(i32 %A) { -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK-NEXT: ret i32 0 %B = srem i32 %A, 1 ; ISA constant 0 ret i32 %B } define i32 @test2(i32 %A) { ; 0 % X = 0, we don't need to preserve traps -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK-NEXT: ret i32 0 %B = srem i32 0, %A ret i32 %B } define i32 @test3(i32 %A) { -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK-NEXT: [[AND:%.*]] = and i32 %A, 7 ; CHECK-NEXT: ret i32 [[AND]] %B = urem i32 %A, 8 @@ -26,7 +26,7 @@ define i32 @test3(i32 %A) { } define i1 @test3a(i32 %A) { -; CHECK: @test3a +; CHECK-LABEL: @test3a( ; CHECK-NEXT: [[AND:%.*]] = and i32 %A, 7 ; CHECK-NEXT: [[CMP:%.*]] = icmp ne i32 [[AND]], 0 ; CHECK-NEXT: ret i1 [[CMP]] @@ -36,7 +36,7 @@ define i1 @test3a(i32 %A) { } define i32 @test4(i32 %X, i1 %C) { -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK-NEXT: [[SEL:%.*]] = select i1 %C, i32 0, i32 7 ; CHECK-NEXT: [[AND:%.*]] = and i32 [[SEL]], %X %V = select i1 %C, i32 1, i32 8 @@ -45,7 +45,7 @@ define i32 @test4(i32 %X, i1 %C) { } define i32 @test5(i32 %X, i8 %B) { -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK-NEXT: [[ZEXT:%.*]] = zext i8 %B to i32 ; CHECK-NEXT: [[SHL:%.*]] = shl nuw i32 32, [[ZEXT]] ; CHECK-NEXT: [[ADD:%.*]] = add i32 [[SHL]], -1 @@ -58,14 +58,14 @@ define i32 @test5(i32 %X, i8 %B) { } define i32 @test6(i32 %A) { -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK-NEXT: ret i32 undef %B = srem i32 %A, 0 ;; undef ret i32 %B } define i32 @test7(i32 %A) { -; CHECK: @test7 +; CHECK-LABEL: @test7( ; CHECK-NEXT: ret i32 0 %B = mul i32 %A, 8 %C = srem i32 %B, 4 @@ -73,7 +73,7 @@ define i32 @test7(i32 %A) { } define i32 @test8(i32 %A) { -; CHECK: @test8 +; CHECK-LABEL: @test8( ; CHECK-NEXT: ret i32 0 %B = shl i32 %A, 4 %C = srem i32 %B, 8 @@ -81,7 +81,7 @@ define i32 @test8(i32 %A) { } define i32 @test9(i32 %A) { -; CHECK: @test9 +; CHECK-LABEL: @test9( ; CHECK-NEXT: ret i32 0 %B = mul i32 %A, 64 %C = urem i32 %B, 32 @@ -89,7 +89,7 @@ define i32 @test9(i32 %A) { } define i32 @test10(i8 %c) { -; CHECK: @test10 +; CHECK-LABEL: @test10( ; CHECK-NEXT: ret i32 0 %tmp.1 = zext i8 %c to i32 %tmp.2 = mul i32 %tmp.1, 4 @@ -100,7 +100,7 @@ define i32 @test10(i8 %c) { } define i32 @test11(i32 %i) { -; CHECK: @test11 +; CHECK-LABEL: @test11( ; CHECK-NEXT: ret i32 0 %tmp.1 = and i32 %i, -2 %tmp.3 = mul i32 %tmp.1, 2 @@ -109,7 +109,7 @@ define i32 @test11(i32 %i) { } define i32 @test12(i32 %i) { -; CHECK: @test12 +; CHECK-LABEL: @test12( ; CHECK-NEXT: ret i32 0 %tmp.1 = and i32 %i, -4 %tmp.5 = srem i32 %tmp.1, 2 @@ -117,14 +117,14 @@ define i32 @test12(i32 %i) { } define i32 @test13(i32 %i) { -; CHECK: @test13 +; CHECK-LABEL: @test13( ; CHECK-NEXT: ret i32 0 %x = srem i32 %i, %i ret i32 %x } define i64 @test14(i64 %x, i32 %y) { -; CHECK: @test14 +; CHECK-LABEL: @test14( ; CHECK-NEXT: [[SHL:%.*]] = shl i32 1, %y ; CHECK-NEXT: [[ZEXT:%.*]] = zext i32 [[SHL]] to i64 ; CHECK-NEXT: [[ADD:%.*]] = add i64 [[ZEXT]], -1 @@ -137,7 +137,7 @@ define i64 @test14(i64 %x, i32 %y) { } define i64 @test15(i32 %x, i32 %y) { -; CHECK: @test15 +; CHECK-LABEL: @test15( ; CHECK-NEXT: [[SHL:%.*]] = shl nuw i32 1, %y ; CHECK-NEXT: [[ADD:%.*]] = add i32 [[SHL]], -1 ; CHECK-NEXT: [[AND:%.*]] = and i32 [[ADD]], %x @@ -151,7 +151,7 @@ define i64 @test15(i32 %x, i32 %y) { } define i32 @test16(i32 %x, i32 %y) { -; CHECK: @test16 +; CHECK-LABEL: @test16( ; CHECK-NEXT: [[SHR:%.*]] = lshr i32 %y, 11 ; CHECK-NEXT: [[AND:%.*]] = and i32 [[SHR]], 4 ; CHECK-NEXT: [[OR:%.*]] = or i32 [[AND]], 3 @@ -163,3 +163,44 @@ define i32 @test16(i32 %x, i32 %y) { %rem = urem i32 %x, %add ret i32 %rem } + +define i32 @test17(i32 %X) { +; CHECK-LABEL: @test17( +; CHECK-NEXT: icmp ne i32 %X, 1 +; CHECK-NEXT: zext i1 +; CHECK-NEXT: ret + %A = urem i32 1, %X + ret i32 %A +} + +define i32 @test18(i16 %x, i32 %y) { +; CHECK: @test18 +; CHECK-NEXT: [[AND:%.*]] = and i16 %x, 4 +; CHECK-NEXT: [[EXT:%.*]] = zext i16 [[AND]] to i32 +; CHECK-NEXT: [[SHL:%.*]] = shl nuw nsw i32 [[EXT]], 3 +; CHECK-NEXT: [[XOR:%.*]] = xor i32 [[SHL]], 63 +; CHECK-NEXT: [[REM:%.*]] = and i32 [[XOR]], %y +; CHECK-NEXT: ret i32 [[REM]] + %1 = and i16 %x, 4 + %2 = icmp ne i16 %1, 0 + %3 = select i1 %2, i32 32, i32 64 + %4 = urem i32 %y, %3 + ret i32 %4 +} + +define i32 @test19(i32 %x, i32 %y) { +; CHECK: @test19 +; CHECK-NEXT: [[SHL1:%.*]] = shl i32 1, %x +; CHECK-NEXT: [[SHL2:%.*]] = shl i32 1, %y +; CHECK-NEXT: [[AND:%.*]] = and i32 [[SHL1]], [[SHL2]] +; CHECK-NEXT: [[ADD:%.*]] = add i32 [[AND]], [[SHL1]] +; CHECK-NEXT: [[SUB:%.*]] = add i32 [[ADD]], -1 +; CHECK-NEXT: [[REM:%.*]] = and i32 [[SUB]], %y +; CHECK-NEXT: ret i32 [[REM]] + %A = shl i32 1, %x + %B = shl i32 1, %y + %C = and i32 %A, %B + %D = add i32 %C, %A + %E = urem i32 %y, %D + ret i32 %E +} diff --git a/test/Transforms/InstCombine/select-crash.ll b/test/Transforms/InstCombine/select-crash.ll index 946ea2b..77446cd 100644 --- a/test/Transforms/InstCombine/select-crash.ll +++ b/test/Transforms/InstCombine/select-crash.ll @@ -21,7 +21,7 @@ entry: ; PR10180: same crash, but with vectors define <4 x float> @foo(i1 %b, <4 x float> %x, <4 x float> %y, <4 x float> %z) { -; CHECK: @foo +; CHECK-LABEL: @foo( ; CHECK: fsub <4 x float> ; CHECK: select ; CHECK: fadd <4 x float> @@ -31,7 +31,7 @@ define <4 x float> @foo(i1 %b, <4 x float> %x, <4 x float> %y, <4 x float> %z) { ret <4 x float> %sel } -; CHECK: @test3 +; CHECK-LABEL: @test3( define i32 @test3(i1 %bool, i32 %a) { entry: %cond = or i1 %bool, true diff --git a/test/Transforms/InstCombine/select.ll b/test/Transforms/InstCombine/select.ll index c72a6f7..c7809f7 100644 --- a/test/Transforms/InstCombine/select.ll +++ b/test/Transforms/InstCombine/select.ll @@ -6,14 +6,14 @@ define i32 @test1(i32 %A, i32 %B) { %C = select i1 false, i32 %A, i32 %B ret i32 %C -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK: ret i32 %B } define i32 @test2(i32 %A, i32 %B) { %C = select i1 true, i32 %A, i32 %B ret i32 %C -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK: ret i32 %A } @@ -22,7 +22,7 @@ define i32 @test3(i1 %C, i32 %I) { ; V = I %V = select i1 %C, i32 %I, i32 %I ret i32 %V -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK: ret i32 %I } @@ -30,7 +30,7 @@ define i1 @test4(i1 %C) { ; V = C %V = select i1 %C, i1 true, i1 false ret i1 %V -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK: ret i1 %C } @@ -38,7 +38,7 @@ define i1 @test5(i1 %C) { ; V = !C %V = select i1 %C, i1 false, i1 true ret i1 %V -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK: xor i1 %C, true ; CHECK: ret i1 } @@ -47,7 +47,7 @@ define i32 @test6(i1 %C) { ; V = cast C to int %V = select i1 %C, i32 1, i32 0 ret i32 %V -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK: %V = zext i1 %C to i32 ; CHECK: ret i32 %V } @@ -56,7 +56,7 @@ define i1 @test7(i1 %C, i1 %X) { ; R = or C, X %R = select i1 %C, i1 true, i1 %X ret i1 %R -; CHECK: @test7 +; CHECK-LABEL: @test7( ; CHECK: %R = or i1 %C, %X ; CHECK: ret i1 %R } @@ -65,7 +65,7 @@ define i1 @test8(i1 %C, i1 %X) { ; R = and C, X %R = select i1 %C, i1 %X, i1 false ret i1 %R -; CHECK: @test8 +; CHECK-LABEL: @test8( ; CHECK: %R = and i1 %C, %X ; CHECK: ret i1 %R } @@ -74,7 +74,7 @@ define i1 @test9(i1 %C, i1 %X) { ; R = and !C, X %R = select i1 %C, i1 false, i1 %X ret i1 %R -; CHECK: @test9 +; CHECK-LABEL: @test9( ; CHECK: xor i1 %C, true ; CHECK: %R = and i1 ; CHECK: ret i1 %R @@ -84,7 +84,7 @@ define i1 @test10(i1 %C, i1 %X) { ; R = or !C, X %R = select i1 %C, i1 %X, i1 true ret i1 %R -; CHECK: @test10 +; CHECK-LABEL: @test10( ; CHECK: xor i1 %C, true ; CHECK: %R = or i1 ; CHECK: ret i1 %R @@ -94,7 +94,7 @@ define i32 @test11(i32 %a) { %C = icmp eq i32 %a, 0 %R = select i1 %C, i32 0, i32 1 ret i32 %R -; CHECK: @test11 +; CHECK-LABEL: @test11( ; CHECK: icmp ne i32 %a, 0 ; CHECK: %R = zext i1 ; CHECK: ret i32 %R @@ -104,7 +104,7 @@ define i32 @test12(i1 %cond, i32 %a) { %b = or i32 %a, 1 %c = select i1 %cond, i32 %b, i32 %a ret i32 %c -; CHECK: @test12 +; CHECK-LABEL: @test12( ; CHECK: %b = zext i1 %cond to i32 ; CHECK: %c = or i32 %b, %a ; CHECK: ret i32 %c @@ -114,7 +114,7 @@ define i32 @test12a(i1 %cond, i32 %a) { %b = ashr i32 %a, 1 %c = select i1 %cond, i32 %b, i32 %a ret i32 %c -; CHECK: @test12a +; CHECK-LABEL: @test12a( ; CHECK: %b = zext i1 %cond to i32 ; CHECK: %c = ashr i32 %a, %b ; CHECK: ret i32 %c @@ -124,7 +124,7 @@ define i32 @test12b(i1 %cond, i32 %a) { %b = ashr i32 %a, 1 %c = select i1 %cond, i32 %a, i32 %b ret i32 %c -; CHECK: @test12b +; CHECK-LABEL: @test12b( ; CHECK: zext i1 %cond to i32 ; CHECK: %b = xor i32 ; CHECK: %c = ashr i32 %a, %b @@ -135,7 +135,7 @@ define i32 @test13(i32 %a, i32 %b) { %C = icmp eq i32 %a, %b %V = select i1 %C, i32 %a, i32 %b ret i32 %V -; CHECK: @test13 +; CHECK-LABEL: @test13( ; CHECK: ret i32 %b } @@ -143,7 +143,7 @@ define i32 @test13a(i32 %a, i32 %b) { %C = icmp ne i32 %a, %b %V = select i1 %C, i32 %a, i32 %b ret i32 %V -; CHECK: @test13a +; CHECK-LABEL: @test13a( ; CHECK: ret i32 %a } @@ -151,7 +151,7 @@ define i32 @test13b(i32 %a, i32 %b) { %C = icmp eq i32 %a, %b %V = select i1 %C, i32 %b, i32 %a ret i32 %V -; CHECK: @test13b +; CHECK-LABEL: @test13b( ; CHECK: ret i32 %a } @@ -160,7 +160,7 @@ define i1 @test14a(i1 %C, i32 %X) { ; (X < 1) | !C %R = icmp slt i32 %V, 1 ret i1 %R -; CHECK: @test14a +; CHECK-LABEL: @test14a( ; CHECK: icmp slt i32 %X, 1 ; CHECK: xor i1 %C, true ; CHECK: or i1 @@ -172,7 +172,7 @@ define i1 @test14b(i1 %C, i32 %X) { ; (X < 1) | C %R = icmp slt i32 %V, 1 ret i1 %R -; CHECK: @test14b +; CHECK-LABEL: @test14b( ; CHECK: icmp slt i32 %X, 1 ; CHECK: or i1 ; CHECK: ret i1 %R @@ -184,7 +184,7 @@ define i32 @test15a(i32 %X) { %t2 = icmp eq i32 %t1, 0 %t3 = select i1 %t2, i32 0, i32 16 ret i32 %t3 -; CHECK: @test15a +; CHECK-LABEL: @test15a( ; CHECK: %t1 = and i32 %X, 16 ; CHECK: ret i32 %t1 } @@ -195,7 +195,7 @@ define i32 @test15b(i32 %X) { %t2 = icmp eq i32 %t1, 0 %t3 = select i1 %t2, i32 32, i32 0 ret i32 %t3 -; CHECK: @test15b +; CHECK-LABEL: @test15b( ; CHECK: %t1 = and i32 %X, 32 ; CHECK: xor i32 %t1, 32 ; CHECK: ret i32 @@ -207,7 +207,7 @@ define i32 @test15c(i32 %X) { %t2 = icmp eq i32 %t1, 16 %t3 = select i1 %t2, i32 16, i32 0 ret i32 %t3 -; CHECK: @test15c +; CHECK-LABEL: @test15c( ; CHECK: %t1 = and i32 %X, 16 ; CHECK: ret i32 %t1 } @@ -218,7 +218,7 @@ define i32 @test15d(i32 %X) { %t2 = icmp ne i32 %t1, 0 %t3 = select i1 %t2, i32 16, i32 0 ret i32 %t3 -; CHECK: @test15d +; CHECK-LABEL: @test15d( ; CHECK: %t1 = and i32 %X, 16 ; CHECK: ret i32 %t1 } @@ -229,7 +229,7 @@ define i32 @test15e(i32 %X) { %t2 = icmp ne i32 %t1, 0 %t3 = select i1 %t2, i32 256, i32 0 ret i32 %t3 -; CHECK: @test15e +; CHECK-LABEL: @test15e( ; CHECK: %t1 = shl i32 %X, 1 ; CHECK: and i32 %t1, 256 ; CHECK: ret i32 @@ -241,7 +241,7 @@ define i32 @test15f(i32 %X) { %t2 = icmp ne i32 %t1, 0 %t3 = select i1 %t2, i32 0, i32 256 ret i32 %t3 -; CHECK: @test15f +; CHECK-LABEL: @test15f( ; CHECK: %t1 = shl i32 %X, 1 ; CHECK: and i32 %t1, 256 ; CHECK: xor i32 %{{.*}}, 256 @@ -254,7 +254,7 @@ define i32 @test15g(i32 %X) { %t2 = icmp ne i32 %t1, 0 %t3 = select i1 %t2, i32 -1, i32 -9 ret i32 %t3 -; CHECK: @test15g +; CHECK-LABEL: @test15g( ; CHECK-NEXT: %1 = or i32 %X, -9 ; CHECK-NEXT: ret i32 %1 } @@ -265,7 +265,7 @@ define i32 @test15h(i32 %X) { %t2 = icmp ne i32 %t1, 0 %t3 = select i1 %t2, i32 -9, i32 -1 ret i32 %t3 -; CHECK: @test15h +; CHECK-LABEL: @test15h( ; CHECK-NEXT: %1 = or i32 %X, -9 ; CHECK-NEXT: %2 = xor i32 %1, 8 ; CHECK-NEXT: ret i32 %2 @@ -277,7 +277,7 @@ define i32 @test15i(i32 %X) { %t2 = icmp ne i32 %t1, 0 %t3 = select i1 %t2, i32 577, i32 1089 ret i32 %t3 -; CHECK: @test15i +; CHECK-LABEL: @test15i( ; CHECK-NEXT: %t1 = shl i32 %X, 8 ; CHECK-NEXT: %1 = and i32 %t1, 512 ; CHECK-NEXT: %2 = xor i32 %1, 512 @@ -291,7 +291,7 @@ define i32 @test15j(i32 %X) { %t2 = icmp ne i32 %t1, 0 %t3 = select i1 %t2, i32 1089, i32 577 ret i32 %t3 -; CHECK: @test15j +; CHECK-LABEL: @test15j( ; CHECK-NEXT: %t1 = shl i32 %X, 8 ; CHECK-NEXT: %1 = and i32 %t1, 512 ; CHECK-NEXT: %2 = add i32 %1, 577 @@ -302,7 +302,7 @@ define i32 @test16(i1 %C, i32* %P) { %P2 = select i1 %C, i32* %P, i32* null %V = load i32* %P2 ret i32 %V -; CHECK: @test16 +; CHECK-LABEL: @test16( ; CHECK-NEXT: %V = load i32* %P ; CHECK: ret i32 %V } @@ -311,7 +311,7 @@ define i1 @test17(i32* %X, i1 %C) { %R = select i1 %C, i32* %X, i32* null %RV = icmp eq i32* %R, null ret i1 %RV -; CHECK: @test17 +; CHECK-LABEL: @test17( ; CHECK: icmp eq i32* %X, null ; CHECK: xor i1 %C, true ; CHECK: %RV = or i1 @@ -322,7 +322,7 @@ define i32 @test18(i32 %X, i32 %Y, i1 %C) { %R = select i1 %C, i32 %X, i32 0 %V = sdiv i32 %Y, %R ret i32 %V -; CHECK: @test18 +; CHECK-LABEL: @test18( ; CHECK: %V = sdiv i32 %Y, %X ; CHECK: ret i32 %V } @@ -331,7 +331,7 @@ define i32 @test19(i32 %x) { %tmp = icmp ugt i32 %x, 2147483647 %retval = select i1 %tmp, i32 -1, i32 0 ret i32 %retval -; CHECK: @test19 +; CHECK-LABEL: @test19( ; CHECK-NEXT: ashr i32 %x, 31 ; CHECK-NEXT: ret i32 } @@ -340,7 +340,7 @@ define i32 @test20(i32 %x) { %tmp = icmp slt i32 %x, 0 %retval = select i1 %tmp, i32 -1, i32 0 ret i32 %retval -; CHECK: @test20 +; CHECK-LABEL: @test20( ; CHECK-NEXT: ashr i32 %x, 31 ; CHECK-NEXT: ret i32 } @@ -349,7 +349,7 @@ define i64 @test21(i32 %x) { %tmp = icmp slt i32 %x, 0 %retval = select i1 %tmp, i64 -1, i64 0 ret i64 %retval -; CHECK: @test21 +; CHECK-LABEL: @test21( ; CHECK-NEXT: ashr i32 %x, 31 ; CHECK-NEXT: sext i32 ; CHECK-NEXT: ret i64 @@ -359,7 +359,7 @@ define i16 @test22(i32 %x) { %tmp = icmp slt i32 %x, 0 %retval = select i1 %tmp, i16 -1, i16 0 ret i16 %retval -; CHECK: @test22 +; CHECK-LABEL: @test22( ; CHECK-NEXT: ashr i32 %x, 31 ; CHECK-NEXT: trunc i32 ; CHECK-NEXT: ret i16 @@ -368,7 +368,7 @@ define i16 @test22(i32 %x) { define i1 @test23(i1 %a, i1 %b) { %c = select i1 %a, i1 %b, i1 %a ret i1 %c -; CHECK: @test23 +; CHECK-LABEL: @test23( ; CHECK-NEXT: %c = and i1 %a, %b ; CHECK-NEXT: ret i1 %c } @@ -376,7 +376,7 @@ define i1 @test23(i1 %a, i1 %b) { define i1 @test24(i1 %a, i1 %b) { %c = select i1 %a, i1 %a, i1 %b ret i1 %c -; CHECK: @test24 +; CHECK-LABEL: @test24( ; CHECK-NEXT: %c = or i1 %a, %b ; CHECK-NEXT: ret i1 %c } @@ -390,7 +390,7 @@ ret: %a = phi i1 [true, %jump], [false, %entry] %b = select i1 %a, i32 10, i32 20 ret i32 %b -; CHECK: @test25 +; CHECK-LABEL: @test25( ; CHECK: %a = phi i32 [ 10, %jump ], [ 20, %entry ] ; CHECK-NEXT: ret i32 %a } @@ -405,7 +405,7 @@ ret: %a = phi i1 [true, %jump], [%c, %entry] %b = select i1 %a, i32 10, i32 20 ret i32 %b -; CHECK: @test26 +; CHECK-LABEL: @test26( ; CHECK: %a = phi i32 [ 10, %jump ], [ 20, %entry ] ; CHECK-NEXT: ret i32 %a } @@ -419,7 +419,7 @@ ret: %a = phi i1 [true, %jump], [false, %entry] %b = select i1 %a, i32 %A, i32 %B ret i32 %b -; CHECK: @test27 +; CHECK-LABEL: @test27( ; CHECK: %a = phi i32 [ %A, %jump ], [ %B, %entry ] ; CHECK-NEXT: ret i32 %a } @@ -434,7 +434,7 @@ ret: %a = phi i1 [true, %jump], [false, %entry] %b = select i1 %a, i32 %A, i32 %c ret i32 %b -; CHECK: @test28 +; CHECK-LABEL: @test28( ; CHECK: %a = phi i32 [ %A, %jump ], [ %B, %entry ] ; CHECK-NEXT: ret i32 %a } @@ -452,7 +452,7 @@ ret: next: %b = select i1 %a, i32 %A, i32 %c ret i32 %b -; CHECK: @test29 +; CHECK-LABEL: @test29( ; CHECK: %a = phi i32 [ %A, %jump ], [ %B, %entry ] ; CHECK: ret i32 %a } @@ -466,7 +466,7 @@ define i32 @test30(i32 %x, i32 %y) { %cmp5 = icmp sgt i32 %cond, %x %retval = select i1 %cmp5, i32 %cond, i32 %x ret i32 %retval -; CHECK: @test30 +; CHECK-LABEL: @test30( ; CHECK: ret i32 %cond } @@ -477,7 +477,7 @@ define i32 @test31(i32 %x, i32 %y) { %cmp5 = icmp ugt i32 %cond, %x %retval = select i1 %cmp5, i32 %cond, i32 %x ret i32 %retval -; CHECK: @test31 +; CHECK-LABEL: @test31( ; CHECK: ret i32 %cond } @@ -488,7 +488,7 @@ define i32 @test32(i32 %x, i32 %y) { %cmp5 = icmp sgt i32 %cond, %x %retval = select i1 %cmp5, i32 %x, i32 %cond ret i32 %retval -; CHECK: @test32 +; CHECK-LABEL: @test32( ; CHECK: ret i32 %cond } @@ -499,7 +499,7 @@ define i32 @test33(i32 %x, i32 %y) { %cmp5 = icmp sgt i32 %cond, %x %retval = select i1 %cmp5, i32 %cond, i32 %x ret i32 %retval -; CHECK: @test33 +; CHECK-LABEL: @test33( ; CHECK: ret i32 %x } @@ -510,7 +510,7 @@ define i32 @test34(i32 %x, i32 %y) { %cmp5 = icmp sgt i32 %cond, %x %retval = select i1 %cmp5, i32 %x, i32 %cond ret i32 %retval -; CHECK: @test34 +; CHECK-LABEL: @test34( ; CHECK: ret i32 %x } @@ -518,7 +518,7 @@ define i32 @test35(i32 %x) { %cmp = icmp sge i32 %x, 0 %cond = select i1 %cmp, i32 60, i32 100 ret i32 %cond -; CHECK: @test35 +; CHECK-LABEL: @test35( ; CHECK: ashr i32 %x, 31 ; CHECK: and i32 {{.*}}, 40 ; CHECK: add i32 {{.*}}, 60 @@ -529,7 +529,7 @@ define i32 @test36(i32 %x) { %cmp = icmp slt i32 %x, 0 %cond = select i1 %cmp, i32 60, i32 100 ret i32 %cond -; CHECK: @test36 +; CHECK-LABEL: @test36( ; CHECK: ashr i32 %x, 31 ; CHECK: and i32 {{.*}}, -40 ; CHECK: add i32 {{.*}}, 100 @@ -540,7 +540,7 @@ define i32 @test37(i32 %x) { %cmp = icmp sgt i32 %x, -1 %cond = select i1 %cmp, i32 1, i32 -1 ret i32 %cond -; CHECK: @test37 +; CHECK-LABEL: @test37( ; CHECK: ashr i32 %x, 31 ; CHECK: or i32 {{.*}}, 1 ; CHECK: ret @@ -552,7 +552,7 @@ define i1 @test38(i1 %cond) { %ptr = select i1 %cond, i32* %zero, i32* %one %isnull = icmp eq i32* %ptr, null ret i1 %isnull -; CHECK: @test38 +; CHECK-LABEL: @test38( ; CHECK: ret i1 false } @@ -560,7 +560,7 @@ define i1 @test39(i1 %cond, double %x) { %s = select i1 %cond, double %x, double 0x7FF0000000000000 ; RHS = +infty %cmp = fcmp ule double %x, %s ret i1 %cmp -; CHECK: @test39 +; CHECK-LABEL: @test39( ; CHECK: ret i1 true } @@ -571,7 +571,7 @@ define i1 @test40(i1 %cond) { %s = select i1 %cond, i32* %a, i32* %b %r = icmp eq i32* %s, %c ret i1 %r -; CHECK: @test40 +; CHECK-LABEL: @test40( ; CHECK: ret i1 false } @@ -580,7 +580,7 @@ define i32 @test41(i1 %cond, i32 %x, i32 %y) { %s = select i1 %cond, i32 %y, i32 %z %r = and i32 %x, %s ret i32 %r -; CHECK: @test41 +; CHECK-LABEL: @test41( ; CHECK-NEXT: and i32 %x, %y ; CHECK-NEXT: ret i32 } @@ -590,7 +590,7 @@ define i32 @test42(i32 %x, i32 %y) { %cond = icmp eq i32 %x, 0 %c = select i1 %cond, i32 %b, i32 %y ret i32 %c -; CHECK: @test42 +; CHECK-LABEL: @test42( ; CHECK-NEXT: %cond = icmp eq i32 %x, 0 ; CHECK-NEXT: %b = sext i1 %cond to i32 ; CHECK-NEXT: %c = add i32 %b, %y @@ -602,7 +602,7 @@ define i64 @test43(i32 %a) nounwind { %is_a_nonnegative = icmp sgt i32 %a, -1 %max = select i1 %is_a_nonnegative, i64 %a_ext, i64 0 ret i64 %max -; CHECK: @test43 +; CHECK-LABEL: @test43( ; CHECK-NEXT: %a_ext = sext i32 %a to i64 ; CHECK-NEXT: %is_a_nonnegative = icmp slt i64 %a_ext, 0 ; CHECK-NEXT: %max = select i1 %is_a_nonnegative, i64 0, i64 %a_ext @@ -614,7 +614,7 @@ define i64 @test44(i32 %a) nounwind { %is_a_nonpositive = icmp slt i32 %a, 1 %min = select i1 %is_a_nonpositive, i64 %a_ext, i64 0 ret i64 %min -; CHECK: @test44 +; CHECK-LABEL: @test44( ; CHECK-NEXT: %a_ext = sext i32 %a to i64 ; CHECK-NEXT: %is_a_nonpositive = icmp sgt i64 %a_ext, 0 ; CHECK-NEXT: %min = select i1 %is_a_nonpositive, i64 0, i64 %a_ext @@ -625,7 +625,7 @@ define i64 @test45(i32 %a) nounwind { %is_a_nonnegative = icmp ugt i32 %a, 2 %max = select i1 %is_a_nonnegative, i64 %a_ext, i64 3 ret i64 %max -; CHECK: @test45 +; CHECK-LABEL: @test45( ; CHECK-NEXT: %a_ext = zext i32 %a to i64 ; CHECK-NEXT: %is_a_nonnegative = icmp ult i64 %a_ext, 3 ; CHECK-NEXT: %max = select i1 %is_a_nonnegative, i64 3, i64 %a_ext @@ -637,7 +637,7 @@ define i64 @test46(i32 %a) nounwind { %is_a_nonpositive = icmp ult i32 %a, 3 %min = select i1 %is_a_nonpositive, i64 %a_ext, i64 2 ret i64 %min -; CHECK: @test46 +; CHECK-LABEL: @test46( ; CHECK-NEXT: %a_ext = zext i32 %a to i64 ; CHECK-NEXT: %is_a_nonpositive = icmp ugt i64 %a_ext, 2 ; CHECK-NEXT: %min = select i1 %is_a_nonpositive, i64 2, i64 %a_ext @@ -648,7 +648,7 @@ define i64 @test47(i32 %a) nounwind { %is_a_nonnegative = icmp ugt i32 %a, 2 %max = select i1 %is_a_nonnegative, i64 %a_ext, i64 3 ret i64 %max -; CHECK: @test47 +; CHECK-LABEL: @test47( ; CHECK-NEXT: %a_ext = sext i32 %a to i64 ; CHECK-NEXT: %is_a_nonnegative = icmp ult i64 %a_ext, 3 ; CHECK-NEXT: %max = select i1 %is_a_nonnegative, i64 3, i64 %a_ext @@ -660,7 +660,7 @@ define i64 @test48(i32 %a) nounwind { %is_a_nonpositive = icmp ult i32 %a, 3 %min = select i1 %is_a_nonpositive, i64 %a_ext, i64 2 ret i64 %min -; CHECK: @test48 +; CHECK-LABEL: @test48( ; CHECK-NEXT: %a_ext = sext i32 %a to i64 ; CHECK-NEXT: %is_a_nonpositive = icmp ugt i64 %a_ext, 2 ; CHECK-NEXT: %min = select i1 %is_a_nonpositive, i64 2, i64 %a_ext @@ -672,7 +672,7 @@ define i64 @test49(i32 %a) nounwind { %is_a_nonpositive = icmp ult i32 %a, 3 %min = select i1 %is_a_nonpositive, i64 2, i64 %a_ext ret i64 %min -; CHECK: @test49 +; CHECK-LABEL: @test49( ; CHECK-NEXT: %a_ext = sext i32 %a to i64 ; CHECK-NEXT: %is_a_nonpositive = icmp ugt i64 %a_ext, 2 ; CHECK-NEXT: %min = select i1 %is_a_nonpositive, i64 %a_ext, i64 2 @@ -683,7 +683,7 @@ define i64 @test50(i32 %a) nounwind { %a_ext = sext i32 %a to i64 %min = select i1 %is_a_nonpositive, i64 2, i64 %a_ext ret i64 %min -; CHECK: @test50 +; CHECK-LABEL: @test50( ; CHECK-NEXT: %a_ext = sext i32 %a to i64 ; CHECK-NEXT: %is_a_nonpositive = icmp ugt i64 %a_ext, 2 ; CHECK-NEXT: %min = select i1 %is_a_nonpositive, i64 %a_ext, i64 2 @@ -695,7 +695,7 @@ define i64 @test50(i32 %a) nounwind { ; This select instruction can't be eliminated because trying to do so would ; change the number of vector elements. This used to assert. define i48 @test51(<3 x i1> %icmp, <3 x i16> %tmp) { -; CHECK: @test51 +; CHECK-LABEL: @test51( %select = select <3 x i1> %icmp, <3 x i16> zeroinitializer, <3 x i16> %tmp ; CHECK: select <3 x i1> %tmp2 = bitcast <3 x i16> %select to i48 @@ -705,7 +705,7 @@ define i48 @test51(<3 x i1> %icmp, <3 x i16> %tmp) { ; PR8575 define i32 @test52(i32 %n, i32 %m) nounwind { -; CHECK: @test52 +; CHECK-LABEL: @test52( %cmp = icmp sgt i32 %n, %m %. = select i1 %cmp, i32 1, i32 3 %add = add nsw i32 %., 3 @@ -720,7 +720,7 @@ define i32 @test53(i32 %x) nounwind { %cmp = icmp eq i32 %and, %x %sel = select i1 %cmp, i32 2, i32 1 ret i32 %sel -; CHECK: @test53 +; CHECK-LABEL: @test53( ; CHECK: select i1 %cmp ; CHECK: ret } @@ -730,7 +730,7 @@ define i32 @test54(i32 %X, i32 %Y) { %B = icmp eq i32 %A, 0 %C = select i1 %B, i32 %A, i32 1 ret i32 %C -; CHECK: @test54 +; CHECK-LABEL: @test54( ; CHECK-NOT: ashr ; CHECK-NOT: select ; CHECK: icmp ne i32 %X, 0 @@ -743,7 +743,7 @@ define i1 @test55(i1 %X, i32 %Y, i32 %Z) { %B = select i1 %X, i32 %Y, i32 %A %C = icmp eq i32 %B, 0 ret i1 %C -; CHECK: @test55 +; CHECK-LABEL: @test55( ; CHECK-NOT: ashr ; CHECK-NOT: select ; CHECK: icmp eq @@ -755,7 +755,7 @@ define i32 @test56(i16 %x) nounwind { %conv = zext i16 %x to i32 %cond = select i1 %tobool, i32 0, i32 %conv ret i32 %cond -; CHECK: @test56 +; CHECK-LABEL: @test56( ; CHECK-NEXT: zext ; CHECK-NEXT: ret } @@ -765,7 +765,7 @@ define i32 @test57(i32 %x, i32 %y) nounwind { %tobool = icmp eq i32 %x, 0 %.and = select i1 %tobool, i32 0, i32 %and ret i32 %.and -; CHECK: @test57 +; CHECK-LABEL: @test57( ; CHECK-NEXT: and i32 %x, %y ; CHECK-NEXT: ret } @@ -775,7 +775,7 @@ define i32 @test58(i16 %x) nounwind { %conv = zext i16 %x to i32 %cond = select i1 %tobool, i32 %conv, i32 1 ret i32 %cond -; CHECK: @test58 +; CHECK-LABEL: @test58( ; CHECK-NEXT: zext ; CHECK-NEXT: ret } @@ -785,7 +785,7 @@ define i32 @test59(i32 %x, i32 %y) nounwind { %tobool = icmp ne i32 %x, %y %.and = select i1 %tobool, i32 %and, i32 %y ret i32 %.and -; CHECK: @test59 +; CHECK-LABEL: @test59( ; CHECK-NEXT: and i32 %x, %y ; CHECK-NEXT: ret } @@ -796,7 +796,7 @@ define i1 @test60(i32 %x, i1* %y) nounwind { %cmp1 = icmp slt i32 %x, 1 %sel = select i1 %cmp, i1 %load, i1 %cmp1 ret i1 %sel -; CHECK: @test60 +; CHECK-LABEL: @test60( ; CHECK: select } @@ -806,7 +806,7 @@ define i32 @test61(i32* %ptr) { %B = icmp eq i32* %ptr, @glbl %C = select i1 %B, i32 %A, i32 10 ret i32 %C -; CHECK: @test61 +; CHECK-LABEL: @test61( ; CHECK: ret i32 10 } @@ -814,7 +814,7 @@ define i1 @test62(i1 %A, i1 %B) { %not = xor i1 %A, true %C = select i1 %A, i1 %not, i1 %B ret i1 %C -; CHECK: @test62 +; CHECK-LABEL: @test62( ; CHECK: %not = xor i1 %A, true ; CHECK: %C = and i1 %not, %B ; CHECK: ret i1 %C @@ -824,7 +824,7 @@ define i1 @test63(i1 %A, i1 %B) { %not = xor i1 %A, true %C = select i1 %A, i1 %B, i1 %not ret i1 %C -; CHECK: @test63 +; CHECK-LABEL: @test63( ; CHECK: %not = xor i1 %A, true ; CHECK: %C = or i1 %B, %not ; CHECK: ret i1 %C @@ -860,11 +860,11 @@ cond.end17: while.body: br label %while.body -; CHECK: @test64 +; CHECK-LABEL: @test64( ; CHECK-NOT: select } -; CHECK: @select_icmp_eq_and_1_0_or_2 +; CHECK-LABEL: @select_icmp_eq_and_1_0_or_2( ; CHECK-NEXT: [[SHL:%[a-z0-9]+]] = shl i32 %x, 1 ; CHECK-NEXT: [[AND:%[a-z0-9]+]] = and i32 [[SHL]], 2 ; CHECK-NEXT: [[OR:%[a-z0-9]+]] = or i32 [[AND]], %y @@ -877,7 +877,7 @@ define i32 @select_icmp_eq_and_1_0_or_2(i32 %x, i32 %y) { ret i32 %select } -; CHECK: @select_icmp_eq_and_32_0_or_8 +; CHECK-LABEL: @select_icmp_eq_and_32_0_or_8( ; CHECK-NEXT: [[LSHR:%[a-z0-9]+]] = lshr i32 %x, 2 ; CHECK-NEXT: [[AND:%[a-z0-9]+]] = and i32 [[LSHR]], 8 ; CHECK-NEXT: [[OR:%[a-z0-9]+]] = or i32 [[AND]], %y @@ -890,7 +890,7 @@ define i32 @select_icmp_eq_and_32_0_or_8(i32 %x, i32 %y) { ret i32 %select } -; CHECK: @select_icmp_ne_0_and_4096_or_4096 +; CHECK-LABEL: @select_icmp_ne_0_and_4096_or_4096( ; CHECK-NEXT: [[AND:%[a-z0-9]+]] = and i32 %x, 4096 ; CHECK-NEXT: [[XOR:%[a-z0-9]+]] = xor i32 [[AND]], 4096 ; CHECK-NEXT: [[OR:%[a-z0-9]+]] = or i32 [[XOR]], %y @@ -903,7 +903,7 @@ define i32 @select_icmp_ne_0_and_4096_or_4096(i32 %x, i32 %y) { ret i32 %select } -; CHECK: @select_icmp_eq_and_4096_0_or_4096 +; CHECK-LABEL: @select_icmp_eq_and_4096_0_or_4096( ; CHECK-NEXT: [[AND:%[a-z0-9]+]] = and i32 %x, 4096 ; CHECK-NEXT: [[OR:%[a-z0-9]+]] = or i32 [[AND]], %y ; CHECK-NEXT: ret i32 [[OR]] @@ -915,7 +915,7 @@ define i32 @select_icmp_eq_and_4096_0_or_4096(i32 %x, i32 %y) { ret i32 %select } -; CHECK: @select_icmp_eq_0_and_1_or_1 +; CHECK-LABEL: @select_icmp_eq_0_and_1_or_1( ; CHECK-NEXT: [[AND:%[a-z0-9]+]] = and i64 %x, 1 ; CHECK-NEXT: [[ZEXT:%[a-z0-9]+]] = trunc i64 [[AND]] to i32 ; CHECK-NEXT: [[OR:%[a-z0-9]+]] = or i32 [[XOR]], %y @@ -928,7 +928,7 @@ define i32 @select_icmp_eq_0_and_1_or_1(i64 %x, i32 %y) { ret i32 %select } -; CHECK: @select_icmp_ne_0_and_4096_or_32 +; CHECK-LABEL: @select_icmp_ne_0_and_4096_or_32( ; CHECK-NEXT: [[LSHR:%[a-z0-9]+]] = lshr i32 %x, 7 ; CHECK-NEXT: [[AND:%[a-z0-9]+]] = and i32 [[LSHR]], 32 ; CHECK-NEXT: [[XOR:%[a-z0-9]+]] = xor i32 [[AND]], 32 @@ -942,7 +942,7 @@ define i32 @select_icmp_ne_0_and_4096_or_32(i32 %x, i32 %y) { ret i32 %select } -; CHECK: @select_icmp_ne_0_and_32_or_4096 +; CHECK-LABEL: @select_icmp_ne_0_and_32_or_4096( ; CHECK-NEXT: [[SHL:%[a-z0-9]+]] = shl i32 %x, 7 ; CHECK-NEXT: [[AND:%[a-z0-9]+]] = and i32 [[SHL]], 4096 ; CHECK-NEXT: [[XOR:%[a-z0-9]+]] = xor i32 [[AND]], 4096 @@ -956,7 +956,7 @@ define i32 @select_icmp_ne_0_and_32_or_4096(i32 %x, i32 %y) { ret i32 %select } -; CHECK: @select_icmp_ne_0_and_1073741824_or_8 +; CHECK-LABEL: @select_icmp_ne_0_and_1073741824_or_8( ; CHECK-NEXT: [[LSHR:%[a-z0-9]+]] = lshr i32 %x, 27 ; CHECK-NEXT: [[AND:%[a-z0-9]+]] = and i32 [[LSHR]], 8 ; CHECK-NEXT: [[TRUNC:%[a-z0-9]+]] = trunc i32 [[AND]] to i8 @@ -971,7 +971,7 @@ define i8 @select_icmp_ne_0_and_1073741824_or_8(i32 %x, i8 %y) { ret i8 %select } -; CHECK: @select_icmp_ne_0_and_8_or_1073741824 +; CHECK-LABEL: @select_icmp_ne_0_and_8_or_1073741824( ; CHECK-NEXT: [[AND:%[a-z0-9]+]] = and i8 %x, 8 ; CHECK-NEXT: [[ZEXT:%[a-z0-9]+]] = zext i8 [[AND]] to i32 ; CHECK-NEXT: [[SHL:%[a-z0-9]+]] = shl nuw nsw i32 [[ZEXT]], 27 @@ -985,3 +985,39 @@ define i32 @select_icmp_ne_0_and_8_or_1073741824(i8 %x, i32 %y) { %select = select i1 %cmp, i32 %y, i32 %or ret i32 %select } + +define i32 @test65(i64 %x) { + %1 = and i64 %x, 16 + %2 = icmp ne i64 %1, 0 + %3 = select i1 %2, i32 40, i32 42 + ret i32 %3 + +; CHECK-LABEL: @test65( +; CHECK: and i64 %x, 16 +; CHECK: trunc i64 %1 to i32 +; CHECK: lshr exact i32 %2, 3 +; CHECK: xor i32 %3, 42 +} + +define i32 @test66(i64 %x) { + %1 = and i64 %x, 4294967296 + %2 = icmp ne i64 %1, 0 + %3 = select i1 %2, i32 40, i32 42 + ret i32 %3 + +; CHECK-LABEL: @test66( +; CHECK: select +} + +define i32 @test67(i16 %x) { + %1 = and i16 %x, 4 + %2 = icmp ne i16 %1, 0 + %3 = select i1 %2, i32 40, i32 42 + ret i32 %3 + +; CHECK-LABEL: @test67( +; CHECK: and i16 %x, 4 +; CHECK: zext i16 %1 to i32 +; CHECK: lshr exact i32 %2, 1 +; CHECK: xor i32 %3, 42 +} diff --git a/test/Transforms/InstCombine/sext.ll b/test/Transforms/InstCombine/sext.ll index 968f37c..b8dfe22 100644 --- a/test/Transforms/InstCombine/sext.ll +++ b/test/Transforms/InstCombine/sext.ll @@ -11,7 +11,7 @@ define i64 @test1(i32 %x) { %s = sext i32 %t to i64 ret i64 %s -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK: zext i32 %t } @@ -20,7 +20,7 @@ define i64 @test2(i32 %x) { %s = sext i32 %t to i64 ret i64 %s -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK: zext i32 %t } @@ -29,7 +29,7 @@ define i64 @test3(i32 %x) { %s = sext i32 %t to i64 ret i64 %s -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK: zext i32 %t } @@ -38,7 +38,7 @@ define i64 @test4(i32 %x) { %s = sext i32 %t to i64 ret i64 %s -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK: zext i32 %t } @@ -46,7 +46,7 @@ define i64 @test5(i32 %x) { %t = urem i32 %x, 30000 %s = sext i32 %t to i64 ret i64 %s -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK: zext i32 %t } @@ -55,7 +55,7 @@ define i64 @test6(i32 %x) { %t = mul i32 %u, 3 %s = sext i32 %t to i64 ret i64 %s -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK: zext i32 %t } @@ -64,7 +64,7 @@ define i64 @test7(i32 %x) { %u = sub i32 20000, %t %s = sext i32 %u to i64 ret i64 %s -; CHECK: @test7 +; CHECK-LABEL: @test7( ; CHECK: zext i32 %u to i64 } @@ -74,7 +74,7 @@ define i32 @test8(i8 %a, i32 %f, i1 %p, i32* %z) { %s = trunc i32 %e to i16 %n = sext i16 %s to i32 ret i32 %n -; CHECK: @test8 +; CHECK-LABEL: @test8( ; CHECK: %d = lshr i32 %f, 24 ; CHECK: %n = select i1 %p, i32 %d, i32 0 ; CHECK: ret i32 %n @@ -92,7 +92,7 @@ F: %V = phi i32 [%t2, %T], [42, %entry] %W = trunc i32 %V to i16 ret i16 %W -; CHECK: @test9 +; CHECK-LABEL: @test9( ; CHECK: T: ; CHECK-NEXT: br label %F ; CHECK: F: @@ -108,7 +108,7 @@ entry: %a = ashr i8 %tmp16, 6 %b = sext i8 %a to i32 ret i32 %b -; CHECK: @test10 +; CHECK-LABEL: @test10( ; CHECK: shl i32 %i, 30 ; CHECK-NEXT: ashr exact i32 ; CHECK-NEXT: ret i32 @@ -120,7 +120,7 @@ define void @test11(<2 x i16> %srcA, <2 x i16> %srcB, <2 x i16>* %dst) { %tmask = ashr <2 x i16> %sext, <i16 15, i16 15> store <2 x i16> %tmask, <2 x i16>* %dst ret void -; CHECK: @test11 +; CHECK-LABEL: @test11( ; CHECK-NEXT: icmp eq ; CHECK-NEXT: sext <2 x i1> ; CHECK-NEXT: store <2 x i16> @@ -132,7 +132,7 @@ define i64 @test12(i32 %x) nounwind { %sub = sub nsw i32 0, %shr %conv = sext i32 %sub to i64 ret i64 %conv -; CHECK: @test12 +; CHECK-LABEL: @test12( ; CHECK: sext ; CHECK: ret } @@ -142,7 +142,7 @@ define i32 @test13(i32 %x) nounwind { %cmp = icmp eq i32 %and, 0 %ext = sext i1 %cmp to i32 ret i32 %ext -; CHECK: @test13 +; CHECK-LABEL: @test13( ; CHECK-NEXT: %and = lshr i32 %x, 3 ; CHECK-NEXT: %1 = and i32 %and, 1 ; CHECK-NEXT: %sext = add i32 %1, -1 @@ -154,7 +154,7 @@ define i32 @test14(i16 %x) nounwind { %cmp = icmp ne i16 %and, 16 %ext = sext i1 %cmp to i32 ret i32 %ext -; CHECK: @test14 +; CHECK-LABEL: @test14( ; CHECK-NEXT: %and = lshr i16 %x, 4 ; CHECK-NEXT: %1 = and i16 %and, 1 ; CHECK-NEXT: %sext = add i16 %1, -1 @@ -167,7 +167,7 @@ define i32 @test15(i32 %x) nounwind { %cmp = icmp ne i32 %and, 0 %ext = sext i1 %cmp to i32 ret i32 %ext -; CHECK: @test15 +; CHECK-LABEL: @test15( ; CHECK-NEXT: %1 = shl i32 %x, 27 ; CHECK-NEXT: %sext = ashr i32 %1, 31 ; CHECK-NEXT: ret i32 %sext @@ -178,7 +178,7 @@ define i32 @test16(i16 %x) nounwind { %cmp = icmp eq i16 %and, 8 %ext = sext i1 %cmp to i32 ret i32 %ext -; CHECK: @test16 +; CHECK-LABEL: @test16( ; CHECK-NEXT: %1 = shl i16 %x, 12 ; CHECK-NEXT: %sext = ashr i16 %1, 15 ; CHECK-NEXT: %ext = sext i16 %sext to i32 @@ -189,7 +189,7 @@ define i32 @test17(i1 %x) nounwind { %c1 = sext i1 %x to i32 %c2 = sub i32 0, %c1 ret i32 %c2 -; CHECK: @test17 +; CHECK-LABEL: @test17( ; CHECK-NEXT: [[TEST17:%.*]] = zext i1 %x to i32 ; CHECK-NEXT: ret i32 [[TEST17]] } diff --git a/test/Transforms/InstCombine/shift-sra.ll b/test/Transforms/InstCombine/shift-sra.ll index a578bbe..7523550 100644 --- a/test/Transforms/InstCombine/shift-sra.ll +++ b/test/Transforms/InstCombine/shift-sra.ll @@ -7,7 +7,7 @@ define i32 @test1(i32 %X, i8 %A) { %Y = ashr i32 %X, %shift.upgrd.1 ; <i32> [#uses=1] %Z = and i32 %Y, 1 ; <i32> [#uses=1] ret i32 %Z -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK: lshr i32 %X, %shift.upgrd.1 } @@ -16,7 +16,7 @@ define i32 @test2(i8 %tmp) { %tmp4 = add i32 %tmp3, 7 ; <i32> [#uses=1] %tmp5 = ashr i32 %tmp4, 3 ; <i32> [#uses=1] ret i32 %tmp5 -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK: lshr i32 %tmp4, 3 } @@ -33,7 +33,7 @@ C: %S = ashr i64 %P, 12 ret i64 %S -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK: %P = phi i64 ; CHECK-NEXT: ret i64 %P } @@ -52,7 +52,7 @@ C: %S = ashr i64 %R, 12 ret i64 %S -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK: %P = phi i64 ; CHECK-NEXT: ret i64 %P } @@ -70,7 +70,7 @@ D: %P = phi i32 [0, %A], [0, %B], [%Y, %C] %S = ashr i32 %P, 16 ret i32 %S -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK: %P = phi i32 ; CHECK-NEXT: ashr i32 %P, 16 E: diff --git a/test/Transforms/InstCombine/shift.ll b/test/Transforms/InstCombine/shift.ll index 41f8aa9..0bdab13 100644 --- a/test/Transforms/InstCombine/shift.ll +++ b/test/Transforms/InstCombine/shift.ll @@ -3,14 +3,14 @@ ; RUN: opt < %s -instcombine -S | FileCheck %s define i32 @test1(i32 %A) { -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK: ret i32 %A %B = shl i32 %A, 0 ; <i32> [#uses=1] ret i32 %B } define i32 @test2(i8 %A) { -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK: ret i32 0 %shift.upgrd.1 = zext i8 %A to i32 ; <i32> [#uses=1] %B = shl i32 0, %shift.upgrd.1 ; <i32> [#uses=1] @@ -18,14 +18,14 @@ define i32 @test2(i8 %A) { } define i32 @test3(i32 %A) { -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK: ret i32 %A %B = ashr i32 %A, 0 ; <i32> [#uses=1] ret i32 %B } define i32 @test4(i8 %A) { -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK: ret i32 0 %shift.upgrd.2 = zext i8 %A to i32 ; <i32> [#uses=1] %B = ashr i32 0, %shift.upgrd.2 ; <i32> [#uses=1] @@ -34,35 +34,35 @@ define i32 @test4(i8 %A) { define i32 @test5(i32 %A) { -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK: ret i32 undef %B = lshr i32 %A, 32 ;; shift all bits out ret i32 %B } define i32 @test5a(i32 %A) { -; CHECK: @test5a +; CHECK-LABEL: @test5a( ; CHECK: ret i32 undef %B = shl i32 %A, 32 ;; shift all bits out ret i32 %B } define i32 @test5b() { -; CHECK: @test5b +; CHECK-LABEL: @test5b( ; CHECK: ret i32 -1 %B = ashr i32 undef, 2 ;; top two bits must be equal, so not undef ret i32 %B } define i32 @test5b2(i32 %A) { -; CHECK: @test5b2 +; CHECK-LABEL: @test5b2( ; CHECK: ret i32 -1 %B = ashr i32 undef, %A ;; top %A bits must be equal, so not undef ret i32 %B } define i32 @test6(i32 %A) { -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK-NEXT: mul i32 %A, 6 ; CHECK-NEXT: ret i32 %B = shl i32 %A, 1 ;; convert to an mul instruction @@ -71,7 +71,7 @@ define i32 @test6(i32 %A) { } define i32 @test6a(i32 %A) { -; CHECK: @test6a +; CHECK-LABEL: @test6a( ; CHECK-NEXT: mul i32 %A, 6 ; CHECK-NEXT: ret i32 %B = mul i32 %A, 3 @@ -80,7 +80,7 @@ define i32 @test6a(i32 %A) { } define i32 @test7(i8 %A) { -; CHECK: @test7 +; CHECK-LABEL: @test7( ; CHECK-NEXT: ret i32 -1 %shift.upgrd.3 = zext i8 %A to i32 %B = ashr i32 -1, %shift.upgrd.3 ;; Always equal to -1 @@ -89,7 +89,7 @@ define i32 @test7(i8 %A) { ;; (A << 5) << 3 === A << 8 == 0 define i8 @test8(i8 %A) { -; CHECK: @test8 +; CHECK-LABEL: @test8( ; CHECK: ret i8 0 %B = shl i8 %A, 5 ; <i8> [#uses=1] %C = shl i8 %B, 3 ; <i8> [#uses=1] @@ -98,7 +98,7 @@ define i8 @test8(i8 %A) { ;; (A << 7) >> 7 === A & 1 define i8 @test9(i8 %A) { -; CHECK: @test9 +; CHECK-LABEL: @test9( ; CHECK-NEXT: and i8 %A, 1 ; CHECK-NEXT: ret i8 %B = shl i8 %A, 7 ; <i8> [#uses=1] @@ -110,7 +110,7 @@ define i8 @test9(i8 %A) { ;; (A >> 7) << 7 === A & 128 ;; The shl may be valuable to scalar evolution. define i8 @test10(i8 %A) { -; CHECK: @test10 +; CHECK-LABEL: @test10( ; CHECK-NEXT: and i8 %A, -128 ; CHECK-NEXT: ret i8 %B = lshr i8 %A, 7 ; <i8> [#uses=1] @@ -120,7 +120,7 @@ define i8 @test10(i8 %A) { ;; Allow the simplification when the lshr shift is exact. define i8 @test10a(i8 %A) { -; CHECK: @test10a +; CHECK-LABEL: @test10a( ; CHECK-NEXT: ret i8 %A %B = lshr exact i8 %A, 7 %C = shl i8 %B, 7 @@ -131,7 +131,7 @@ define i8 @test10a(i8 %A) { ;; (A >> 3) << 4 === (A & 0x1F) << 1 ;; The shl may be valuable to scalar evolution. define i8 @test11(i8 %A) { -; CHECK: @test11 +; CHECK-LABEL: @test11( ; CHECK: shl i8 ; CHECK-NEXT: ret i8 %a = mul i8 %A, 3 ; <i8> [#uses=1] @@ -142,7 +142,7 @@ define i8 @test11(i8 %A) { ;; Allow the simplification in InstCombine when the lshr shift is exact. define i8 @test11a(i8 %A) { -; CHECK: @test11a +; CHECK-LABEL: @test11a( ; CHECK-NEXT: mul i8 %A, 6 ; CHECK-NEXT: ret i8 %a = mul i8 %A, 3 @@ -154,7 +154,7 @@ define i8 @test11a(i8 %A) { ;; This is deferred to DAGCombine unless %B is single-use. ;; (A >> 8) << 8 === A & -256 define i32 @test12(i32 %A) { -; CHECK: @test12 +; CHECK-LABEL: @test12( ; CHECK-NEXT: and i32 %A, -256 ; CHECK-NEXT: ret i32 %B = ashr i32 %A, 8 ; <i32> [#uses=1] @@ -166,7 +166,7 @@ define i32 @test12(i32 %A) { ;; (A >> 3) << 4 === (A & -8) * 2 ;; The shl may be valuable to scalar evolution. define i8 @test13(i8 %A) { -; CHECK: @test13 +; CHECK-LABEL: @test13( ; CHECK: shl i8 ; CHECK-NEXT: ret i8 %a = mul i8 %A, 3 ; <i8> [#uses=1] @@ -176,7 +176,7 @@ define i8 @test13(i8 %A) { } define i8 @test13a(i8 %A) { -; CHECK: @test13a +; CHECK-LABEL: @test13a( ; CHECK-NEXT: mul i8 %A, 6 ; CHECK-NEXT: ret i8 %a = mul i8 %A, 3 @@ -187,7 +187,7 @@ define i8 @test13a(i8 %A) { ;; D = ((B | 1234) << 4) === ((B << 4)|(1234 << 4) define i32 @test14(i32 %A) { -; CHECK: @test14 +; CHECK-LABEL: @test14( ; CHECK-NEXT: %B = and i32 %A, -19760 ; CHECK-NEXT: or i32 %B, 19744 ; CHECK-NEXT: ret i32 @@ -199,7 +199,7 @@ define i32 @test14(i32 %A) { ;; D = ((B | 1234) << 4) === ((B << 4)|(1234 << 4) define i32 @test14a(i32 %A) { -; CHECK: @test14a +; CHECK-LABEL: @test14a( ; CHECK-NEXT: and i32 %A, 77 ; CHECK-NEXT: ret i32 %B = shl i32 %A, 4 ; <i32> [#uses=1] @@ -209,7 +209,7 @@ define i32 @test14a(i32 %A) { } define i32 @test15(i1 %C) { -; CHECK: @test15 +; CHECK-LABEL: @test15( ; CHECK-NEXT: select i1 %C, i32 12, i32 4 ; CHECK-NEXT: ret i32 %A = select i1 %C, i32 3, i32 1 ; <i32> [#uses=1] @@ -218,7 +218,7 @@ define i32 @test15(i1 %C) { } define i32 @test15a(i1 %C) { -; CHECK: @test15a +; CHECK-LABEL: @test15a( ; CHECK-NEXT: select i1 %C, i32 512, i32 128 ; CHECK-NEXT: ret i32 %A = select i1 %C, i8 3, i8 1 ; <i8> [#uses=1] @@ -228,7 +228,7 @@ define i32 @test15a(i1 %C) { } define i1 @test16(i32 %X) { -; CHECK: @test16 +; CHECK-LABEL: @test16( ; CHECK-NEXT: and i32 %X, 16 ; CHECK-NEXT: icmp ne i32 ; CHECK-NEXT: ret i1 @@ -239,7 +239,7 @@ define i1 @test16(i32 %X) { } define i1 @test17(i32 %A) { -; CHECK: @test17 +; CHECK-LABEL: @test17( ; CHECK-NEXT: and i32 %A, -8 ; CHECK-NEXT: icmp eq i32 ; CHECK-NEXT: ret i1 @@ -250,7 +250,7 @@ define i1 @test17(i32 %A) { define i1 @test18(i8 %A) { -; CHECK: @test18 +; CHECK-LABEL: @test18( ; CHECK: ret i1 false %B = lshr i8 %A, 7 ; <i8> [#uses=1] @@ -260,7 +260,7 @@ define i1 @test18(i8 %A) { } define i1 @test19(i32 %A) { -; CHECK: @test19 +; CHECK-LABEL: @test19( ; CHECK-NEXT: icmp ult i32 %A, 4 ; CHECK-NEXT: ret i1 %B = ashr i32 %A, 2 ; <i32> [#uses=1] @@ -271,18 +271,17 @@ define i1 @test19(i32 %A) { define i1 @test19a(i32 %A) { -; CHECK: @test19a -; CHECK-NEXT: and i32 %A, -4 -; CHECK-NEXT: icmp eq i32 +; CHECK-LABEL: @test19a( +; CHECK-NEXT: icmp ugt i32 %A, -5 ; CHECK-NEXT: ret i1 %B = ashr i32 %A, 2 ; <i32> [#uses=1] - ;; (X & -4) == -4 + ;; X >u ~4 %C = icmp eq i32 %B, -1 ; <i1> [#uses=1] ret i1 %C } define i1 @test20(i8 %A) { -; CHECK: @test20 +; CHECK-LABEL: @test20( ; CHECK: ret i1 false %B = ashr i8 %A, 7 ; <i8> [#uses=1] ;; false @@ -291,7 +290,7 @@ define i1 @test20(i8 %A) { } define i1 @test21(i8 %A) { -; CHECK: @test21 +; CHECK-LABEL: @test21( ; CHECK-NEXT: and i8 %A, 15 ; CHECK-NEXT: icmp eq i8 ; CHECK-NEXT: ret i1 @@ -301,7 +300,7 @@ define i1 @test21(i8 %A) { } define i1 @test22(i8 %A) { -; CHECK: @test22 +; CHECK-LABEL: @test22( ; CHECK-NEXT: and i8 %A, 15 ; CHECK-NEXT: icmp eq i8 ; CHECK-NEXT: ret i1 @@ -311,7 +310,7 @@ define i1 @test22(i8 %A) { } define i8 @test23(i32 %A) { -; CHECK: @test23 +; CHECK-LABEL: @test23( ; CHECK-NEXT: trunc i32 %A to i8 ; CHECK-NEXT: ret i8 @@ -323,7 +322,7 @@ define i8 @test23(i32 %A) { } define i8 @test24(i8 %X) { -; CHECK: @test24 +; CHECK-LABEL: @test24( ; CHECK-NEXT: and i8 %X, 3 ; CHECK-NEXT: ret i8 %Y = and i8 %X, -5 ; <i8> [#uses=1] @@ -333,7 +332,7 @@ define i8 @test24(i8 %X) { } define i32 @test25(i32 %tmp.2, i32 %AA) { -; CHECK: @test25 +; CHECK-LABEL: @test25( ; CHECK-NEXT: and i32 %tmp.2, -131072 ; CHECK-NEXT: add i32 %{{[^,]*}}, %AA ; CHECK-NEXT: and i32 %{{[^,]*}}, -131072 @@ -347,7 +346,7 @@ define i32 @test25(i32 %tmp.2, i32 %AA) { ;; handle casts between shifts. define i32 @test26(i32 %A) { -; CHECK: @test26 +; CHECK-LABEL: @test26( ; CHECK-NEXT: and i32 %A, -2 ; CHECK-NEXT: ret i32 %B = lshr i32 %A, 1 ; <i32> [#uses=1] @@ -358,7 +357,7 @@ define i32 @test26(i32 %A) { define i1 @test27(i32 %x) nounwind { -; CHECK: @test27 +; CHECK-LABEL: @test27( ; CHECK-NEXT: and i32 %x, 8 ; CHECK-NEXT: icmp ne i32 ; CHECK-NEXT: ret i1 @@ -369,7 +368,7 @@ define i1 @test27(i32 %x) nounwind { define i8 @test28(i8 %x) { entry: -; CHECK: @test28 +; CHECK-LABEL: @test28( ; CHECK: icmp slt i8 %x, 0 ; CHECK-NEXT: br i1 %tmp1 = lshr i8 %x, 7 @@ -386,7 +385,7 @@ bb2: define i8 @test28a(i8 %x, i8 %y) { entry: ; This shouldn't be transformed. -; CHECK: @test28a +; CHECK-LABEL: @test28a( ; CHECK: %tmp1 = lshr i8 %x, 7 ; CHECK: %cond1 = icmp eq i8 %tmp1, 0 ; CHECK: br i1 %cond1, label %bb2, label %bb1 @@ -407,7 +406,7 @@ entry: %tmp917 = trunc i64 %tmp916 to i32 %tmp10 = lshr i32 %tmp917, 31 ret i32 %tmp10 -; CHECK: @test29 +; CHECK-LABEL: @test29( ; CHECK: %tmp916 = lshr i64 %d18, 63 ; CHECK: %tmp10 = trunc i64 %tmp916 to i32 } @@ -418,7 +417,7 @@ define i32 @test30(i32 %A, i32 %B, i32 %C) { %Y = shl i32 %B, %C %Z = and i32 %X, %Y ret i32 %Z -; CHECK: @test30 +; CHECK-LABEL: @test30( ; CHECK: %X1 = and i32 %A, %B ; CHECK: %Z = shl i32 %X1, %C } @@ -428,7 +427,7 @@ define i32 @test31(i32 %A, i32 %B, i32 %C) { %Y = lshr i32 %B, %C %Z = or i32 %X, %Y ret i32 %Z -; CHECK: @test31 +; CHECK-LABEL: @test31( ; CHECK: %X1 = or i32 %A, %B ; CHECK: %Z = lshr i32 %X1, %C } @@ -438,7 +437,7 @@ define i32 @test32(i32 %A, i32 %B, i32 %C) { %Y = ashr i32 %B, %C %Z = xor i32 %X, %Y ret i32 %Z -; CHECK: @test32 +; CHECK-LABEL: @test32( ; CHECK: %X1 = xor i32 %A, %B ; CHECK: %Z = ashr i32 %X1, %C ; CHECK: ret i32 %Z @@ -448,7 +447,7 @@ define i1 @test33(i32 %X) { %tmp1 = shl i32 %X, 7 %tmp2 = icmp slt i32 %tmp1, 0 ret i1 %tmp2 -; CHECK: @test33 +; CHECK-LABEL: @test33( ; CHECK: %tmp1.mask = and i32 %X, 16777216 ; CHECK: %tmp2 = icmp ne i32 %tmp1.mask, 0 } @@ -457,7 +456,7 @@ define i1 @test34(i32 %X) { %tmp1 = lshr i32 %X, 7 %tmp2 = icmp slt i32 %tmp1, 0 ret i1 %tmp2 -; CHECK: @test34 +; CHECK-LABEL: @test34( ; CHECK: ret i1 false } @@ -465,7 +464,7 @@ define i1 @test35(i32 %X) { %tmp1 = ashr i32 %X, 7 %tmp2 = icmp slt i32 %tmp1, 0 ret i1 %tmp2 -; CHECK: @test35 +; CHECK-LABEL: @test35( ; CHECK: %tmp2 = icmp slt i32 %X, 0 ; CHECK: ret i1 %tmp2 } @@ -478,7 +477,7 @@ entry: %tmp45 = lshr i128 %ins, 64 ret i128 %tmp45 -; CHECK: @test36 +; CHECK-LABEL: @test36( ; CHECK: %tmp231 = or i128 %B, %A ; CHECK: %ins = and i128 %tmp231, 18446744073709551615 ; CHECK: ret i128 %ins @@ -494,7 +493,7 @@ entry: %tmp46 = trunc i128 %tmp45 to i64 ret i64 %tmp46 -; CHECK: @test37 +; CHECK-LABEL: @test37( ; CHECK: %tmp23 = shl nuw nsw i128 %tmp22, 32 ; CHECK: %ins = or i128 %tmp23, %A ; CHECK: %tmp46 = trunc i128 %ins to i64 @@ -504,14 +503,14 @@ define i32 @test38(i32 %x) nounwind readnone { %rem = srem i32 %x, 32 %shl = shl i32 1, %rem ret i32 %shl -; CHECK: @test38 +; CHECK-LABEL: @test38( ; CHECK-NEXT: and i32 %x, 31 ; CHECK-NEXT: shl i32 1 ; CHECK-NEXT: ret i32 } ; <rdar://problem/8756731> -; CHECK: @test39 +; CHECK-LABEL: @test39( define i8 @test39(i32 %a0) { entry: %tmp4 = trunc i32 %a0 to i8 @@ -537,7 +536,7 @@ define i32 @test40(i32 %a, i32 %b) nounwind { %shl2 = shl i32 %shl1, 2 %div = udiv i32 %a, %shl2 ret i32 %div -; CHECK: @test40 +; CHECK-LABEL: @test40( ; CHECK-NEXT: add i32 %b, 2 ; CHECK-NEXT: lshr i32 %a ; CHECK-NEXT: ret i32 @@ -547,7 +546,7 @@ define i32 @test41(i32 %a, i32 %b) nounwind { %1 = shl i32 1, %b %2 = shl i32 %1, 3 ret i32 %2 -; CHECK: @test41 +; CHECK-LABEL: @test41( ; CHECK-NEXT: shl i32 8, %b ; CHECK-NEXT: ret i32 } @@ -556,7 +555,7 @@ define i32 @test42(i32 %a, i32 %b) nounwind { %div = lshr i32 4096, %b ; must be exact otherwise we'd divide by zero %div2 = udiv i32 %a, %div ret i32 %div2 -; CHECK: @test42 +; CHECK-LABEL: @test42( ; CHECK-NEXT: lshr exact i32 4096, %b } @@ -564,7 +563,7 @@ define i32 @test43(i32 %a, i32 %b) nounwind { %div = shl i32 4096, %b ; must be exact otherwise we'd divide by zero %div2 = udiv i32 %a, %div ret i32 %div2 -; CHECK: @test43 +; CHECK-LABEL: @test43( ; CHECK-NEXT: add i32 %b, 12 ; CHECK-NEXT: lshr ; CHECK-NEXT: ret @@ -574,7 +573,7 @@ define i32 @test44(i32 %a) nounwind { %y = shl nuw i32 %a, 1 %z = shl i32 %y, 4 ret i32 %z -; CHECK: @test44 +; CHECK-LABEL: @test44( ; CHECK-NEXT: %y = shl i32 %a, 5 ; CHECK-NEXT: ret i32 %y } @@ -583,7 +582,7 @@ define i32 @test45(i32 %a) nounwind { %y = lshr exact i32 %a, 1 %z = lshr i32 %y, 4 ret i32 %z -; CHECK: @test45 +; CHECK-LABEL: @test45( ; CHECK-NEXT: %y = lshr i32 %a, 5 ; CHECK-NEXT: ret i32 %y } @@ -592,7 +591,7 @@ define i32 @test46(i32 %a) { %y = ashr exact i32 %a, 3 %z = shl i32 %y, 1 ret i32 %z -; CHECK: @test46 +; CHECK-LABEL: @test46( ; CHECK-NEXT: %z = ashr exact i32 %a, 2 ; CHECK-NEXT: ret i32 %z } @@ -601,7 +600,7 @@ define i32 @test47(i32 %a) { %y = lshr exact i32 %a, 3 %z = shl i32 %y, 1 ret i32 %z -; CHECK: @test47 +; CHECK-LABEL: @test47( ; CHECK-NEXT: %z = lshr exact i32 %a, 2 ; CHECK-NEXT: ret i32 %z } @@ -610,7 +609,7 @@ define i32 @test48(i32 %x) { %A = lshr exact i32 %x, 1 %B = shl i32 %A, 3 ret i32 %B -; CHECK: @test48 +; CHECK-LABEL: @test48( ; CHECK-NEXT: %B = shl i32 %x, 2 ; CHECK-NEXT: ret i32 %B } @@ -619,7 +618,7 @@ define i32 @test49(i32 %x) { %A = ashr exact i32 %x, 1 %B = shl i32 %A, 3 ret i32 %B -; CHECK: @test49 +; CHECK-LABEL: @test49( ; CHECK-NEXT: %B = shl i32 %x, 2 ; CHECK-NEXT: ret i32 %B } @@ -628,7 +627,7 @@ define i32 @test50(i32 %x) { %A = shl nsw i32 %x, 1 %B = ashr i32 %A, 3 ret i32 %B -; CHECK: @test50 +; CHECK-LABEL: @test50( ; CHECK-NEXT: %B = ashr i32 %x, 2 ; CHECK-NEXT: ret i32 %B } @@ -637,7 +636,7 @@ define i32 @test51(i32 %x) { %A = shl nuw i32 %x, 1 %B = lshr i32 %A, 3 ret i32 %B -; CHECK: @test51 +; CHECK-LABEL: @test51( ; CHECK-NEXT: %B = lshr i32 %x, 2 ; CHECK-NEXT: ret i32 %B } @@ -646,7 +645,7 @@ define i32 @test52(i32 %x) { %A = shl nsw i32 %x, 3 %B = ashr i32 %A, 1 ret i32 %B -; CHECK: @test52 +; CHECK-LABEL: @test52( ; CHECK-NEXT: %B = shl nsw i32 %x, 2 ; CHECK-NEXT: ret i32 %B } @@ -655,7 +654,7 @@ define i32 @test53(i32 %x) { %A = shl nuw i32 %x, 3 %B = lshr i32 %A, 1 ret i32 %B -; CHECK: @test53 +; CHECK-LABEL: @test53( ; CHECK-NEXT: %B = shl nuw i32 %x, 2 ; CHECK-NEXT: ret i32 %B } @@ -665,7 +664,7 @@ define i32 @test54(i32 %x) { %shl = shl i32 %shr2, 4 %and = and i32 %shl, 16 ret i32 %and -; CHECK: @test54 +; CHECK-LABEL: @test54( ; CHECK: shl i32 %x, 3 } @@ -675,7 +674,7 @@ define i32 @test55(i32 %x) { %shl = shl i32 %shr2, 4 %or = or i32 %shl, 8 ret i32 %or -; CHECK: @test55 +; CHECK-LABEL: @test55( ; CHECK: shl i32 %x, 3 } @@ -684,7 +683,7 @@ define i32 @test56(i32 %x) { %shl = shl i32 %shr2, 4 %or = or i32 %shl, 7 ret i32 %or -; CHECK: @test56 +; CHECK-LABEL: @test56( ; CHECK: shl i32 %shr2, 4 } @@ -694,7 +693,7 @@ define i32 @test57(i32 %x) { %shl = shl i32 %shr, 4 %and = and i32 %shl, 16 ret i32 %and -; CHECK: @test57 +; CHECK-LABEL: @test57( ; CHECK: shl i32 %x, 3 } @@ -703,7 +702,7 @@ define i32 @test58(i32 %x) { %shl = shl i32 %shr, 4 %or = or i32 %shl, 8 ret i32 %or -; CHECK: @test58 +; CHECK-LABEL: @test58( ; CHECK: shl i32 %x, 3 } @@ -712,7 +711,7 @@ define i32 @test59(i32 %x) { %shl = shl i32 %shr, 4 %or = or i32 %shl, 7 ret i32 %or -; CHECK: @test59 +; CHECK-LABEL: @test59( ; CHECK: %shl = shl i32 %shr1, 4 } @@ -722,7 +721,7 @@ define i32 @test60(i32 %x) { %shl = shl i32 %shr, 1 %or = or i32 %shl, 1 ret i32 %or -; CHECK: @test60 +; CHECK-LABEL: @test60( ; CHECK: ashr i32 %x, 3 } @@ -732,7 +731,7 @@ define i32 @test61(i32 %x) { %shl = shl i32 %shr, 1 %or = or i32 %shl, 2 ret i32 %or -; CHECK: @test61 +; CHECK-LABEL: @test61( ; CHECK: ashr i32 %x, 4 } @@ -742,6 +741,6 @@ define i32 @test62(i32 %x) { %shl = shl i32 %shr, 1 %or = or i32 %shl, 1 ret i32 %or -; CHECK: @test62 +; CHECK-LABEL: @test62( ; CHECK: ashr exact i32 %x, 3 } diff --git a/test/Transforms/InstCombine/sign-test-and-or.ll b/test/Transforms/InstCombine/sign-test-and-or.ll index a6066d8..95ed9b9 100644 --- a/test/Transforms/InstCombine/sign-test-and-or.ll +++ b/test/Transforms/InstCombine/sign-test-and-or.ll @@ -8,7 +8,7 @@ define void @test1(i32 %a, i32 %b) nounwind { %or.cond = or i1 %1, %2 br i1 %or.cond, label %if.then, label %if.end -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK-NEXT: %1 = or i32 %a, %b ; CHECK-NEXT: %2 = icmp slt i32 %1, 0 ; CHECK-NEXT: br @@ -27,7 +27,7 @@ define void @test2(i32 %a, i32 %b) nounwind { %or.cond = or i1 %1, %2 br i1 %or.cond, label %if.then, label %if.end -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK-NEXT: %1 = and i32 %a, %b ; CHECK-NEXT: %2 = icmp sgt i32 %1, -1 ; CHECK-NEXT: br @@ -46,7 +46,7 @@ define void @test3(i32 %a, i32 %b) nounwind { %or.cond = and i1 %1, %2 br i1 %or.cond, label %if.then, label %if.end -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK-NEXT: %1 = and i32 %a, %b ; CHECK-NEXT: %2 = icmp slt i32 %1, 0 ; CHECK-NEXT: br @@ -65,7 +65,7 @@ define void @test4(i32 %a, i32 %b) nounwind { %or.cond = and i1 %1, %2 br i1 %or.cond, label %if.then, label %if.end -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK-NEXT: %1 = or i32 %a, %b ; CHECK-NEXT: %2 = icmp sgt i32 %1, -1 ; CHECK-NEXT: br @@ -85,7 +85,7 @@ define void @test5(i32 %a) nounwind { %or.cond = and i1 %1, %2 br i1 %or.cond, label %if.then, label %if.end -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK-NEXT: %1 = and i32 %a, -2013265920 ; CHECK-NEXT: %2 = icmp eq i32 %1, 0 ; CHECK-NEXT: br i1 %2, label %if.then, label %if.end @@ -105,7 +105,7 @@ define void @test6(i32 %a) nounwind { %or.cond = and i1 %1, %2 br i1 %or.cond, label %if.then, label %if.end -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK-NEXT: %1 = and i32 %a, -2013265920 ; CHECK-NEXT: %2 = icmp eq i32 %1, 0 ; CHECK-NEXT: br i1 %2, label %if.then, label %if.end @@ -125,7 +125,7 @@ define void @test7(i32 %a) nounwind { %or.cond = or i1 %1, %2 br i1 %or.cond, label %if.then, label %if.end -; CHECK: @test7 +; CHECK-LABEL: @test7( ; CHECK-NEXT: %1 = and i32 %a, -2013265920 ; CHECK-NEXT: %2 = icmp eq i32 %1, 0 ; CHECK-NEXT: br i1 %2, label %if.end, label %if.the @@ -145,7 +145,7 @@ define void @test8(i32 %a) nounwind { %or.cond = or i1 %1, %2 br i1 %or.cond, label %if.then, label %if.end -; CHECK: @test8 +; CHECK-LABEL: @test8( ; CHECK-NEXT: %1 = and i32 %a, -2013265920 ; CHECK-NEXT: %2 = icmp eq i32 %1, 0 ; CHECK-NEXT: br i1 %2, label %if.end, label %if.the @@ -165,7 +165,7 @@ define void @test9(i32 %a) nounwind { %or.cond = and i1 %2, %3 br i1 %or.cond, label %if.then, label %if.end -; CHECK: @test9 +; CHECK-LABEL: @test9( ; CHECK-NEXT: %1 = and i32 %a, -1073741824 ; CHECK-NEXT: %2 = icmp eq i32 %1, 1073741824 ; CHECK-NEXT: br i1 %2, label %if.then, label %if.end diff --git a/test/Transforms/InstCombine/signext.ll b/test/Transforms/InstCombine/signext.ll index 5ed1cd5..d700497 100644 --- a/test/Transforms/InstCombine/signext.ll +++ b/test/Transforms/InstCombine/signext.ll @@ -7,7 +7,7 @@ define i32 @test1(i32 %x) { %tmp.2 = xor i32 %tmp.1, -32768 ; <i32> [#uses=1] %tmp.3 = add i32 %tmp.2, 32768 ; <i32> [#uses=1] ret i32 %tmp.3 -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK: %sext = shl i32 %x, 16 ; CHECK: %tmp.3 = ashr exact i32 %sext, 16 ; CHECK: ret i32 %tmp.3 @@ -18,7 +18,7 @@ define i32 @test2(i32 %x) { %tmp.2 = xor i32 %tmp.1, 32768 ; <i32> [#uses=1] %tmp.3 = add i32 %tmp.2, -32768 ; <i32> [#uses=1] ret i32 %tmp.3 -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK: %sext = shl i32 %x, 16 ; CHECK: %tmp.3 = ashr exact i32 %sext, 16 ; CHECK: ret i32 %tmp.3 @@ -29,7 +29,7 @@ define i32 @test3(i16 %P) { %tmp.4 = xor i32 %tmp.1, 32768 ; <i32> [#uses=1] %tmp.5 = add i32 %tmp.4, -32768 ; <i32> [#uses=1] ret i32 %tmp.5 -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK: %tmp.5 = sext i16 %P to i32 ; CHECK: ret i32 %tmp.5 } @@ -39,7 +39,7 @@ define i32 @test4(i16 %P) { %tmp.4 = xor i32 %tmp.1, 32768 ; <i32> [#uses=1] %tmp.5 = add i32 %tmp.4, -32768 ; <i32> [#uses=1] ret i32 %tmp.5 -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK: %tmp.5 = sext i16 %P to i32 ; CHECK: ret i32 %tmp.5 } @@ -49,7 +49,7 @@ define i32 @test5(i32 %x) { %tmp.2 = xor i32 %tmp.1, 128 ; <i32> [#uses=1] %tmp.3 = add i32 %tmp.2, -128 ; <i32> [#uses=1] ret i32 %tmp.3 -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK: %sext = shl i32 %x, 24 ; CHECK: %tmp.3 = ashr exact i32 %sext, 24 ; CHECK: ret i32 %tmp.3 @@ -59,7 +59,7 @@ define i32 @test6(i32 %x) { %tmp.2 = shl i32 %x, 16 ; <i32> [#uses=1] %tmp.4 = ashr i32 %tmp.2, 16 ; <i32> [#uses=1] ret i32 %tmp.4 -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK: %tmp.2 = shl i32 %x, 16 ; CHECK: %tmp.4 = ashr exact i32 %tmp.2, 16 ; CHECK: ret i32 %tmp.4 @@ -70,7 +70,7 @@ define i32 @test7(i16 %P) { %sext1 = shl i32 %tmp.1, 16 ; <i32> [#uses=1] %tmp.5 = ashr i32 %sext1, 16 ; <i32> [#uses=1] ret i32 %tmp.5 -; CHECK: @test7 +; CHECK-LABEL: @test7( ; CHECK: %tmp.5 = sext i16 %P to i32 ; CHECK: ret i32 %tmp.5 } @@ -81,7 +81,7 @@ entry: %xor = xor i32 %shr, 67108864 ; <i32> [#uses=1] %sub = add i32 %xor, -67108864 ; <i32> [#uses=1] ret i32 %sub -; CHECK: @test8 +; CHECK-LABEL: @test8( ; CHECK: %sub = ashr i32 %x, 5 ; CHECK: ret i32 %sub } diff --git a/test/Transforms/InstCombine/simplify-libcalls.ll b/test/Transforms/InstCombine/simplify-libcalls.ll index 4f3a506..fae3e6e 100644 --- a/test/Transforms/InstCombine/simplify-libcalls.ll +++ b/test/Transforms/InstCombine/simplify-libcalls.ll @@ -18,7 +18,7 @@ define i8* @test1() { %tmp3 = tail call i8* @strchr( i8* getelementptr ([5 x i8]* @str, i32 0, i32 2), i32 103 ) ; <i8*> [#uses=1] ret i8* %tmp3 -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK: ret i8* getelementptr inbounds ([5 x i8]* @str, i32 0, i64 3) } @@ -28,7 +28,7 @@ define i8* @test2() { %tmp3 = tail call i8* @strchr( i8* getelementptr ([8 x i8]* @str1, i32 0, i32 2), i32 0 ) ; <i8*> [#uses=1] ret i8* %tmp3 -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK: ret i8* getelementptr inbounds ([8 x i8]* @str1, i32 0, i64 7) } @@ -37,7 +37,7 @@ entry: %tmp3 = tail call i8* @strchr( i8* getelementptr ([5 x i8]* @str2, i32 0, i32 1), i32 80 ) ; <i8*> [#uses=1] ret i8* %tmp3 -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK: ret i8* null } @@ -52,7 +52,7 @@ entry: %tmp6 = icmp eq i32 %tmp5, 0 ; <i1> [#uses=1] ret i1 %tmp6 -; CHECK: @PR2341 +; CHECK-LABEL: @PR2341( ; CHECK: i32 } @@ -65,7 +65,7 @@ entry: %call = call i32 @memcmp(i8* %c0, i8* %c2, i32 1) ; <i32> [#uses=1] ret i32 %call -; CHECK: @PR4284 +; CHECK-LABEL: @PR4284( ; CHECK: ret i32 -65 } @@ -124,9 +124,21 @@ define i32 @MemCpy() { call void @llvm.memcpy.p0i8.p0i8.i32(i8* %target_p, i8* %hello_u_p, i32 8, i32 8, i1 false) ret i32 0 -; CHECK: @MemCpy +; CHECK-LABEL: @MemCpy( ; CHECK-NOT: llvm.memcpy ; CHECK: ret i32 0 } declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind + +declare i32 @strcmp(i8*, i8*) #0 + +define void @test9(i8* %x) { +; CHECK-LABEL: @test9( +; CHECK-NOT: strcmp + %y = call i32 @strcmp(i8* %x, i8* %x) #1 + ret void +} + +attributes #0 = { nobuiltin } +attributes #1 = { builtin } diff --git a/test/Transforms/InstCombine/sink_instruction.ll b/test/Transforms/InstCombine/sink_instruction.ll index 5c4019a..1bbd6b7 100644 --- a/test/Transforms/InstCombine/sink_instruction.ll +++ b/test/Transforms/InstCombine/sink_instruction.ll @@ -4,7 +4,7 @@ ;; arm of the 'if'. define i32 @test1(i1 %C, i32 %A, i32 %B) { -; CHECK: @test1 +; CHECK-LABEL: @test1( entry: %tmp.2 = sdiv i32 %A, %B ; <i32> [#uses=1] %tmp.9 = add i32 %B, %A ; <i32> [#uses=1] @@ -22,7 +22,7 @@ endif: ; preds = %entry ;; PHI use, sink divide before call. define i32 @test2(i32 %x) nounwind ssp { -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK-NOT: sdiv i32 entry: br label %bb diff --git a/test/Transforms/InstCombine/sprintf-1.ll b/test/Transforms/InstCombine/sprintf-1.ll index 9b8c8b1..6d0ab13 100644 --- a/test/Transforms/InstCombine/sprintf-1.ll +++ b/test/Transforms/InstCombine/sprintf-1.ll @@ -19,7 +19,7 @@ declare i32 @sprintf(i8*, i8*, ...) ; Check sprintf(dst, fmt) -> llvm.memcpy(str, fmt, strlen(fmt) + 1, 1). define void @test_simplify1(i8* %dst) { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %fmt = getelementptr [13 x i8]* @hello_world, i32 0, i32 0 call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* %fmt) ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* getelementptr inbounds ([13 x i8]* @hello_world, i32 0, i32 0), i32 13, i32 1, i1 false) @@ -28,7 +28,7 @@ define void @test_simplify1(i8* %dst) { } define void @test_simplify2(i8* %dst) { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( %fmt = getelementptr [1 x i8]* @null, i32 0, i32 0 call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* %fmt) ; CHECK-NEXT: store i8 0, i8* %dst, align 1 @@ -37,7 +37,7 @@ define void @test_simplify2(i8* %dst) { } define void @test_simplify3(i8* %dst) { -; CHECK: @test_simplify3 +; CHECK-LABEL: @test_simplify3( %fmt = getelementptr [7 x i8]* @null_hello, i32 0, i32 0 call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* %fmt) ; CHECK-NEXT: store i8 0, i8* %dst, align 1 @@ -48,7 +48,7 @@ define void @test_simplify3(i8* %dst) { ; Check sprintf(dst, "%c", chr) -> *(i8*)dst = chr; *((i8*)dst + 1) = 0. define void @test_simplify4(i8* %dst) { -; CHECK: @test_simplify4 +; CHECK-LABEL: @test_simplify4( %fmt = getelementptr [3 x i8]* @percent_c, i32 0, i32 0 call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* %fmt, i8 104) ; CHECK-NEXT: store i8 104, i8* %dst, align 1 @@ -61,7 +61,7 @@ define void @test_simplify4(i8* %dst) { ; Check sprintf(dst, "%s", str) -> llvm.memcpy(dest, str, strlen(str) + 1, 1). define void @test_simplify5(i8* %dst, i8* %str) { -; CHECK: @test_simplify5 +; CHECK-LABEL: @test_simplify5( %fmt = getelementptr [3 x i8]* @percent_s, i32 0, i32 0 call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* %fmt, i8* %str) ; CHECK-NEXT: [[STRLEN:%[a-z0-9]+]] = call i32 @strlen(i8* %str) @@ -74,7 +74,7 @@ define void @test_simplify5(i8* %dst, i8* %str) { ; Check sprintf(dst, format, ...) -> siprintf(str, format, ...) if no floating. define void @test_simplify6(i8* %dst) { -; CHECK-IPRINTF: @test_simplify6 +; CHECK-IPRINTF-LABEL: @test_simplify6( %fmt = getelementptr [3 x i8]* @percent_d, i32 0, i32 0 call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* %fmt, i32 187) ; CHECK-NEXT-IPRINTF: call i32 (i8*, i8*, ...)* @siprintf(i8* %dst, i8* getelementptr inbounds ([3 x i8]* @percent_d, i32 0, i32 0), i32 187) @@ -83,7 +83,7 @@ define void @test_simplify6(i8* %dst) { } define void @test_no_simplify1(i8* %dst) { -; CHECK-IPRINTF: @test_no_simplify1 +; CHECK-IPRINTF-LABEL: @test_no_simplify1( %fmt = getelementptr [3 x i8]* @percent_f, i32 0, i32 0 call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* %fmt, double 1.87) ; CHECK-NEXT-IPRINTF: call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* getelementptr inbounds ([3 x i8]* @percent_f, i32 0, i32 0), double 1.870000e+00) @@ -92,7 +92,7 @@ define void @test_no_simplify1(i8* %dst) { } define void @test_no_simplify2(i8* %dst, i8* %fmt, double %d) { -; CHECK: @test_no_simplify2 +; CHECK-LABEL: @test_no_simplify2( call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* %fmt, double %d) ; CHECK-NEXT: call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* %fmt, double %d) ret void diff --git a/test/Transforms/InstCombine/sqrt.ll b/test/Transforms/InstCombine/sqrt.ll index 440b974..650b10c 100644 --- a/test/Transforms/InstCombine/sqrt.ll +++ b/test/Transforms/InstCombine/sqrt.ll @@ -2,7 +2,7 @@ define float @test1(float %x) nounwind readnone ssp { entry: -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK-NOT: fpext ; CHECK-NOT: sqrt( ; CHECK: sqrtf( @@ -17,7 +17,7 @@ entry: ; PR8096 define float @test2(float %x) nounwind readnone ssp { entry: -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK-NOT: fpext ; CHECK-NOT: sqrt( ; CHECK: sqrtf( @@ -34,7 +34,7 @@ entry: ; use of sqrt result. define float @test3(float* %v) nounwind uwtable ssp { entry: -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK: sqrt( ; CHECK-NOT: sqrtf( ; CHECK: fptrunc diff --git a/test/Transforms/InstCombine/store.ll b/test/Transforms/InstCombine/store.ll index 164ba76..9b666b9 100644 --- a/test/Transforms/InstCombine/store.ll +++ b/test/Transforms/InstCombine/store.ll @@ -5,7 +5,7 @@ define void @test1(i32* %P) { store i32 123, i32* undef store i32 124, i32* null ret void -; CHECK: @test1( +; CHECK-LABEL: @test1( ; CHECK-NEXT: store i32 123, i32* undef ; CHECK-NEXT: store i32 undef, i32* null ; CHECK-NEXT: ret void @@ -16,7 +16,7 @@ define void @test2(i32* %P) { %Y = add i32 %X, 0 ; <i32> [#uses=1] store i32 %Y, i32* %P ret void -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK-NEXT: ret void } @@ -38,7 +38,7 @@ Cond2: Cont: %V = load i32* %A ret i32 %V -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK-NOT: alloca ; CHECK: Cont: ; CHECK-NEXT: %storemerge = phi i32 [ 47, %Cond2 ], [ -987654321, %Cond ] @@ -58,7 +58,7 @@ Cond: Cont: %V = load i32* %A ret i32 %V -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK-NOT: alloca ; CHECK: Cont: ; CHECK-NEXT: %storemerge = phi i32 [ -987654321, %Cond ], [ 47, %0 ] @@ -76,7 +76,7 @@ Cond: Cont: ret void -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK: Cont: ; CHECK-NEXT: %storemerge = phi i32 ; CHECK-NEXT: store i32 %storemerge, i32* %P, align 1 @@ -107,7 +107,7 @@ for.body: ; preds = %for.cond for.end: ; preds = %for.cond ret void -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK: for.cond: ; CHECK-NEXT: phi i32 [ 42 ; CHECK-NEXT: store i32 %storemerge, i32* %gi, align 4, !tbaa !0 diff --git a/test/Transforms/InstCombine/stpcpy-1.ll b/test/Transforms/InstCombine/stpcpy-1.ll index 8b6bb0e..b918c9e 100644 --- a/test/Transforms/InstCombine/stpcpy-1.ll +++ b/test/Transforms/InstCombine/stpcpy-1.ll @@ -12,7 +12,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 declare i8* @stpcpy(i8*, i8*) define i8* @test_simplify1() { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 %src = getelementptr [6 x i8]* @hello, i32 0, i32 0 @@ -24,7 +24,7 @@ define i8* @test_simplify1() { } define i8* @test_simplify2() { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 @@ -35,7 +35,7 @@ define i8* @test_simplify2() { } define i8* @test_no_simplify1() { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 %src = getelementptr [32 x i8]* @b, i32 0, i32 0 diff --git a/test/Transforms/InstCombine/stpcpy-2.ll b/test/Transforms/InstCombine/stpcpy-2.ll index 2e92c08..6a0f753 100644 --- a/test/Transforms/InstCombine/stpcpy-2.ll +++ b/test/Transforms/InstCombine/stpcpy-2.ll @@ -11,7 +11,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 declare i16* @stpcpy(i8*, i8*) define void @test_no_simplify1() { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 %src = getelementptr [6 x i8]* @hello, i32 0, i32 0 diff --git a/test/Transforms/InstCombine/stpcpy_chk-1.ll b/test/Transforms/InstCombine/stpcpy_chk-1.ll index 0560391..a6d5585 100644 --- a/test/Transforms/InstCombine/stpcpy_chk-1.ll +++ b/test/Transforms/InstCombine/stpcpy_chk-1.ll @@ -12,7 +12,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 ; Check cases where slen >= strlen (src). define void @test_simplify1() { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 %src = getelementptr inbounds [12 x i8]* @.str, i32 0, i32 0 @@ -22,7 +22,7 @@ define void @test_simplify1() { } define void @test_simplify2() { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 %src = getelementptr inbounds [12 x i8]* @.str, i32 0, i32 0 @@ -32,7 +32,7 @@ define void @test_simplify2() { } define void @test_simplify3() { -; CHECK: @test_simplify3 +; CHECK-LABEL: @test_simplify3( %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 %src = getelementptr inbounds [12 x i8]* @.str, i32 0, i32 0 @@ -44,7 +44,7 @@ define void @test_simplify3() { ; Check cases where there are no string constants. define void @test_simplify4() { -; CHECK: @test_simplify4 +; CHECK-LABEL: @test_simplify4( %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 %src = getelementptr inbounds [60 x i8]* @b, i32 0, i32 0 @@ -56,7 +56,7 @@ define void @test_simplify4() { ; Check case where the string length is not constant. define i8* @test_simplify5() { -; CHECK: @test_simplify5 +; CHECK-LABEL: @test_simplify5( %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 %src = getelementptr inbounds [12 x i8]* @.str, i32 0, i32 0 @@ -70,7 +70,7 @@ define i8* @test_simplify5() { ; Check case where the source and destination are the same. define i8* @test_simplify6() { -; CHECK: @test_simplify6 +; CHECK-LABEL: @test_simplify6( %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 ; CHECK: [[LEN:%[a-z]+]] = call i32 @strlen @@ -83,7 +83,7 @@ define i8* @test_simplify6() { ; Check case where slen < strlen (src). define void @test_no_simplify1() { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 %src = getelementptr inbounds [60 x i8]* @b, i32 0, i32 0 diff --git a/test/Transforms/InstCombine/stpcpy_chk-2.ll b/test/Transforms/InstCombine/stpcpy_chk-2.ll index 46c2139..b503da9 100644 --- a/test/Transforms/InstCombine/stpcpy_chk-2.ll +++ b/test/Transforms/InstCombine/stpcpy_chk-2.ll @@ -9,7 +9,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 @.str = private constant [8 x i8] c"abcdefg\00" define void @test_no_simplify() { -; CHECK: @test_no_simplify +; CHECK-LABEL: @test_no_simplify( %dst = getelementptr inbounds [60 x i16]* @a, i32 0, i32 0 %src = getelementptr inbounds [8 x i8]* @.str, i32 0, i32 0 diff --git a/test/Transforms/InstCombine/strcat-1.ll b/test/Transforms/InstCombine/strcat-1.ll index 3c05d6b..131ad48 100644 --- a/test/Transforms/InstCombine/strcat-1.ll +++ b/test/Transforms/InstCombine/strcat-1.ll @@ -13,7 +13,7 @@ declare i8* @strcat(i8*, i8*) declare i32 @puts(i8*) define i32 @main() { -; CHECK: @main +; CHECK-LABEL: @main( ; CHECK-NOT: call i8* @strcat ; CHECK: call i32 @puts diff --git a/test/Transforms/InstCombine/strcat-2.ll b/test/Transforms/InstCombine/strcat-2.ll index 379ee74..48f8267 100644 --- a/test/Transforms/InstCombine/strcat-2.ll +++ b/test/Transforms/InstCombine/strcat-2.ll @@ -11,7 +11,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 declare i8* @strcat(i8*, i8*) define void @test_simplify1() { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( ; CHECK-NOT: call i8* @strcat ; CHECK: ret void @@ -22,7 +22,7 @@ define void @test_simplify1() { } define void @test_simplify2() { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( ; CHECK-NEXT: ret void %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 diff --git a/test/Transforms/InstCombine/strcat-3.ll b/test/Transforms/InstCombine/strcat-3.ll index 15aff2f..e3396df 100644 --- a/test/Transforms/InstCombine/strcat-3.ll +++ b/test/Transforms/InstCombine/strcat-3.ll @@ -11,7 +11,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 declare i16* @strcat(i8*, i8*) define void @test_nosimplify1() { -; CHECK: @test_nosimplify1 +; CHECK-LABEL: @test_nosimplify1( ; CHECK: call i16* @strcat ; CHECK: ret void diff --git a/test/Transforms/InstCombine/strcmp-1.ll b/test/Transforms/InstCombine/strcmp-1.ll index 0679246..fc58ffc 100644 --- a/test/Transforms/InstCombine/strcmp-1.ll +++ b/test/Transforms/InstCombine/strcmp-1.ll @@ -12,7 +12,7 @@ declare i32 @strcmp(i8*, i8*) ; strcmp("", x) -> -*x define i32 @test1(i8* %str2) { -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK: %strcmpload = load i8* %str ; CHECK: %1 = zext i8 %strcmpload to i32 ; CHECK: %2 = sub i32 0, %1 @@ -26,7 +26,7 @@ define i32 @test1(i8* %str2) { ; strcmp(x, "") -> *x define i32 @test2(i8* %str1) { -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK: %strcmpload = load i8* %str ; CHECK: %1 = zext i8 %strcmpload to i32 ; CHECK: ret i32 %1 @@ -38,7 +38,7 @@ define i32 @test2(i8* %str1) { ; strcmp(x, y) -> cnst define i32 @test3() { -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK: ret i32 -1 %str1 = getelementptr inbounds [5 x i8]* @hell, i32 0, i32 0 @@ -48,7 +48,7 @@ define i32 @test3() { } define i32 @test4() { -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK: ret i32 1 %str1 = getelementptr inbounds [5 x i8]* @hell, i32 0, i32 0 @@ -60,7 +60,7 @@ define i32 @test4() { ; strcmp(x, y) -> memcmp(x, y, <known length>) ; (This transform is rather difficult to trigger in a useful manner) define i32 @test5(i1 %b) { -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK: %memcmp = call i32 @memcmp(i8* getelementptr inbounds ([6 x i8]* @hello, i32 0, i32 0), i8* %str2, i32 5) ; CHECK: ret i32 %memcmp @@ -74,7 +74,7 @@ define i32 @test5(i1 %b) { ; strcmp(x,x) -> 0 define i32 @test6(i8* %str) { -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK: ret i32 0 %temp1 = call i32 @strcmp(i8* %str, i8* %str) diff --git a/test/Transforms/InstCombine/strcmp-2.ll b/test/Transforms/InstCombine/strcmp-2.ll index 2051896..f0ef516 100644 --- a/test/Transforms/InstCombine/strcmp-2.ll +++ b/test/Transforms/InstCombine/strcmp-2.ll @@ -9,7 +9,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 declare i16 @strcmp(i8*, i8*) define i16 @test_nosimplify() { -; CHECK: @test_nosimplify +; CHECK-LABEL: @test_nosimplify( ; CHECK: call i16 @strcmp ; CHECK: ret i16 %temp1 diff --git a/test/Transforms/InstCombine/strcpy-1.ll b/test/Transforms/InstCombine/strcpy-1.ll index b6cf048..7c253f6 100644 --- a/test/Transforms/InstCombine/strcpy-1.ll +++ b/test/Transforms/InstCombine/strcpy-1.ll @@ -13,7 +13,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 declare i8* @strcpy(i8*, i8*) define void @test_simplify1() { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 %src = getelementptr [6 x i8]* @hello, i32 0, i32 0 @@ -24,7 +24,7 @@ define void @test_simplify1() { } define i8* @test_simplify2() { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 @@ -34,7 +34,7 @@ define i8* @test_simplify2() { } define i8* @test_no_simplify1() { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 %src = getelementptr [32 x i8]* @b, i32 0, i32 0 diff --git a/test/Transforms/InstCombine/strcpy-2.ll b/test/Transforms/InstCombine/strcpy-2.ll index 779e9fd..bad392d 100644 --- a/test/Transforms/InstCombine/strcpy-2.ll +++ b/test/Transforms/InstCombine/strcpy-2.ll @@ -11,7 +11,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 declare i16* @strcpy(i8*, i8*) define void @test_no_simplify1() { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 %src = getelementptr [6 x i8]* @hello, i32 0, i32 0 diff --git a/test/Transforms/InstCombine/strcpy_chk-1.ll b/test/Transforms/InstCombine/strcpy_chk-1.ll index 3e48f4f..5b98cf8 100644 --- a/test/Transforms/InstCombine/strcpy_chk-1.ll +++ b/test/Transforms/InstCombine/strcpy_chk-1.ll @@ -12,7 +12,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 ; Check cases where slen >= strlen (src). define void @test_simplify1() { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 %src = getelementptr inbounds [12 x i8]* @.str, i32 0, i32 0 @@ -22,7 +22,7 @@ define void @test_simplify1() { } define void @test_simplify2() { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 %src = getelementptr inbounds [12 x i8]* @.str, i32 0, i32 0 @@ -32,7 +32,7 @@ define void @test_simplify2() { } define void @test_simplify3() { -; CHECK: @test_simplify3 +; CHECK-LABEL: @test_simplify3( %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 %src = getelementptr inbounds [12 x i8]* @.str, i32 0, i32 0 @@ -44,7 +44,7 @@ define void @test_simplify3() { ; Check cases where there are no string constants. define void @test_simplify4() { -; CHECK: @test_simplify4 +; CHECK-LABEL: @test_simplify4( %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 %src = getelementptr inbounds [60 x i8]* @b, i32 0, i32 0 @@ -56,7 +56,7 @@ define void @test_simplify4() { ; Check case where the string length is not constant. define void @test_simplify5() { -; CHECK: @test_simplify5 +; CHECK-LABEL: @test_simplify5( %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 %src = getelementptr inbounds [12 x i8]* @.str, i32 0, i32 0 @@ -69,7 +69,7 @@ define void @test_simplify5() { ; Check case where the source and destination are the same. define i8* @test_simplify6() { -; CHECK: @test_simplify6 +; CHECK-LABEL: @test_simplify6( %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 ; CHECK: getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0) @@ -81,7 +81,7 @@ define i8* @test_simplify6() { ; Check case where slen < strlen (src). define void @test_no_simplify1() { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 %src = getelementptr inbounds [60 x i8]* @b, i32 0, i32 0 diff --git a/test/Transforms/InstCombine/strcpy_chk-2.ll b/test/Transforms/InstCombine/strcpy_chk-2.ll index d76ea5d..1eff5a8 100644 --- a/test/Transforms/InstCombine/strcpy_chk-2.ll +++ b/test/Transforms/InstCombine/strcpy_chk-2.ll @@ -9,7 +9,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 @.str = private constant [8 x i8] c"abcdefg\00" define void @test_no_simplify() { -; CHECK: @test_no_simplify +; CHECK-LABEL: @test_no_simplify( %dst = getelementptr inbounds [60 x i16]* @a, i32 0, i32 0 %src = getelementptr inbounds [8 x i8]* @.str, i32 0, i32 0 diff --git a/test/Transforms/InstCombine/strcpy_chk-64.ll b/test/Transforms/InstCombine/strcpy_chk-64.ll index 036fcbe..31447d9 100644 --- a/test/Transforms/InstCombine/strcpy_chk-64.ll +++ b/test/Transforms/InstCombine/strcpy_chk-64.ll @@ -3,7 +3,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 target triple = "x86_64-apple-darwin10.0.0" define void @func(i8* %i) nounwind ssp { -; CHECK: @func +; CHECK-LABEL: @func( ; CHECK: @__strcpy_chk(i8* %arraydecay, i8* %i, i64 32) entry: %s = alloca [32 x i8], align 16 diff --git a/test/Transforms/InstCombine/strcspn-1.ll b/test/Transforms/InstCombine/strcspn-1.ll index 60fad89..b3b52b5 100644 --- a/test/Transforms/InstCombine/strcspn-1.ll +++ b/test/Transforms/InstCombine/strcspn-1.ll @@ -13,7 +13,7 @@ declare i64 @strcspn(i8*, i8*) ; Check strcspn(s, "") -> strlen(s). define i64 @test_simplify1(i8* %str) { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %pat = getelementptr [1 x i8]* @null, i32 0, i32 0 %ret = call i64 @strcspn(i8* %str, i8* %pat) @@ -25,7 +25,7 @@ define i64 @test_simplify1(i8* %str) { ; Check strcspn("", s) -> 0. define i64 @test_simplify2(i8* %pat) { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( %str = getelementptr [1 x i8]* @null, i32 0, i32 0 %ret = call i64 @strcspn(i8* %str, i8* %pat) @@ -36,7 +36,7 @@ define i64 @test_simplify2(i8* %pat) { ; Check strcspn(s1, s2), where s1 and s2 are constants. define i64 @test_simplify3() { -; CHECK: @test_simplify3 +; CHECK-LABEL: @test_simplify3( %str = getelementptr [6 x i8]* @abcba, i32 0, i32 0 %pat = getelementptr [4 x i8]* @abc, i32 0, i32 0 @@ -48,7 +48,7 @@ define i64 @test_simplify3() { ; Check cases that shouldn't be simplified. define i64 @test_no_simplify1(i8* %str, i8* %pat) { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %ret = call i64 @strcspn(i8* %str, i8* %pat) ; CHECK-NEXT: %ret = call i64 @strcspn(i8* %str, i8* %pat) diff --git a/test/Transforms/InstCombine/strcspn-2.ll b/test/Transforms/InstCombine/strcspn-2.ll index 4e23936..ecfa27d 100644 --- a/test/Transforms/InstCombine/strcspn-2.ll +++ b/test/Transforms/InstCombine/strcspn-2.ll @@ -11,7 +11,7 @@ declare double @strcspn(i8*, i8*) ; Check that strcspn functions with the wrong prototype aren't simplified. define double @test_no_simplify1(i8* %pat) { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %str = getelementptr [1 x i8]* @null, i32 0, i32 0 %ret = call double @strcspn(i8* %str, i8* %pat) diff --git a/test/Transforms/InstCombine/strlen-1.ll b/test/Transforms/InstCombine/strlen-1.ll index 6d7464a..4fa5b4f 100644 --- a/test/Transforms/InstCombine/strlen-1.ll +++ b/test/Transforms/InstCombine/strlen-1.ll @@ -15,7 +15,7 @@ declare i32 @strlen(i8*) ; Check strlen(string constant) -> integer constant. define i32 @test_simplify1() { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %hello_p = getelementptr [6 x i8]* @hello, i32 0, i32 0 %hello_l = call i32 @strlen(i8* %hello_p) ret i32 %hello_l @@ -23,7 +23,7 @@ define i32 @test_simplify1() { } define i32 @test_simplify2() { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( %null_p = getelementptr [1 x i8]* @null, i32 0, i32 0 %null_l = call i32 @strlen(i8* %null_p) ret i32 %null_l @@ -31,7 +31,7 @@ define i32 @test_simplify2() { } define i32 @test_simplify3() { -; CHECK: @test_simplify3 +; CHECK-LABEL: @test_simplify3( %null_hello_p = getelementptr [7 x i8]* @null_hello, i32 0, i32 0 %null_hello_l = call i32 @strlen(i8* %null_hello_p) ret i32 %null_hello_l @@ -39,7 +39,7 @@ define i32 @test_simplify3() { } define i32 @test_simplify4() { -; CHECK: @test_simplify4 +; CHECK-LABEL: @test_simplify4( %len = tail call i32 @strlen(i8* @nullstring) nounwind ret i32 %len ; CHECK-NEXT: ret i32 0 @@ -48,7 +48,7 @@ define i32 @test_simplify4() { ; Check strlen(x) == 0 --> *x == 0. define i1 @test_simplify5() { -; CHECK: @test_simplify5 +; CHECK-LABEL: @test_simplify5( %hello_p = getelementptr [6 x i8]* @hello, i32 0, i32 0 %hello_l = call i32 @strlen(i8* %hello_p) %eq_hello = icmp eq i32 %hello_l, 0 @@ -57,7 +57,7 @@ define i1 @test_simplify5() { } define i1 @test_simplify6() { -; CHECK: @test_simplify6 +; CHECK-LABEL: @test_simplify6( %null_p = getelementptr [1 x i8]* @null, i32 0, i32 0 %null_l = call i32 @strlen(i8* %null_p) %eq_null = icmp eq i32 %null_l, 0 @@ -68,7 +68,7 @@ define i1 @test_simplify6() { ; Check strlen(x) != 0 --> *x != 0. define i1 @test_simplify7() { -; CHECK: @test_simplify7 +; CHECK-LABEL: @test_simplify7( %hello_p = getelementptr [6 x i8]* @hello, i32 0, i32 0 %hello_l = call i32 @strlen(i8* %hello_p) %ne_hello = icmp ne i32 %hello_l, 0 @@ -77,7 +77,7 @@ define i1 @test_simplify7() { } define i1 @test_simplify8() { -; CHECK: @test_simplify8 +; CHECK-LABEL: @test_simplify8( %null_p = getelementptr [1 x i8]* @null, i32 0, i32 0 %null_l = call i32 @strlen(i8* %null_p) %ne_null = icmp ne i32 %null_l, 0 @@ -88,7 +88,7 @@ define i1 @test_simplify8() { ; Check cases that shouldn't be simplified. define i32 @test_no_simplify1() { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %a_p = getelementptr [32 x i8]* @a, i32 0, i32 0 %a_l = call i32 @strlen(i8* %a_p) ; CHECK-NEXT: %a_l = call i32 @strlen diff --git a/test/Transforms/InstCombine/strlen-2.ll b/test/Transforms/InstCombine/strlen-2.ll index c4fd54c..6652a31 100644 --- a/test/Transforms/InstCombine/strlen-2.ll +++ b/test/Transforms/InstCombine/strlen-2.ll @@ -9,7 +9,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 declare i32 @strlen(i8*, i32) define i32 @test_no_simplify1() { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %hello_p = getelementptr [6 x i8]* @hello, i32 0, i32 0 %hello_l = call i32 @strlen(i8* %hello_p, i32 187) ; CHECK-NEXT: %hello_l = call i32 @strlen diff --git a/test/Transforms/InstCombine/strncat-1.ll b/test/Transforms/InstCombine/strncat-1.ll index ad2a18b..8eae3da 100644 --- a/test/Transforms/InstCombine/strncat-1.ll +++ b/test/Transforms/InstCombine/strncat-1.ll @@ -12,7 +12,7 @@ declare i8* @strncat(i8*, i8*, i32) declare i32 @puts(i8*) define i32 @main() { -; CHECK: @main +; CHECK-LABEL: @main( ; CHECK-NOT: call i8* @strncat ; CHECK: call i32 @puts diff --git a/test/Transforms/InstCombine/strncat-2.ll b/test/Transforms/InstCombine/strncat-2.ll index c56deac..b09fa12 100644 --- a/test/Transforms/InstCombine/strncat-2.ll +++ b/test/Transforms/InstCombine/strncat-2.ll @@ -11,7 +11,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 declare i8* @strncat(i8*, i8*, i32) define void @test_simplify1() { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( ; CHECK-NOT: call i8* @strncat ; CHECK: ret void @@ -22,7 +22,7 @@ define void @test_simplify1() { } define void @test_simplify2() { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( ; CHECK-NEXT: ret void %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 @@ -32,7 +32,7 @@ define void @test_simplify2() { } define void @test_simplify3() { -; CHECK: @test_simplify3 +; CHECK-LABEL: @test_simplify3( ; CHECK-NEXT: ret void %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 @@ -42,7 +42,7 @@ define void @test_simplify3() { } define void @test_nosimplify1() { -; CHECK: @test_nosimplify1 +; CHECK-LABEL: @test_nosimplify1( ; CHECK: call i8* @strncat ; CHECK: ret void diff --git a/test/Transforms/InstCombine/strncat-3.ll b/test/Transforms/InstCombine/strncat-3.ll index 3cd7971..1b25b4a 100644 --- a/test/Transforms/InstCombine/strncat-3.ll +++ b/test/Transforms/InstCombine/strncat-3.ll @@ -11,7 +11,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 declare i16* @strncat(i8*, i8*, i32) define void @test_nosimplify1() { -; CHECK: @test_nosimplify1 +; CHECK-LABEL: @test_nosimplify1( ; CHECK: call i16* @strncat ; CHECK: ret void diff --git a/test/Transforms/InstCombine/strncmp-1.ll b/test/Transforms/InstCombine/strncmp-1.ll index 187c2fa..df30dd1 100644 --- a/test/Transforms/InstCombine/strncmp-1.ll +++ b/test/Transforms/InstCombine/strncmp-1.ll @@ -12,7 +12,7 @@ declare i32 @strncmp(i8*, i8*, i32) ; strncmp("", x, n) -> -*x define i32 @test1(i8* %str2) { -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK: %strcmpload = load i8* %str ; CHECK: %1 = zext i8 %strcmpload to i32 ; CHECK: %2 = sub i32 0, %1 @@ -25,7 +25,7 @@ define i32 @test1(i8* %str2) { ; strncmp(x, "", n) -> *x define i32 @test2(i8* %str1) { -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK: %strcmpload = load i8* %str1 ; CHECK: %1 = zext i8 %strcmpload to i32 ; CHECK: ret i32 %1 @@ -37,7 +37,7 @@ define i32 @test2(i8* %str1) { ; strncmp(x, y, n) -> cnst define i32 @test3() { -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK: ret i32 -1 %str1 = getelementptr inbounds [5 x i8]* @hell, i32 0, i32 0 @@ -47,7 +47,7 @@ define i32 @test3() { } define i32 @test4() { -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK: ret i32 1 %str1 = getelementptr inbounds [5 x i8]* @hell, i32 0, i32 0 @@ -57,7 +57,7 @@ define i32 @test4() { } define i32 @test5() { -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK: ret i32 0 %str1 = getelementptr inbounds [5 x i8]* @hell, i32 0, i32 0 @@ -68,7 +68,7 @@ define i32 @test5() { ; strncmp(x,y,1) -> memcmp(x,y,1) define i32 @test6(i8* %str1, i8* %str2) { -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK: [[LOAD1:%[a-z]+]] = load i8* %str1, align 1 ; CHECK: [[ZEXT1:%[a-z]+]] = zext i8 [[LOAD1]] to i32 ; CHECK: [[LOAD2:%[a-z]+]] = load i8* %str2, align 1 @@ -82,7 +82,7 @@ define i32 @test6(i8* %str1, i8* %str2) { ; strncmp(x,y,0) -> 0 define i32 @test7(i8* %str1, i8* %str2) { -; CHECK: @test7 +; CHECK-LABEL: @test7( ; CHECK: ret i32 0 %temp1 = call i32 @strncmp(i8* %str1, i8* %str2, i32 0) @@ -91,7 +91,7 @@ define i32 @test7(i8* %str1, i8* %str2) { ; strncmp(x,x,n) -> 0 define i32 @test8(i8* %str, i32 %n) { -; CHECK: @test8 +; CHECK-LABEL: @test8( ; CHECK: ret i32 0 %temp1 = call i32 @strncmp(i8* %str, i8* %str, i32 %n) diff --git a/test/Transforms/InstCombine/strncmp-2.ll b/test/Transforms/InstCombine/strncmp-2.ll index 3fc43a6..16ad8a4 100644 --- a/test/Transforms/InstCombine/strncmp-2.ll +++ b/test/Transforms/InstCombine/strncmp-2.ll @@ -9,7 +9,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 declare i16 @strncmp(i8*, i8*, i32) define i16 @test_nosimplify() { -; CHECK: @test_nosimplify +; CHECK-LABEL: @test_nosimplify( ; CHECK: call i16 @strncmp ; CHECK: ret i16 %temp1 diff --git a/test/Transforms/InstCombine/strncpy-1.ll b/test/Transforms/InstCombine/strncpy-1.ll index 3ce2b9b..c70197f 100644 --- a/test/Transforms/InstCombine/strncpy-1.ll +++ b/test/Transforms/InstCombine/strncpy-1.ll @@ -16,7 +16,7 @@ declare i32 @puts(i8*) ; Check a bunch of strncpy invocations together. define i32 @test_simplify1() { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( ; CHECK-NOT: call i8* @strncpy ; CHECK: call i32 @puts %target = alloca [1024 x i8] @@ -39,7 +39,7 @@ define i32 @test_simplify1() { ; Check strncpy(x, "", y) -> memset(x, '\0', y, 1). define void @test_simplify2() { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 %src = getelementptr [1 x i8]* @null, i32 0, i32 0 @@ -51,7 +51,7 @@ define void @test_simplify2() { ; Check strncpy(x, y, 0) -> x. define i8* @test_simplify3() { -; CHECK: @test_simplify3 +; CHECK-LABEL: @test_simplify3( %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 %src = getelementptr [6 x i8]* @hello, i32 0, i32 0 @@ -63,7 +63,7 @@ define i8* @test_simplify3() { ; Check strncpy(x, s, c) -> memcpy(x, s, c, 1) [s and c are constant]. define void @test_simplify4() { -; CHECK: @test_simplify4 +; CHECK-LABEL: @test_simplify4( %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 %src = getelementptr [6 x i8]* @hello, i32 0, i32 0 @@ -75,7 +75,7 @@ define void @test_simplify4() { ; Check cases that shouldn't be simplified. define void @test_no_simplify1() { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 %src = getelementptr [32 x i8]* @b, i32 0, i32 0 @@ -85,7 +85,7 @@ define void @test_no_simplify1() { } define void @test_no_simplify2() { -; CHECK: @test_no_simplify2 +; CHECK-LABEL: @test_no_simplify2( %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 %src = getelementptr [6 x i8]* @hello, i32 0, i32 0 diff --git a/test/Transforms/InstCombine/strncpy-2.ll b/test/Transforms/InstCombine/strncpy-2.ll index ac28ea6..acc2878 100644 --- a/test/Transforms/InstCombine/strncpy-2.ll +++ b/test/Transforms/InstCombine/strncpy-2.ll @@ -12,7 +12,7 @@ declare i16* @strncpy(i8*, i8*, i32) ; Check that 'strncpy' functions with the wrong prototype aren't simplified. define void @test_no_simplify1() { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 %src = getelementptr [6 x i8]* @hello, i32 0, i32 0 diff --git a/test/Transforms/InstCombine/strncpy_chk-1.ll b/test/Transforms/InstCombine/strncpy_chk-1.ll index aadff42..90b4173 100644 --- a/test/Transforms/InstCombine/strncpy_chk-1.ll +++ b/test/Transforms/InstCombine/strncpy_chk-1.ll @@ -12,7 +12,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 ; Check cases where dstlen >= len define void @test_simplify1() { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 %src = getelementptr inbounds [12 x i8]* @.str, i32 0, i32 0 @@ -22,7 +22,7 @@ define void @test_simplify1() { } define void @test_simplify2() { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 %src = getelementptr inbounds [12 x i8]* @.str, i32 0, i32 0 @@ -32,7 +32,7 @@ define void @test_simplify2() { } define void @test_simplify3() { -; CHECK: @test_simplify3 +; CHECK-LABEL: @test_simplify3( %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 %src = getelementptr inbounds [60 x i8]* @b, i32 0, i32 0 @@ -44,7 +44,7 @@ define void @test_simplify3() { ; Check cases where dstlen < len define void @test_no_simplify1() { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 %src = getelementptr inbounds [12 x i8]* @.str, i32 0, i32 0 @@ -54,7 +54,7 @@ define void @test_no_simplify1() { } define void @test_no_simplify2() { -; CHECK: @test_no_simplify2 +; CHECK-LABEL: @test_no_simplify2( %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 %src = getelementptr inbounds [60 x i8]* @b, i32 0, i32 0 diff --git a/test/Transforms/InstCombine/strncpy_chk-2.ll b/test/Transforms/InstCombine/strncpy_chk-2.ll index a0f132e..829a479 100644 --- a/test/Transforms/InstCombine/strncpy_chk-2.ll +++ b/test/Transforms/InstCombine/strncpy_chk-2.ll @@ -9,7 +9,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 @b = common global [60 x i16] zeroinitializer, align 1 define void @test_no_simplify() { -; CHECK: @test_no_simplify +; CHECK-LABEL: @test_no_simplify( %dst = getelementptr inbounds [60 x i16]* @a, i32 0, i32 0 %src = getelementptr inbounds [60 x i16]* @b, i32 0, i32 0 diff --git a/test/Transforms/InstCombine/strpbrk-1.ll b/test/Transforms/InstCombine/strpbrk-1.ll index a5d0d86..58b2d9e 100644 --- a/test/Transforms/InstCombine/strpbrk-1.ll +++ b/test/Transforms/InstCombine/strpbrk-1.ll @@ -13,7 +13,7 @@ declare i8* @strpbrk(i8*, i8*) ; Check strpbrk(s, "") -> NULL. define i8* @test_simplify1(i8* %str) { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %pat = getelementptr [1 x i8]* @null, i32 0, i32 0 %ret = call i8* @strpbrk(i8* %str, i8* %pat) @@ -24,7 +24,7 @@ define i8* @test_simplify1(i8* %str) { ; Check strpbrk("", s) -> NULL. define i8* @test_simplify2(i8* %pat) { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( %str = getelementptr [1 x i8]* @null, i32 0, i32 0 %ret = call i8* @strpbrk(i8* %str, i8* %pat) @@ -35,7 +35,7 @@ define i8* @test_simplify2(i8* %pat) { ; Check strpbrk(s1, s2), where s1 and s2 are constants. define i8* @test_simplify3() { -; CHECK: @test_simplify3 +; CHECK-LABEL: @test_simplify3( %str = getelementptr [12 x i8]* @hello, i32 0, i32 0 %pat = getelementptr [2 x i8]* @w, i32 0, i32 0 @@ -47,7 +47,7 @@ define i8* @test_simplify3() { ; Check strpbrk(s, "a") -> strchr(s, 'a'). define i8* @test_simplify4(i8* %str) { -; CHECK: @test_simplify4 +; CHECK-LABEL: @test_simplify4( %pat = getelementptr [2 x i8]* @w, i32 0, i32 0 %ret = call i8* @strpbrk(i8* %str, i8* %pat) @@ -59,7 +59,7 @@ define i8* @test_simplify4(i8* %str) { ; Check cases that shouldn't be simplified. define i8* @test_no_simplify1(i8* %str, i8* %pat) { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %ret = call i8* @strpbrk(i8* %str, i8* %pat) ; CHECK-NEXT: %ret = call i8* @strpbrk(i8* %str, i8* %pat) diff --git a/test/Transforms/InstCombine/strpbrk-2.ll b/test/Transforms/InstCombine/strpbrk-2.ll index 31ac290..b797d7a 100644 --- a/test/Transforms/InstCombine/strpbrk-2.ll +++ b/test/Transforms/InstCombine/strpbrk-2.ll @@ -12,7 +12,7 @@ declare i16* @strpbrk(i8*, i8*) ; Check that 'strpbrk' functions with the wrong prototype aren't simplified. define i16* @test_no_simplify1() { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %str = getelementptr [12 x i8]* @hello, i32 0, i32 0 %pat = getelementptr [2 x i8]* @w, i32 0, i32 0 diff --git a/test/Transforms/InstCombine/strrchr-1.ll b/test/Transforms/InstCombine/strrchr-1.ll index 854ce45..a0bdb22 100644 --- a/test/Transforms/InstCombine/strrchr-1.ll +++ b/test/Transforms/InstCombine/strrchr-1.ll @@ -43,7 +43,7 @@ define void @test_simplify3() { } define void @test_nosimplify1(i32 %chr) { -; CHECK: @test_nosimplify1 +; CHECK-LABEL: @test_nosimplify1( ; CHECK: call i8* @strrchr ; CHECK: ret void diff --git a/test/Transforms/InstCombine/strspn-1.ll b/test/Transforms/InstCombine/strspn-1.ll index 393f887..ac940cc 100644 --- a/test/Transforms/InstCombine/strspn-1.ll +++ b/test/Transforms/InstCombine/strspn-1.ll @@ -13,7 +13,7 @@ declare i64 @strspn(i8*, i8*) ; Check strspn(s, "") -> 0. define i64 @test_simplify1(i8* %str) { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %pat = getelementptr [1 x i8]* @null, i32 0, i32 0 %ret = call i64 @strspn(i8* %str, i8* %pat) @@ -24,7 +24,7 @@ define i64 @test_simplify1(i8* %str) { ; Check strspn("", s) -> 0. define i64 @test_simplify2(i8* %pat) { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( %str = getelementptr [1 x i8]* @null, i32 0, i32 0 %ret = call i64 @strspn(i8* %str, i8* %pat) @@ -35,7 +35,7 @@ define i64 @test_simplify2(i8* %pat) { ; Check strspn(s1, s2), where s1 and s2 are constants. define i64 @test_simplify3() { -; CHECK: @test_simplify3 +; CHECK-LABEL: @test_simplify3( %str = getelementptr [6 x i8]* @abcba, i32 0, i32 0 %pat = getelementptr [4 x i8]* @abc, i32 0, i32 0 @@ -47,7 +47,7 @@ define i64 @test_simplify3() { ; Check cases that shouldn't be simplified. define i64 @test_no_simplify1(i8* %str, i8* %pat) { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %ret = call i64 @strspn(i8* %str, i8* %pat) ; CHECK-NEXT: %ret = call i64 @strspn(i8* %str, i8* %pat) diff --git a/test/Transforms/InstCombine/strstr-1.ll b/test/Transforms/InstCombine/strstr-1.ll index 81f5271..a946dd3 100644 --- a/test/Transforms/InstCombine/strstr-1.ll +++ b/test/Transforms/InstCombine/strstr-1.ll @@ -14,7 +14,7 @@ declare i8* @strstr(i8*, i8*) ; Check strstr(str, "") -> str. define i8* @test_simplify1(i8* %str) { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %pat = getelementptr inbounds [1 x i8]* @.str, i32 0, i32 0 %ret = call i8* @strstr(i8* %str, i8* %pat) ret i8* %ret @@ -24,7 +24,7 @@ define i8* @test_simplify1(i8* %str) { ; Check strstr(str, "a") -> strchr(str, 'a'). define i8* @test_simplify2(i8* %str) { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( %pat = getelementptr inbounds [2 x i8]* @.str1, i32 0, i32 0 %ret = call i8* @strstr(i8* %str, i8* %pat) ret i8* %ret @@ -34,7 +34,7 @@ define i8* @test_simplify2(i8* %str) { ; Check strstr("abcde", "bcd") -> "abcde" + 1. define i8* @test_simplify3() { -; CHECK: @test_simplify3 +; CHECK-LABEL: @test_simplify3( %str = getelementptr inbounds [6 x i8]* @.str2, i32 0, i32 0 %pat = getelementptr inbounds [4 x i8]* @.str3, i32 0, i32 0 %ret = call i8* @strstr(i8* %str, i8* %pat) @@ -45,7 +45,7 @@ define i8* @test_simplify3() { ; Check strstr(str, str) -> str. define i8* @test_simplify4(i8* %str) { -; CHECK: @test_simplify4 +; CHECK-LABEL: @test_simplify4( %ret = call i8* @strstr(i8* %str, i8* %str) ret i8* %ret ; CHECK-NEXT: ret i8* %str @@ -54,7 +54,7 @@ define i8* @test_simplify4(i8* %str) { ; Check strstr(str, pat) == str -> strncmp(str, pat, strlen(str)) == 0. define i1 @test_simplify5(i8* %str, i8* %pat) { -; CHECK: @test_simplify5 +; CHECK-LABEL: @test_simplify5( %ret = call i8* @strstr(i8* %str, i8* %pat) %cmp = icmp eq i8* %ret, %str ret i1 %cmp diff --git a/test/Transforms/InstCombine/strstr-2.ll b/test/Transforms/InstCombine/strstr-2.ll index 5092f9b..7b28ed0 100644 --- a/test/Transforms/InstCombine/strstr-2.ll +++ b/test/Transforms/InstCombine/strstr-2.ll @@ -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 declare i8 @strstr(i8*, i8*) define i8 @test_no_simplify1(i8* %str) { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( %pat = getelementptr inbounds [1 x i8]* @null, i32 0, i32 0 %ret = call i8 @strstr(i8* %str, i8* %pat) ; CHECK-NEXT: call i8 @strstr diff --git a/test/Transforms/InstCombine/strto-1.ll b/test/Transforms/InstCombine/strto-1.ll index 7139972..fc35ddd 100644 --- a/test/Transforms/InstCombine/strto-1.ll +++ b/test/Transforms/InstCombine/strto-1.ll @@ -5,77 +5,77 @@ 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" declare i64 @strtol(i8* %s, i8** %endptr, i32 %base) -; CHECK: declare i64 @strtol(i8*, i8** nocapture, i32) +; CHECK: declare i64 @strtol(i8* readonly, i8** nocapture, i32) declare double @strtod(i8* %s, i8** %endptr, i32 %base) -; CHECK: declare double @strtod(i8*, i8** nocapture, i32) +; CHECK: declare double @strtod(i8* readonly, i8** nocapture, i32) declare float @strtof(i8* %s, i8** %endptr, i32 %base) -; CHECK: declare float @strtof(i8*, i8** nocapture, i32) +; CHECK: declare float @strtof(i8* readonly, i8** nocapture, i32) declare i64 @strtoul(i8* %s, i8** %endptr, i32 %base) -; CHECK: declare i64 @strtoul(i8*, i8** nocapture, i32) +; CHECK: declare i64 @strtoul(i8* readonly, i8** nocapture, i32) declare i64 @strtoll(i8* %s, i8** %endptr, i32 %base) -; CHECK: declare i64 @strtoll(i8*, i8** nocapture, i32) +; CHECK: declare i64 @strtoll(i8* readonly, i8** nocapture, i32) declare double @strtold(i8* %s, i8** %endptr) -; CHECK: declare double @strtold(i8*, i8** nocapture) +; CHECK: declare double @strtold(i8* readonly, i8** nocapture) declare i64 @strtoull(i8* %s, i8** %endptr, i32 %base) -; CHECK: declare i64 @strtoull(i8*, i8** nocapture, i32) +; CHECK: declare i64 @strtoull(i8* readonly, i8** nocapture, i32) define void @test_simplify1(i8* %x, i8** %endptr) { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( call i64 @strtol(i8* %x, i8** null, i32 10) ; CHECK-NEXT: call i64 @strtol(i8* nocapture %x, i8** null, i32 10) ret void } define void @test_simplify2(i8* %x, i8** %endptr) { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( call double @strtod(i8* %x, i8** null, i32 10) ; CHECK-NEXT: call double @strtod(i8* nocapture %x, i8** null, i32 10) ret void } define void @test_simplify3(i8* %x, i8** %endptr) { -; CHECK: @test_simplify3 +; CHECK-LABEL: @test_simplify3( call float @strtof(i8* %x, i8** null, i32 10) ; CHECK-NEXT: call float @strtof(i8* nocapture %x, i8** null, i32 10) ret void } define void @test_simplify4(i8* %x, i8** %endptr) { -; CHECK: @test_simplify4 +; CHECK-LABEL: @test_simplify4( call i64 @strtoul(i8* %x, i8** null, i32 10) ; CHECK-NEXT: call i64 @strtoul(i8* nocapture %x, i8** null, i32 10) ret void } define void @test_simplify5(i8* %x, i8** %endptr) { -; CHECK: @test_simplify5 +; CHECK-LABEL: @test_simplify5( call i64 @strtoll(i8* %x, i8** null, i32 10) ; CHECK-NEXT: call i64 @strtoll(i8* nocapture %x, i8** null, i32 10) ret void } define void @test_simplify6(i8* %x, i8** %endptr) { -; CHECK: @test_simplify6 +; CHECK-LABEL: @test_simplify6( call double @strtold(i8* %x, i8** null) ; CHECK-NEXT: call double @strtold(i8* nocapture %x, i8** null) ret void } define void @test_simplify7(i8* %x, i8** %endptr) { -; CHECK: @test_simplify7 +; CHECK-LABEL: @test_simplify7( call i64 @strtoull(i8* %x, i8** null, i32 10) ; CHECK-NEXT: call i64 @strtoull(i8* nocapture %x, i8** null, i32 10) ret void } define void @test_no_simplify1(i8* %x, i8** %endptr) { -; CHECK: @test_no_simplify1 +; CHECK-LABEL: @test_no_simplify1( call i64 @strtol(i8* %x, i8** %endptr, i32 10) ; CHECK-NEXT: call i64 @strtol(i8* %x, i8** %endptr, i32 10) ret void diff --git a/test/Transforms/InstCombine/struct-assign-tbaa.ll b/test/Transforms/InstCombine/struct-assign-tbaa.ll index 33a771e..d7a26fa 100644 --- a/test/Transforms/InstCombine/struct-assign-tbaa.ll +++ b/test/Transforms/InstCombine/struct-assign-tbaa.ll @@ -24,7 +24,7 @@ entry: %struct.test2 = type { i32 (i8*, i32*, double*)** } define i32 (i8*, i32*, double*)*** @test2() { -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK-NOT: memcpy ; CHECK: ret %tmp = alloca %struct.test2, align 8 diff --git a/test/Transforms/InstCombine/sub-xor.ll b/test/Transforms/InstCombine/sub-xor.ll index 1d14852..e7aff00 100644 --- a/test/Transforms/InstCombine/sub-xor.ll +++ b/test/Transforms/InstCombine/sub-xor.ll @@ -5,7 +5,7 @@ define i32 @test1(i32 %x) nounwind { %sub = sub i32 63, %and ret i32 %sub -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK-NEXT: and i32 %x, 31 ; CHECK-NEXT: xor i32 %and, 63 ; CHECK-NEXT: ret @@ -18,7 +18,7 @@ define i32 @test2(i32 %x) nounwind { %sub = sub i32 31, %count ret i32 %sub -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK-NEXT: ctlz ; CHECK-NEXT: xor i32 %count, 31 ; CHECK-NEXT: ret @@ -30,7 +30,7 @@ define i32 @test3(i32 %x) nounwind { %add = add i32 %sub, 42 ret i32 %add -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK-NEXT: and i32 %x, 31 ; CHECK-NEXT: sub i32 73, %and ; CHECK-NEXT: ret @@ -41,7 +41,7 @@ define i32 @test4(i32 %x) nounwind { %add = add i32 %sub, 42 ret i32 %add -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK-NEXT: add i32 %x, -2147483606 ; CHECK-NEXT: ret } diff --git a/test/Transforms/InstCombine/sub.ll b/test/Transforms/InstCombine/sub.ll index b71ec8c..5449656 100644 --- a/test/Transforms/InstCombine/sub.ll +++ b/test/Transforms/InstCombine/sub.ll @@ -7,14 +7,14 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 define i32 @test1(i32 %A) { %B = sub i32 %A, %A ret i32 %B -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK: ret i32 0 } define i32 @test2(i32 %A) { %B = sub i32 %A, 0 ret i32 %B -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK: ret i32 %A } @@ -22,7 +22,7 @@ define i32 @test3(i32 %A) { %B = sub i32 0, %A %C = sub i32 0, %B ret i32 %C -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK: ret i32 %A } @@ -30,7 +30,7 @@ define i32 @test4(i32 %A, i32 %x) { %B = sub i32 0, %A %C = sub i32 %x, %B ret i32 %C -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK: %C = add i32 %x, %A ; CHECK: ret i32 %C } @@ -39,7 +39,7 @@ define i32 @test5(i32 %A, i32 %B, i32 %C) { %D = sub i32 %B, %C %E = sub i32 %A, %D ret i32 %E -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK: %D1 = sub i32 %C, %B ; CHECK: %E = add ; CHECK: ret i32 %E @@ -49,7 +49,7 @@ define i32 @test6(i32 %A, i32 %B) { %C = and i32 %A, %B %D = sub i32 %A, %C ret i32 %D -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK-NEXT: xor i32 %B, -1 ; CHECK-NEXT: %D = and i32 ; CHECK-NEXT: ret i32 %D @@ -58,7 +58,7 @@ define i32 @test6(i32 %A, i32 %B) { define i32 @test7(i32 %A) { %B = sub i32 -1, %A ret i32 %B -; CHECK: @test7 +; CHECK-LABEL: @test7( ; CHECK: %B = xor i32 %A, -1 ; CHECK: ret i32 %B } @@ -67,7 +67,7 @@ define i32 @test8(i32 %A) { %B = mul i32 9, %A %C = sub i32 %B, %A ret i32 %C -; CHECK: @test8 +; CHECK-LABEL: @test8( ; CHECK: %C = shl i32 %A, 3 ; CHECK: ret i32 %C } @@ -76,7 +76,7 @@ define i32 @test9(i32 %A) { %B = mul i32 3, %A %C = sub i32 %A, %B ret i32 %C -; CHECK: @test9 +; CHECK-LABEL: @test9( ; CHECK: %C = mul i32 %A, -2 ; CHECK: ret i32 %C } @@ -86,7 +86,7 @@ define i32 @test10(i32 %A, i32 %B) { %D = sub i32 0, %B %E = mul i32 %C, %D ret i32 %E -; CHECK: @test10 +; CHECK-LABEL: @test10( ; CHECK: %E = mul i32 %A, %B ; CHECK: ret i32 %E } @@ -95,7 +95,7 @@ define i32 @test10a(i32 %A) { %C = sub i32 0, %A %E = mul i32 %C, 7 ret i32 %E -; CHECK: @test10a +; CHECK-LABEL: @test10a( ; CHECK: %E = mul i32 %A, -7 ; CHECK: ret i32 %E } @@ -104,7 +104,7 @@ define i1 @test11(i8 %A, i8 %B) { %C = sub i8 %A, %B %cD = icmp ne i8 %C, 0 ret i1 %cD -; CHECK: @test11 +; CHECK-LABEL: @test11( ; CHECK: %cD = icmp ne i8 %A, %B ; CHECK: ret i1 %cD } @@ -113,7 +113,7 @@ define i32 @test12(i32 %A) { %B = ashr i32 %A, 31 %C = sub i32 0, %B ret i32 %C -; CHECK: @test12 +; CHECK-LABEL: @test12( ; CHECK: %C = lshr i32 %A, 31 ; CHECK: ret i32 %C } @@ -122,7 +122,7 @@ define i32 @test13(i32 %A) { %B = lshr i32 %A, 31 %C = sub i32 0, %B ret i32 %C -; CHECK: @test13 +; CHECK-LABEL: @test13( ; CHECK: %C = ashr i32 %A, 31 ; CHECK: ret i32 %C } @@ -132,7 +132,7 @@ define i32 @test14(i32 %A) { %C = bitcast i32 %B to i32 %D = sub i32 0, %C ret i32 %D -; CHECK: @test14 +; CHECK-LABEL: @test14( ; CHECK: %D = ashr i32 %A, 31 ; CHECK: ret i32 %D } @@ -141,7 +141,7 @@ define i32 @test15(i32 %A, i32 %B) { %C = sub i32 0, %A %D = srem i32 %B, %C ret i32 %D -; CHECK: @test15 +; CHECK-LABEL: @test15( ; CHECK: %D = srem i32 %B, %A ; CHECK: ret i32 %D } @@ -150,7 +150,7 @@ define i32 @test16(i32 %A) { %X = sdiv i32 %A, 1123 %Y = sub i32 0, %X ret i32 %Y -; CHECK: @test16 +; CHECK-LABEL: @test16( ; CHECK: %Y = sdiv i32 %A, -1123 ; CHECK: ret i32 %Y } @@ -161,7 +161,7 @@ define i32 @test17(i32 %A) { %B = sub i32 0, %A %C = sdiv i32 %B, 1234 ret i32 %C -; CHECK: @test17 +; CHECK-LABEL: @test17( ; CHECK: %B = sub i32 0, %A ; CHECK: %C = sdiv i32 %B, 1234 ; CHECK: ret i32 %C @@ -172,7 +172,7 @@ define i64 @test18(i64 %Y) { %tmp.12 = shl i64 %Y, 2 %tmp.8 = sub i64 %tmp.4, %tmp.12 ret i64 %tmp.8 -; CHECK: @test18 +; CHECK-LABEL: @test18( ; CHECK: ret i64 0 } @@ -180,7 +180,7 @@ define i32 @test19(i32 %X, i32 %Y) { %Z = sub i32 %X, %Y %Q = add i32 %Z, %Y ret i32 %Q -; CHECK: @test19 +; CHECK-LABEL: @test19( ; CHECK: ret i32 %X } @@ -188,7 +188,7 @@ define i1 @test20(i32 %g, i32 %h) { %tmp.2 = sub i32 %g, %h %tmp.4 = icmp ne i32 %tmp.2, %g ret i1 %tmp.4 -; CHECK: @test20 +; CHECK-LABEL: @test20( ; CHECK: %tmp.4 = icmp ne i32 %h, 0 ; CHECK: ret i1 %tmp.4 } @@ -197,7 +197,7 @@ define i1 @test21(i32 %g, i32 %h) { %tmp.2 = sub i32 %g, %h %tmp.4 = icmp ne i32 %tmp.2, %g ret i1 %tmp.4 -; CHECK: @test21 +; CHECK-LABEL: @test21( ; CHECK: %tmp.4 = icmp ne i32 %h, 0 ; CHECK: ret i1 %tmp.4 } @@ -208,7 +208,7 @@ define zeroext i1 @test22(i32 %a, i32 %b) nounwind { %tmp4 = sub i32 0, %b %tmp5 = icmp eq i32 %tmp2, %tmp4 ret i1 %tmp5 -; CHECK: @test22 +; CHECK-LABEL: @test22( ; CHECK: %tmp5 = icmp eq i32 %b, %a ; CHECK: ret i1 %tmp5 } @@ -222,7 +222,7 @@ define i32 @test23(i8* %P, i64 %A){ %F = trunc i64 %E to i32 %G = sub i32 %D, %F ret i32 %G -; CHECK: @test23 +; CHECK-LABEL: @test23( ; CHECK-NEXT: = trunc i64 %A to i32 ; CHECK-NEXT: ret i32 } @@ -233,7 +233,7 @@ define i64 @test24(i8* %P, i64 %A){ %E = ptrtoint i8* %P to i64 %G = sub i64 %C, %E ret i64 %G -; CHECK: @test24 +; CHECK-LABEL: @test24( ; CHECK-NEXT: ret i64 %A } @@ -243,7 +243,7 @@ define i64 @test24a(i8* %P, i64 %A){ %E = ptrtoint i8* %P to i64 %G = sub i64 %E, %C ret i64 %G -; CHECK: @test24a +; CHECK-LABEL: @test24a( ; CHECK-NEXT: sub i64 0, %A ; CHECK-NEXT: ret i64 } @@ -255,7 +255,7 @@ define i64 @test24b(i8* %P, i64 %A){ %C = ptrtoint i16* %B to i64 %G = sub i64 %C, ptrtoint ([42 x i16]* @Arr to i64) ret i64 %G -; CHECK: @test24b +; CHECK-LABEL: @test24b( ; CHECK-NEXT: shl nuw i64 %A, 1 ; CHECK-NEXT: ret i64 } @@ -266,7 +266,7 @@ define i64 @test25(i8* %P, i64 %A){ %C = ptrtoint i16* %B to i64 %G = sub i64 %C, ptrtoint (i16* getelementptr ([42 x i16]* @Arr, i64 1, i64 0) to i64) ret i64 %G -; CHECK: @test25 +; CHECK-LABEL: @test25( ; CHECK-NEXT: shl nuw i64 %A, 1 ; CHECK-NEXT: add i64 {{.*}}, -84 ; CHECK-NEXT: ret i64 @@ -276,7 +276,7 @@ define i32 @test26(i32 %x) { %shl = shl i32 3, %x %neg = sub i32 0, %shl ret i32 %neg -; CHECK: @test26 +; CHECK-LABEL: @test26( ; CHECK-NEXT: shl i32 -3 ; CHECK-NEXT: ret i32 } @@ -285,7 +285,7 @@ define i32 @test27(i32 %x, i32 %y) { %mul = mul i32 %y, -8 %sub = sub i32 %x, %mul ret i32 %sub -; CHECK: @test27 +; CHECK-LABEL: @test27( ; CHECK-NEXT: shl i32 %y, 3 ; CHECK-NEXT: add i32 ; CHECK-NEXT: ret i32 @@ -296,7 +296,7 @@ define i32 @test28(i32 %x, i32 %y, i32 %z) { %mul = mul i32 %neg, %y %sub = sub i32 %x, %mul ret i32 %sub -; CHECK: @test28 +; CHECK-LABEL: @test28( ; CHECK-NEXT: mul i32 %z, %y ; CHECK-NEXT: add i32 ; CHECK-NEXT: ret i32 @@ -309,7 +309,7 @@ define i64 @test29(i8* %foo, i64 %i, i64 %j) { %cast2 = ptrtoint i8* %gep2 to i64 %sub = sub i64 %cast1, %cast2 ret i64 %sub -; CHECK: @test29 +; CHECK-LABEL: @test29( ; CHECK-NEXT: sub i64 %i, %j ; CHECK-NEXT: ret i64 } @@ -322,7 +322,7 @@ define i64 @test30(i8* %foo, i64 %i, i64 %j) { %cast2 = ptrtoint i8* %gep2 to i64 %sub = sub i64 %cast1, %cast2 ret i64 %sub -; CHECK: @test30 +; CHECK-LABEL: @test30( ; CHECK-NEXT: %gep1.idx = shl nuw i64 %i, 2 ; CHECK-NEXT: sub i64 %gep1.idx, %j ; CHECK-NEXT: ret i64 diff --git a/test/Transforms/InstCombine/toascii-1.ll b/test/Transforms/InstCombine/toascii-1.ll index c4a13e2..f5e1898 100644 --- a/test/Transforms/InstCombine/toascii-1.ll +++ b/test/Transforms/InstCombine/toascii-1.ll @@ -9,49 +9,49 @@ declare i32 @toascii(i32) ; Check isascii(c) -> c & 0x7f. define i32 @test_simplify1() { -; CHECK: @test_simplify1 +; CHECK-LABEL: @test_simplify1( %ret = call i32 @toascii(i32 0) ret i32 %ret ; CHECK-NEXT: ret i32 0 } define i32 @test_simplify2() { -; CHECK: @test_simplify2 +; CHECK-LABEL: @test_simplify2( %ret = call i32 @toascii(i32 1) ret i32 %ret ; CHECK-NEXT: ret i32 1 } define i32 @test_simplify3() { -; CHECK: @test_simplify3 +; CHECK-LABEL: @test_simplify3( %ret = call i32 @toascii(i32 127) ret i32 %ret ; CHECK-NEXT: ret i32 127 } define i32 @test_simplify4() { -; CHECK: @test_simplify4 +; CHECK-LABEL: @test_simplify4( %ret = call i32 @toascii(i32 128) ret i32 %ret ; CHECK-NEXT: ret i32 0 } define i32 @test_simplify5() { -; CHECK: @test_simplify5 +; CHECK-LABEL: @test_simplify5( %ret = call i32 @toascii(i32 255) ret i32 %ret ; CHECK-NEXT: ret i32 127 } define i32 @test_simplify6() { -; CHECK: @test_simplify6 +; CHECK-LABEL: @test_simplify6( %ret = call i32 @toascii(i32 256) ret i32 %ret ; CHECK-NEXT: ret i32 0 } define i32 @test_simplify7(i32 %x) { -; CHECK: @test_simplify7 +; CHECK-LABEL: @test_simplify7( %ret = call i32 @toascii(i32 %x) ; CHECK-NEXT: [[AND:%[a-z0-9]+]] = and i32 %x, 127 ret i32 %ret diff --git a/test/Transforms/InstCombine/trunc.ll b/test/Transforms/InstCombine/trunc.ll index cbbad7f..ee81cf8 100644 --- a/test/Transforms/InstCombine/trunc.ll +++ b/test/Transforms/InstCombine/trunc.ll @@ -11,7 +11,7 @@ define i64 @test1(i64 %a) { %d = zext i32 %c to i64 call void @use(i32 %b) ret i64 %d -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK-NOT: ext ; CHECK: ret } @@ -22,7 +22,7 @@ define i64 @test2(i64 %a) { %d = sext i32 %q to i64 call void @use(i32 %b) ret i64 %d -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK: shl i64 %a, 36 ; CHECK: %d = ashr exact i64 {{.*}}, 36 ; CHECK: ret i64 %d @@ -33,7 +33,7 @@ define i64 @test3(i64 %a) { %d = zext i32 %c to i64 call void @use(i32 %b) ret i64 %d -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK-NOT: ext ; CHECK: ret } @@ -44,7 +44,7 @@ define i64 @test4(i64 %a) { %d = zext i32 %x to i64 call void @use(i32 %b) ret i64 %d -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK: = and i64 %a, 8 ; CHECK: = xor i64 {{.*}}, 8 ; CHECK-NOT: ext @@ -56,7 +56,7 @@ define i32 @test5(i32 %A) { %C = lshr i128 %B, 16 %D = trunc i128 %C to i32 ret i32 %D -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK: %C = lshr i32 %A, 16 ; CHECK: ret i32 %C } @@ -66,7 +66,7 @@ define i32 @test6(i64 %A) { %C = lshr i128 %B, 32 %D = trunc i128 %C to i32 ret i32 %D -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK: %C = lshr i64 %A, 32 ; CHECK: %D = trunc i64 %C to i32 ; CHECK: ret i32 %D @@ -77,7 +77,7 @@ define i92 @test7(i64 %A) { %C = lshr i128 %B, 32 %D = trunc i128 %C to i92 ret i92 %D -; CHECK: @test7 +; CHECK-LABEL: @test7( ; CHECK: %B = zext i64 %A to i92 ; CHECK: %C = lshr i92 %B, 32 ; CHECK: ret i92 %C @@ -90,7 +90,7 @@ define i64 @test8(i32 %A, i32 %B) { %ins35 = or i128 %tmp33, %tmp38 %tmp42 = trunc i128 %ins35 to i64 ret i64 %tmp42 -; CHECK: @test8 +; CHECK-LABEL: @test8( ; CHECK: %tmp38 = zext i32 %A to i64 ; CHECK: %tmp32 = zext i32 %B to i64 ; CHECK: %tmp33 = shl nuw i64 %tmp32, 32 @@ -102,7 +102,7 @@ define i8 @test9(i32 %X) { %Y = and i32 %X, 42 %Z = trunc i32 %Y to i8 ret i8 %Z -; CHECK: @test9 +; CHECK-LABEL: @test9( ; CHECK: trunc ; CHECK: and ; CHECK: ret @@ -113,7 +113,7 @@ define i8 @test10(i32 %X) { %Y = trunc i32 %X to i8 %Z = and i8 %Y, 42 ret i8 %Z -; CHECK: @test10 +; CHECK-LABEL: @test10( ; CHECK: trunc ; CHECK: and ; CHECK: ret diff --git a/test/Transforms/InstCombine/udivrem-change-width.ll b/test/Transforms/InstCombine/udivrem-change-width.ll index b388a3b..478e9ca 100644 --- a/test/Transforms/InstCombine/udivrem-change-width.ll +++ b/test/Transforms/InstCombine/udivrem-change-width.ll @@ -9,7 +9,7 @@ define i8 @udiv_i8(i8 %a, i8 %b) nounwind { %div = udiv i32 %conv, %conv2 %conv3 = trunc i32 %div to i8 ret i8 %conv3 -; CHECK: @udiv_i8 +; CHECK-LABEL: @udiv_i8( ; CHECK: udiv i8 %a, %b } @@ -19,7 +19,7 @@ define i8 @urem_i8(i8 %a, i8 %b) nounwind { %div = urem i32 %conv, %conv2 %conv3 = trunc i32 %div to i8 ret i8 %conv3 -; CHECK: @urem_i8 +; CHECK-LABEL: @urem_i8( ; CHECK: urem i8 %a, %b } @@ -28,7 +28,7 @@ define i32 @udiv_i32(i8 %a, i8 %b) nounwind { %conv2 = zext i8 %b to i32 %div = udiv i32 %conv, %conv2 ret i32 %div -; CHECK: @udiv_i32 +; CHECK-LABEL: @udiv_i32( ; CHECK: udiv i8 %a, %b ; CHECK: zext } @@ -38,7 +38,7 @@ define i32 @urem_i32(i8 %a, i8 %b) nounwind { %conv2 = zext i8 %b to i32 %div = urem i32 %conv, %conv2 ret i32 %div -; CHECK: @urem_i32 +; CHECK-LABEL: @urem_i32( ; CHECK: urem i8 %a, %b ; CHECK: zext } @@ -47,7 +47,7 @@ define i32 @udiv_i32_c(i8 %a) nounwind { %conv = zext i8 %a to i32 %div = udiv i32 %conv, 10 ret i32 %div -; CHECK: @udiv_i32_c +; CHECK-LABEL: @udiv_i32_c( ; CHECK: udiv i8 %a, 10 ; CHECK: zext } @@ -56,7 +56,7 @@ define i32 @urem_i32_c(i8 %a) nounwind { %conv = zext i8 %a to i32 %div = urem i32 %conv, 10 ret i32 %div -; CHECK: @urem_i32_c +; CHECK-LABEL: @urem_i32_c( ; CHECK: urem i8 %a, 10 ; CHECK: zext } diff --git a/test/Transforms/InstCombine/vec_demanded_elts.ll b/test/Transforms/InstCombine/vec_demanded_elts.ll index 0019a57..d12412a 100644 --- a/test/Transforms/InstCombine/vec_demanded_elts.ll +++ b/test/Transforms/InstCombine/vec_demanded_elts.ll @@ -2,7 +2,7 @@ define i16 @test1(float %f) { entry: -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK: fmul float ; CHECK-NOT: insertelement {{.*}} 0.00 ; CHECK-NOT: call {{.*}} @llvm.x86.sse.mul @@ -22,7 +22,7 @@ entry: } define i32 @test2(float %f) { -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK-NOT: insertelement ; CHECK-NOT: extractelement ; CHECK: ret @@ -37,7 +37,7 @@ define i32 @test2(float %f) { } define i64 @test3(float %f, double %d) { -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK-NOT: insertelement {{.*}} 0.00 ; CHECK: ret entry: @@ -85,7 +85,7 @@ entry: } define void @get_image() nounwind { -; CHECK: @get_image +; CHECK-LABEL: @get_image( ; CHECK-NOT: extractelement ; CHECK: unreachable entry: @@ -105,7 +105,7 @@ bb3: ; preds = %bb2, %entry ; PR4340 define void @vac(<4 x float>* nocapture %a) nounwind { -; CHECK: @vac +; CHECK-LABEL: @vac( ; CHECK-NOT: load ; CHECK: ret entry: @@ -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> @@ -163,7 +163,7 @@ entry: } define <2 x float> @test_fptrunc(double %f) { -; CHECK: @test_fptrunc +; CHECK-LABEL: @test_fptrunc( ; CHECK: insertelement ; CHECK: insertelement ; CHECK-NOT: insertelement @@ -177,7 +177,7 @@ define <2 x float> @test_fptrunc(double %f) { } define <2 x double> @test_fpext(float %f) { -; CHECK: @test_fpext +; CHECK-LABEL: @test_fpext( ; CHECK: insertelement ; CHECK: insertelement ; CHECK-NOT: insertelement @@ -191,7 +191,7 @@ define <2 x double> @test_fpext(float %f) { } define <4 x float> @test_select(float %f, float %g) { -; CHECK: @test_select +; CHECK-LABEL: @test_select( ; CHECK: %a0 = insertelement <4 x float> undef, float %f, i32 0 ; CHECK-NOT: insertelement ; CHECK: %a3 = insertelement <4 x float> %a0, float 3.000000e+00, i32 3 diff --git a/test/Transforms/InstCombine/vec_shuffle.ll b/test/Transforms/InstCombine/vec_shuffle.ll index 5ffe6c0..738e05b 100644 --- a/test/Transforms/InstCombine/vec_shuffle.ll +++ b/test/Transforms/InstCombine/vec_shuffle.ll @@ -1,21 +1,21 @@ ; RUN: opt < %s -instcombine -S | FileCheck %s define <4 x float> @test1(<4 x float> %v1) { -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK: ret <4 x float> %v1 %v2 = shufflevector <4 x float> %v1, <4 x float> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3> ret <4 x float> %v2 } define <4 x float> @test2(<4 x float> %v1) { -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK: ret <4 x float> %v1 %v2 = shufflevector <4 x float> %v1, <4 x float> %v1, <4 x i32> <i32 0, i32 5, i32 2, i32 7> ret <4 x float> %v2 } define float @test3(<4 x float> %A, <4 x float> %B, float %f) { -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK: ret float %f %C = insertelement <4 x float> %A, float %f, i32 0 %D = shufflevector <4 x float> %C, <4 x float> %B, <4 x i32> <i32 5, i32 0, i32 2, i32 7> @@ -24,7 +24,7 @@ define float @test3(<4 x float> %A, <4 x float> %B, float %f) { } define i32 @test4(<4 x i32> %X) { -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK-NEXT: extractelement ; CHECK-NEXT: ret %tmp152.i53899.i = shufflevector <4 x i32> %X, <4 x i32> undef, <4 x i32> zeroinitializer @@ -33,7 +33,7 @@ define i32 @test4(<4 x i32> %X) { } define i32 @test5(<4 x i32> %X) { -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK-NEXT: extractelement ; CHECK-NEXT: ret %tmp152.i53899.i = shufflevector <4 x i32> %X, <4 x i32> undef, <4 x i32> <i32 3, i32 2, i32 undef, i32 undef> @@ -42,7 +42,7 @@ define i32 @test5(<4 x i32> %X) { } define float @test6(<4 x float> %X) { -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK-NEXT: extractelement ; CHECK-NEXT: ret %X1 = bitcast <4 x float> %X to <4 x i32> @@ -53,7 +53,7 @@ define float @test6(<4 x float> %X) { } define <4 x float> @test7(<4 x float> %tmp45.i) { -; CHECK: @test7 +; CHECK-LABEL: @test7( ; CHECK-NEXT: ret <4 x float> %tmp45.i %tmp1642.i = shufflevector <4 x float> %tmp45.i, <4 x float> undef, <4 x i32> < i32 0, i32 1, i32 6, i32 7 > ret <4 x float> %tmp1642.i @@ -61,7 +61,7 @@ define <4 x float> @test7(<4 x float> %tmp45.i) { ; This should turn into a single shuffle. define <4 x float> @test8(<4 x float> %tmp, <4 x float> %tmp1) { -; CHECK: @test8 +; CHECK-LABEL: @test8( ; CHECK-NEXT: shufflevector ; CHECK-NEXT: ret %tmp4 = extractelement <4 x float> %tmp, i32 1 @@ -77,7 +77,7 @@ define <4 x float> @test8(<4 x float> %tmp, <4 x float> %tmp1) { ; Test fold of two shuffles where the first shuffle vectors inputs are a ; different length then the second. define <4 x i8> @test9(<16 x i8> %tmp6) nounwind { -; CHECK: @test9 +; CHECK-LABEL: @test9( ; CHECK-NEXT: shufflevector ; CHECK-NEXT: ret %tmp7 = shufflevector <16 x i8> %tmp6, <16 x i8> undef, <4 x i32> < i32 13, i32 9, i32 4, i32 13 > ; <<4 x i8>> [#uses=1] @@ -89,7 +89,7 @@ define <4 x i8> @test9(<16 x i8> %tmp6) nounwind { ; mask values of 2*N, where N is the mask length. These shuffles should not ; be folded (because [8,9,4,8] may not be a mask supported by the target). define <4 x i8> @test9a(<16 x i8> %tmp6) nounwind { -; CHECK: @test9a +; CHECK-LABEL: @test9a( ; CHECK-NEXT: shufflevector ; CHECK-NEXT: shufflevector ; CHECK-NEXT: ret @@ -101,7 +101,7 @@ define <4 x i8> @test9a(<16 x i8> %tmp6) nounwind { ; Test fold of two shuffles where the first shuffle vectors inputs are a ; different length then the second. define <4 x i8> @test9b(<4 x i8> %tmp6, <4 x i8> %tmp7) nounwind { -; CHECK: @test9 +; CHECK-LABEL: @test9b( ; CHECK-NEXT: shufflevector ; CHECK-NEXT: ret %tmp1 = shufflevector <4 x i8> %tmp6, <4 x i8> %tmp7, <8 x i32> <i32 0, i32 1, i32 4, i32 5, i32 4, i32 5, i32 2, i32 3> ; <<4 x i8>> [#uses=1] @@ -111,7 +111,7 @@ define <4 x i8> @test9b(<4 x i8> %tmp6, <4 x i8> %tmp7) nounwind { ; Redundant vector splats should be removed. Radar 8597790. define <4 x i32> @test10(<4 x i32> %tmp5) nounwind { -; CHECK: @test10 +; CHECK-LABEL: @test10( ; CHECK-NEXT: shufflevector ; CHECK-NEXT: ret %tmp6 = shufflevector <4 x i32> %tmp5, <4 x i32> undef, <4 x i32> <i32 1, i32 undef, i32 undef, i32 undef> @@ -122,7 +122,7 @@ define <4 x i32> @test10(<4 x i32> %tmp5) nounwind { ; Test fold of two shuffles where the two shufflevector inputs's op1 are ; the same define <8 x i8> @test11(<16 x i8> %tmp6) nounwind { -; CHECK: @test11 +; CHECK-LABEL: @test11( ; CHECK-NEXT: shufflevector <16 x i8> %tmp6, <16 x i8> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7> ; CHECK-NEXT: ret %tmp1 = shufflevector <16 x i8> %tmp6, <16 x i8> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3> ; <<4 x i8>> [#uses=1] @@ -134,7 +134,7 @@ define <8 x i8> @test11(<16 x i8> %tmp6) nounwind { ; Test fold of two shuffles where the first shufflevector's inputs are ; the same as the second define <8 x i8> @test12(<8 x i8> %tmp6, <8 x i8> %tmp2) nounwind { -; CHECK: @test12 +; CHECK-LABEL: @test12( ; CHECK-NEXT: shufflevector <8 x i8> %tmp6, <8 x i8> %tmp2, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 9, i32 8, i32 11, i32 12> ; CHECK-NEXT: ret %tmp1 = shufflevector <8 x i8> %tmp6, <8 x i8> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 5, i32 4, i32 undef, i32 7> ; <<8 x i8>> [#uses=1] @@ -145,7 +145,7 @@ define <8 x i8> @test12(<8 x i8> %tmp6, <8 x i8> %tmp2) nounwind { ; Test fold of two shuffles where the first shufflevector's inputs are ; the same as the second define <8 x i8> @test12a(<8 x i8> %tmp6, <8 x i8> %tmp2) nounwind { -; CHECK: @test12a +; CHECK-LABEL: @test12a( ; CHECK-NEXT: shufflevector <8 x i8> %tmp2, <8 x i8> %tmp6, <8 x i32> <i32 0, i32 3, i32 1, i32 4, i32 8, i32 9, i32 10, i32 11> ; CHECK-NEXT: ret %tmp1 = shufflevector <8 x i8> %tmp6, <8 x i8> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 5, i32 4, i32 undef, i32 7> ; <<8 x i8>> [#uses=1] @@ -154,7 +154,7 @@ define <8 x i8> @test12a(<8 x i8> %tmp6, <8 x i8> %tmp2) nounwind { } define <2 x i8> @test13a(i8 %x1, i8 %x2) { -; CHECK: @test13a +; CHECK-LABEL: @test13a( ; CHECK-NEXT: insertelement {{.*}} undef, i8 %x1, i32 1 ; CHECK-NEXT: insertelement {{.*}} i8 %x2, i32 0 ; CHECK-NEXT: add {{.*}} <i8 7, i8 5> @@ -167,7 +167,7 @@ define <2 x i8> @test13a(i8 %x1, i8 %x2) { } define <2 x i8> @test13b(i8 %x) { -; CHECK: @test13b +; CHECK-LABEL: @test13b( ; CHECK-NEXT: insertelement <2 x i8> undef, i8 %x, i32 1 ; CHECK-NEXT: ret %A = insertelement <2 x i8> undef, i8 %x, i32 0 @@ -176,7 +176,7 @@ define <2 x i8> @test13b(i8 %x) { } define <2 x i8> @test13c(i8 %x1, i8 %x2) { -; CHECK: @test13c +; CHECK-LABEL: @test13c( ; CHECK-NEXT: insertelement <2 x i8> {{.*}}, i32 0 ; CHECK-NEXT: insertelement <2 x i8> {{.*}}, i32 1 ; CHECK-NEXT: ret @@ -185,3 +185,18 @@ define <2 x i8> @test13c(i8 %x1, i8 %x2) { %C = shufflevector <4 x i8> %B, <4 x i8> undef, <2 x i32> <i32 0, i32 2> ret <2 x i8> %C } + +define void @test14(i16 %conv10) { + %tmp = alloca <4 x i16>, align 8 + %vecinit6 = insertelement <4 x i16> undef, i16 23, i32 3 + store <4 x i16> %vecinit6, <4 x i16>* undef + %tmp1 = load <4 x i16>* undef + %vecinit11 = insertelement <4 x i16> undef, i16 %conv10, i32 3 + %div = udiv <4 x i16> %tmp1, %vecinit11 + store <4 x i16> %div, <4 x i16>* %tmp + %tmp4 = load <4 x i16>* %tmp + %tmp5 = shufflevector <4 x i16> %tmp4, <4 x i16> undef, <2 x i32> <i32 2, i32 0> + %cmp = icmp ule <2 x i16> %tmp5, undef + %sext = sext <2 x i1> %cmp to <2 x i16> + ret void +} diff --git a/test/Transforms/InstCombine/vector-casts.ll b/test/Transforms/InstCombine/vector-casts.ll index 2f2990b..ca97b34 100644 --- a/test/Transforms/InstCombine/vector-casts.ll +++ b/test/Transforms/InstCombine/vector-casts.ll @@ -5,7 +5,7 @@ define <2 x i1> @test1(<2 x i64> %a) { %t = trunc <2 x i64> %a to <2 x i1> ret <2 x i1> %t -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK: and <2 x i64> %a, <i64 1, i64 1> ; CHECK: icmp ne <2 x i64> %1, zeroinitializer } @@ -16,7 +16,7 @@ define <2 x i64> @test2(<2 x i64> %a) { %t = ashr <2 x i64> %b, <i64 1, i64 1> ret <2 x i64> %t -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK: and <2 x i64> %a, <i64 65535, i64 65535> ; CHECK: lshr <2 x i64> %b, <i64 1, i64 1> } @@ -33,7 +33,7 @@ entry: %conv = bitcast <4 x i32> %and to <2 x i64> ret <2 x i64> %conv -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK: fcmp ord <4 x float> %a, %b } @@ -46,7 +46,7 @@ entry: %or = or <4 x i32> %sext, %sext5 %conv = bitcast <4 x i32> %or to <2 x i64> ret <2 x i64> %conv -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK: fcmp uno <4 x float> %a, %b } @@ -62,7 +62,7 @@ entry: %conv = bitcast <4 x i32> %and to <2 x i64> ret <2 x i64> %conv -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK: sext <4 x i1> %cmp to <4 x i32> ; The sext-and pair is canonicalized to a select. ; CHECK: select <4 x i1> %cmp4, <4 x i32> %sext, <4 x i32> zeroinitializer @@ -126,7 +126,7 @@ define <2 x double> @fc(<2 x double> %t) { ; PR9228 ; This was a crasher, so no CHECK statements. define <4 x float> @f(i32 %a) nounwind alwaysinline { -; CHECK: @f +; CHECK-LABEL: @f( entry: %dim = insertelement <4 x i32> undef, i32 %a, i32 0 %dim30 = insertelement <4 x i32> %dim, i32 %a, i32 1 diff --git a/test/Transforms/InstCombine/vector-mul.ll b/test/Transforms/InstCombine/vector-mul.ll index 4e4417f..284d407 100644 --- a/test/Transforms/InstCombine/vector-mul.ll +++ b/test/Transforms/InstCombine/vector-mul.ll @@ -9,7 +9,7 @@ entry: ret <4 x i8> %mul } -; CHECK: @Zero_i8 +; CHECK-LABEL: @Zero_i8( ; CHECK: ret <4 x i8> zeroinitializer define <4 x i8> @Identity_i8(<4 x i8> %InVec) { @@ -18,7 +18,7 @@ entry: ret <4 x i8> %mul } -; CHECK: @Identity_i8 +; CHECK-LABEL: @Identity_i8( ; CHECK: ret <4 x i8> %InVec define <4 x i8> @AddToSelf_i8(<4 x i8> %InVec) { @@ -27,7 +27,7 @@ entry: ret <4 x i8> %mul } -; CHECK: @AddToSelf_i8 +; CHECK-LABEL: @AddToSelf_i8( ; CHECK: shl <4 x i8> %InVec, <i8 1, i8 1, i8 1, i8 1> ; CHECK: ret @@ -37,7 +37,7 @@ entry: ret <4 x i8> %mul } -; CHECK: @SplatPow2Test1_i8 +; CHECK-LABEL: @SplatPow2Test1_i8( ; CHECK: shl <4 x i8> %InVec, <i8 2, i8 2, i8 2, i8 2> ; CHECK: ret @@ -47,7 +47,7 @@ entry: ret <4 x i8> %mul } -; CHECK: @SplatPow2Test2_i8 +; CHECK-LABEL: @SplatPow2Test2_i8( ; CHECK: shl <4 x i8> %InVec, <i8 3, i8 3, i8 3, i8 3> ; CHECK: ret @@ -57,7 +57,7 @@ entry: ret <4 x i8> %mul } -; CHECK: @MulTest1_i8 +; CHECK-LABEL: @MulTest1_i8( ; CHECK: shl <4 x i8> %InVec, <i8 0, i8 1, i8 2, i8 3> ; CHECK: ret @@ -67,7 +67,7 @@ entry: ret <4 x i8> %mul } -; CHECK: @MulTest2_i8 +; CHECK-LABEL: @MulTest2_i8( ; CHECK: mul <4 x i8> %InVec, <i8 3, i8 3, i8 3, i8 3> ; CHECK: ret @@ -77,7 +77,7 @@ entry: ret <4 x i8> %mul } -; CHECK: @MulTest3_i8 +; CHECK-LABEL: @MulTest3_i8( ; CHECK: shl <4 x i8> %InVec, <i8 2, i8 2, i8 1, i8 1> ; CHECK: ret @@ -88,7 +88,7 @@ entry: ret <4 x i8> %mul } -; CHECK: @MulTest4_i8 +; CHECK-LABEL: @MulTest4_i8( ; CHECK: mul <4 x i8> %InVec, <i8 4, i8 4, i8 0, i8 1> ; CHECK: ret @@ -98,7 +98,7 @@ entry: ret <4 x i16> %mul } -; CHECK: @Zero_i16 +; CHECK-LABEL: @Zero_i16( ; CHECK: ret <4 x i16> zeroinitializer define <4 x i16> @Identity_i16(<4 x i16> %InVec) { @@ -107,7 +107,7 @@ entry: ret <4 x i16> %mul } -; CHECK: @Identity_i16 +; CHECK-LABEL: @Identity_i16( ; CHECK: ret <4 x i16> %InVec define <4 x i16> @AddToSelf_i16(<4 x i16> %InVec) { @@ -116,7 +116,7 @@ entry: ret <4 x i16> %mul } -; CHECK: @AddToSelf_i16 +; CHECK-LABEL: @AddToSelf_i16( ; CHECK: shl <4 x i16> %InVec, <i16 1, i16 1, i16 1, i16 1> ; CHECK: ret @@ -126,7 +126,7 @@ entry: ret <4 x i16> %mul } -; CHECK: @SplatPow2Test1_i16 +; CHECK-LABEL: @SplatPow2Test1_i16( ; CHECK: shl <4 x i16> %InVec, <i16 2, i16 2, i16 2, i16 2> ; CHECK: ret @@ -136,7 +136,7 @@ entry: ret <4 x i16> %mul } -; CHECK: @SplatPow2Test2_i16 +; CHECK-LABEL: @SplatPow2Test2_i16( ; CHECK: shl <4 x i16> %InVec, <i16 3, i16 3, i16 3, i16 3> ; CHECK: ret @@ -146,7 +146,7 @@ entry: ret <4 x i16> %mul } -; CHECK: @MulTest1_i16 +; CHECK-LABEL: @MulTest1_i16( ; CHECK: shl <4 x i16> %InVec, <i16 0, i16 1, i16 2, i16 3> ; CHECK: ret @@ -156,7 +156,7 @@ entry: ret <4 x i16> %mul } -; CHECK: @MulTest2_i16 +; CHECK-LABEL: @MulTest2_i16( ; CHECK: mul <4 x i16> %InVec, <i16 3, i16 3, i16 3, i16 3> ; CHECK: ret @@ -166,7 +166,7 @@ entry: ret <4 x i16> %mul } -; CHECK: @MulTest3_i16 +; CHECK-LABEL: @MulTest3_i16( ; CHECK: shl <4 x i16> %InVec, <i16 2, i16 2, i16 1, i16 1> ; CHECK: ret @@ -176,7 +176,7 @@ entry: ret <4 x i16> %mul } -; CHECK: @MulTest4_i16 +; CHECK-LABEL: @MulTest4_i16( ; CHECK: mul <4 x i16> %InVec, <i16 4, i16 4, i16 0, i16 2> ; CHECK: ret @@ -186,7 +186,7 @@ entry: ret <4 x i32> %mul } -; CHECK: @Zero_i32 +; CHECK-LABEL: @Zero_i32( ; CHECK: ret <4 x i32> zeroinitializer define <4 x i32> @Identity_i32(<4 x i32> %InVec) { @@ -195,7 +195,7 @@ entry: ret <4 x i32> %mul } -; CHECK: @Identity_i32 +; CHECK-LABEL: @Identity_i32( ; CHECK: ret <4 x i32> %InVec define <4 x i32> @AddToSelf_i32(<4 x i32> %InVec) { @@ -204,7 +204,7 @@ entry: ret <4 x i32> %mul } -; CHECK: @AddToSelf_i32 +; CHECK-LABEL: @AddToSelf_i32( ; CHECK: shl <4 x i32> %InVec, <i32 1, i32 1, i32 1, i32 1> ; CHECK: ret @@ -215,7 +215,7 @@ entry: ret <4 x i32> %mul } -; CHECK: @SplatPow2Test1_i32 +; CHECK-LABEL: @SplatPow2Test1_i32( ; CHECK: shl <4 x i32> %InVec, <i32 2, i32 2, i32 2, i32 2> ; CHECK: ret @@ -225,7 +225,7 @@ entry: ret <4 x i32> %mul } -; CHECK: @SplatPow2Test2_i32 +; CHECK-LABEL: @SplatPow2Test2_i32( ; CHECK: shl <4 x i32> %InVec, <i32 3, i32 3, i32 3, i32 3> ; CHECK: ret @@ -235,7 +235,7 @@ entry: ret <4 x i32> %mul } -; CHECK: @MulTest1_i32 +; CHECK-LABEL: @MulTest1_i32( ; CHECK: shl <4 x i32> %InVec, <i32 0, i32 1, i32 2, i32 3> ; CHECK: ret @@ -245,7 +245,7 @@ entry: ret <4 x i32> %mul } -; CHECK: @MulTest2_i32 +; CHECK-LABEL: @MulTest2_i32( ; CHECK: mul <4 x i32> %InVec, <i32 3, i32 3, i32 3, i32 3> ; CHECK: ret @@ -255,7 +255,7 @@ entry: ret <4 x i32> %mul } -; CHECK: @MulTest3_i32 +; CHECK-LABEL: @MulTest3_i32( ; CHECK: shl <4 x i32> %InVec, <i32 2, i32 2, i32 1, i32 1> ; CHECK: ret @@ -266,7 +266,7 @@ entry: ret <4 x i32> %mul } -; CHECK: @MulTest4_i32 +; CHECK-LABEL: @MulTest4_i32( ; CHECK: mul <4 x i32> %InVec, <i32 4, i32 4, i32 0, i32 1> ; CHECK: ret @@ -276,7 +276,7 @@ entry: ret <4 x i64> %mul } -; CHECK: @Zero_i64 +; CHECK-LABEL: @Zero_i64( ; CHECK: ret <4 x i64> zeroinitializer define <4 x i64> @Identity_i64(<4 x i64> %InVec) { @@ -285,7 +285,7 @@ entry: ret <4 x i64> %mul } -; CHECK: @Identity_i64 +; CHECK-LABEL: @Identity_i64( ; CHECK: ret <4 x i64> %InVec define <4 x i64> @AddToSelf_i64(<4 x i64> %InVec) { @@ -294,7 +294,7 @@ entry: ret <4 x i64> %mul } -; CHECK: @AddToSelf_i64 +; CHECK-LABEL: @AddToSelf_i64( ; CHECK: shl <4 x i64> %InVec, <i64 1, i64 1, i64 1, i64 1> ; CHECK: ret @@ -304,7 +304,7 @@ entry: ret <4 x i64> %mul } -; CHECK: @SplatPow2Test1_i64 +; CHECK-LABEL: @SplatPow2Test1_i64( ; CHECK: shl <4 x i64> %InVec, <i64 2, i64 2, i64 2, i64 2> ; CHECK: ret @@ -314,7 +314,7 @@ entry: ret <4 x i64> %mul } -; CHECK: @SplatPow2Test2_i64 +; CHECK-LABEL: @SplatPow2Test2_i64( ; CHECK: shl <4 x i64> %InVec, <i64 3, i64 3, i64 3, i64 3> ; CHECK: ret @@ -324,7 +324,7 @@ entry: ret <4 x i64> %mul } -; CHECK: @MulTest1_i64 +; CHECK-LABEL: @MulTest1_i64( ; CHECK: shl <4 x i64> %InVec, <i64 0, i64 1, i64 2, i64 3> ; CHECK: ret @@ -334,7 +334,7 @@ entry: ret <4 x i64> %mul } -; CHECK: @MulTest2_i64 +; CHECK-LABEL: @MulTest2_i64( ; CHECK: mul <4 x i64> %InVec, <i64 3, i64 3, i64 3, i64 3> ; CHECK: ret @@ -344,7 +344,7 @@ entry: ret <4 x i64> %mul } -; CHECK: @MulTest3_i64 +; CHECK-LABEL: @MulTest3_i64( ; CHECK: shl <4 x i64> %InVec, <i64 2, i64 2, i64 1, i64 1> ; CHECK: ret @@ -354,7 +354,7 @@ entry: ret <4 x i64> %mul } -; CHECK: @MulTest4_i64 +; CHECK-LABEL: @MulTest4_i64( ; CHECK: mul <4 x i64> %InVec, <i64 4, i64 4, i64 0, i64 1> ; CHECK: ret @@ -369,7 +369,7 @@ entry: ret <4 x i8> %mul } -; CHECK: @ShiftMulTest1 +; CHECK-LABEL: @ShiftMulTest1( ; CHECK: mul <4 x i8> %InVec, <i8 12, i8 12, i8 12, i8 12> ; CHECK: ret @@ -380,7 +380,7 @@ entry: ret <4 x i16> %mul } -; CHECK: @ShiftMulTest2 +; CHECK-LABEL: @ShiftMulTest2( ; CHECK: mul <4 x i16> %InVec, <i16 12, i16 12, i16 12, i16 12> ; CHECK: ret @@ -391,7 +391,7 @@ entry: ret <4 x i32> %mul } -; CHECK: @ShiftMulTest3 +; CHECK-LABEL: @ShiftMulTest3( ; CHECK: mul <4 x i32> %InVec, <i32 12, i32 12, i32 12, i32 12> ; CHECK: ret @@ -402,7 +402,7 @@ entry: ret <4 x i64> %mul } -; CHECK: @ShiftMulTest4 +; CHECK-LABEL: @ShiftMulTest4( ; CHECK: mul <4 x i64> %InVec, <i64 12, i64 12, i64 12, i64 12> ; CHECK: ret diff --git a/test/Transforms/InstCombine/vector_gep2.ll b/test/Transforms/InstCombine/vector_gep2.ll index 20165b1..42057d6 100644 --- a/test/Transforms/InstCombine/vector_gep2.ll +++ b/test/Transforms/InstCombine/vector_gep2.ll @@ -4,7 +4,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 target triple = "x86_64-unknown-linux-gnu" define <2 x i8*> @testa(<2 x i8*> %a) { -; CHECK: @testa +; CHECK-LABEL: @testa( %g = getelementptr <2 x i8*> %a, <2 x i32> <i32 0, i32 1> ; CHECK: getelementptr <2 x i8*> %a, <2 x i64> <i64 0, i64 1> ret <2 x i8*> %g diff --git a/test/Transforms/InstCombine/weak-symbols.ll b/test/Transforms/InstCombine/weak-symbols.ll index 0039b59..ec946ea 100644 --- a/test/Transforms/InstCombine/weak-symbols.ll +++ b/test/Transforms/InstCombine/weak-symbols.ll @@ -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: diff --git a/test/Transforms/InstCombine/win-math.ll b/test/Transforms/InstCombine/win-math.ll index 367e5b8..df3ac93 100644 --- a/test/Transforms/InstCombine/win-math.ll +++ b/test/Transforms/InstCombine/win-math.ll @@ -9,7 +9,7 @@ declare double @acos(double %x) define float @float_acos(float %x) nounwind readnone { -; WIN32: @float_acos +; WIN32-LABEL: @float_acos( ; WIN32-NOT: float @acosf ; WIN32: double @acos %1 = fpext float %x to double @@ -20,7 +20,7 @@ define float @float_acos(float %x) nounwind readnone { declare double @asin(double %x) define float @float_asin(float %x) nounwind readnone { -; WIN32: @float_asin +; WIN32-LABEL: @float_asin( ; WIN32-NOT: float @asinf ; WIN32: double @asin %1 = fpext float %x to double @@ -31,7 +31,7 @@ define float @float_asin(float %x) nounwind readnone { declare double @atan(double %x) define float @float_atan(float %x) nounwind readnone { -; WIN32: @float_atan +; WIN32-LABEL: @float_atan( ; WIN32-NOT: float @atanf ; WIN32: double @atan %1 = fpext float %x to double @@ -42,7 +42,7 @@ define float @float_atan(float %x) nounwind readnone { declare double @atan2(double %x, double %y) define float @float_atan2(float %x, float %y) nounwind readnone { -; WIN32: @float_atan2 +; WIN32-LABEL: @float_atan2( ; WIN32-NOT: float @atan2f ; WIN32: double @atan2 %1 = fpext float %x to double @@ -54,16 +54,16 @@ define float @float_atan2(float %x, float %y) nounwind readnone { declare double @ceil(double %x) define float @float_ceil(float %x) nounwind readnone { -; WIN32: @float_ceil +; WIN32-LABEL: @float_ceil( ; WIN32-NOT: float @ceilf ; WIN32: double @ceil -; WIN64: @float_ceil +; WIN64-LABEL: @float_ceil( ; WIN64: float @ceilf ; WIN64-NOT: double @ceil -; MINGW32: @float_ceil +; MINGW32-LABEL: @float_ceil( ; MINGW32: float @ceilf ; MINGW32-NOT: double @ceil -; MINGW64: @float_ceil +; MINGW64-LABEL: @float_ceil( ; MINGW64: float @ceilf ; MINGW64-NOT: double @ceil %1 = fpext float %x to double @@ -74,7 +74,7 @@ define float @float_ceil(float %x) nounwind readnone { declare double @_copysign(double %x) define float @float_copysign(float %x) nounwind readnone { -; WIN32: @float_copysign +; WIN32-LABEL: @float_copysign( ; WIN32-NOT: float @copysignf ; WIN32-NOT: float @_copysignf ; WIN32: double @_copysign @@ -86,7 +86,7 @@ define float @float_copysign(float %x) nounwind readnone { declare double @cos(double %x) define float @float_cos(float %x) nounwind readnone { -; WIN32: @float_cos +; WIN32-LABEL: @float_cos( ; WIN32-NOT: float @cosf ; WIN32: double @cos %1 = fpext float %x to double @@ -97,7 +97,7 @@ define float @float_cos(float %x) nounwind readnone { declare double @cosh(double %x) define float @float_cosh(float %x) nounwind readnone { -; WIN32: @float_cosh +; WIN32-LABEL: @float_cosh( ; WIN32-NOT: float @coshf ; WIN32: double @cosh %1 = fpext float %x to double @@ -108,7 +108,7 @@ define float @float_cosh(float %x) nounwind readnone { declare double @exp(double %x, double %y) define float @float_exp(float %x, float %y) nounwind readnone { -; WIN32: @float_exp +; WIN32-LABEL: @float_exp( ; WIN32-NOT: float @expf ; WIN32: double @exp %1 = fpext float %x to double @@ -120,10 +120,10 @@ define float @float_exp(float %x, float %y) nounwind readnone { declare double @fabs(double %x, double %y) define float @float_fabs(float %x, float %y) nounwind readnone { -; WIN32: @float_fabs +; WIN32-LABEL: @float_fabs( ; WIN32-NOT: float @fabsf ; WIN32: double @fabs -; WIN64: @float_fabs +; WIN64-LABEL: @float_fabs( ; WIN64-NOT: float @fabsf ; WIN64: double @fabs %1 = fpext float %x to double @@ -135,16 +135,16 @@ define float @float_fabs(float %x, float %y) nounwind readnone { declare double @floor(double %x) define float @float_floor(float %x) nounwind readnone { -; WIN32: @float_floor +; WIN32-LABEL: @float_floor( ; WIN32-NOT: float @floorf ; WIN32: double @floor -; WIN64: @float_floor +; WIN64-LABEL: @float_floor( ; WIN64: float @floorf ; WIN64-NOT: double @floor -; MINGW32: @float_floor +; MINGW32-LABEL: @float_floor( ; MINGW32: float @floorf ; MINGW32-NOT: double @floor -; MINGW64: @float_floor +; MINGW64-LABEL: @float_floor( ; MINGW64: float @floorf ; MINGW64-NOT: double @floor %1 = fpext float %x to double @@ -155,7 +155,7 @@ define float @float_floor(float %x) nounwind readnone { declare double @fmod(double %x, double %y) define float @float_fmod(float %x, float %y) nounwind readnone { -; WIN32: @float_fmod +; WIN32-LABEL: @float_fmod( ; WIN32-NOT: float @fmodf ; WIN32: double @fmod %1 = fpext float %x to double @@ -167,7 +167,7 @@ define float @float_fmod(float %x, float %y) nounwind readnone { declare double @log(double %x) define float @float_log(float %x) nounwind readnone { -; WIN32: @float_log +; WIN32-LABEL: @float_log( ; WIN32-NOT: float @logf ; WIN32: double @log %1 = fpext float %x to double @@ -178,7 +178,7 @@ define float @float_log(float %x) nounwind readnone { declare double @pow(double %x, double %y) define float @float_pow(float %x, float %y) nounwind readnone { -; WIN32: @float_pow +; WIN32-LABEL: @float_pow( ; WIN32-NOT: float @powf ; WIN32: double @pow %1 = fpext float %x to double @@ -190,7 +190,7 @@ define float @float_pow(float %x, float %y) nounwind readnone { declare double @sin(double %x) define float @float_sin(float %x) nounwind readnone { -; WIN32: @float_sin +; WIN32-LABEL: @float_sin( ; WIN32-NOT: float @sinf ; WIN32: double @sin %1 = fpext float %x to double @@ -201,7 +201,7 @@ define float @float_sin(float %x) nounwind readnone { declare double @sinh(double %x) define float @float_sinh(float %x) nounwind readnone { -; WIN32: @float_sinh +; WIN32-LABEL: @float_sinh( ; WIN32-NOT: float @sinhf ; WIN32: double @sinh %1 = fpext float %x to double @@ -212,16 +212,16 @@ define float @float_sinh(float %x) nounwind readnone { declare double @sqrt(double %x) define float @float_sqrt(float %x) nounwind readnone { -; WIN32: @float_sqrt +; WIN32-LABEL: @float_sqrt( ; WIN32-NOT: float @sqrtf ; WIN32: double @sqrt -; WIN64: @float_sqrt +; WIN64-LABEL: @float_sqrt( ; WIN64: float @sqrtf ; WIN64-NOT: double @sqrt -; MINGW32: @float_sqrt +; MINGW32-LABEL: @float_sqrt( ; MINGW32: float @sqrtf ; MINGW32-NOT: double @sqrt -; MINGW64: @float_sqrt +; MINGW64-LABEL: @float_sqrt( ; MINGW64: float @sqrtf ; MINGW64-NOT: double @sqrt %1 = fpext float %x to double @@ -232,7 +232,7 @@ define float @float_sqrt(float %x) nounwind readnone { declare double @tan(double %x) define float @float_tan(float %x) nounwind readnone { -; WIN32: @float_tan +; WIN32-LABEL: @float_tan( ; WIN32-NOT: float @tanf ; WIN32: double @tan %1 = fpext float %x to double @@ -243,7 +243,7 @@ define float @float_tan(float %x) nounwind readnone { declare double @tanh(double %x) define float @float_tanh(float %x) nounwind readnone { -; WIN32: @float_tanh +; WIN32-LABEL: @float_tanh( ; WIN32-NOT: float @tanhf ; WIN32: double @tanh %1 = fpext float %x to double @@ -255,16 +255,16 @@ define float @float_tanh(float %x) nounwind readnone { ; win32 does not have round; mingw32 does declare double @round(double %x) define float @float_round(float %x) nounwind readnone { -; WIN32: @float_round +; WIN32-LABEL: @float_round( ; WIN32-NOT: float @roundf ; WIN32: double @round -; WIN64: @float_round +; WIN64-LABEL: @float_round( ; WIN64-NOT: float @roundf ; WIN64: double @round -; MINGW32: @float_round +; MINGW32-LABEL: @float_round( ; MINGW32: float @roundf ; MINGW32-NOT: double @round -; MINGW64: @float_round +; MINGW64-LABEL: @float_round( ; MINGW64: float @roundf ; MINGW64-NOT: double @round %1 = fpext float %x to double diff --git a/test/Transforms/InstCombine/xor2.ll b/test/Transforms/InstCombine/xor2.ll index be06d79..d153e03 100644 --- a/test/Transforms/InstCombine/xor2.ll +++ b/test/Transforms/InstCombine/xor2.ll @@ -4,7 +4,7 @@ ; PR1253 define i1 @test0(i32 %A) { -; CHECK: @test0 +; CHECK-LABEL: @test0( ; CHECK: %C = icmp slt i32 %A, 0 %B = xor i32 %A, -2147483648 %C = icmp sgt i32 %B, -1 @@ -12,7 +12,7 @@ define i1 @test0(i32 %A) { } define i1 @test1(i32 %A) { -; CHECK: @test1 +; CHECK-LABEL: @test1( ; CHECK: %C = icmp slt i32 %A, 0 %B = xor i32 %A, 12345 %C = icmp slt i32 %B, 0 @@ -21,7 +21,7 @@ define i1 @test1(i32 %A) { ; PR1014 define i32 @test2(i32 %tmp1) { -; CHECK: @test2 +; CHECK-LABEL: @test2( ; CHECK-NEXT: and i32 %tmp1, 32 ; CHECK-NEXT: or i32 %ovm, 8 ; CHECK-NEXT: ret i32 @@ -32,7 +32,7 @@ define i32 @test2(i32 %tmp1) { } define i32 @test3(i32 %tmp1) { -; CHECK: @test3 +; CHECK-LABEL: @test3( ; CHECK-NEXT: and i32 %tmp1, 32 ; CHECK-NEXT: or i32 %ovm, 8 ; CHECK-NEXT: ret i32 @@ -47,7 +47,7 @@ define i32 @test4(i32 %A, i32 %B) { %2 = ashr i32 %1, %B %3 = xor i32 %2, -1 ret i32 %3 -; CHECK: @test4 +; CHECK-LABEL: @test4( ; CHECK: %1 = ashr i32 %A, %B ; CHECK: ret i32 %1 } @@ -62,7 +62,7 @@ test5: %xor1 = xor i32 %shr, 1 %add = add i32 %xor1, %xor ret i32 %add -; CHECK: @test5 +; CHECK-LABEL: @test5( ; CHECK: lshr i32 %val1, 8 ; CHECK: ret } @@ -78,7 +78,7 @@ define i32 @test6(i32 %x) { %shr = lshr i32 %xor, 16 %add = add i32 %shr, %xor ret i32 %add -; CHECK: @test6 +; CHECK-LABEL: @test6( ; CHECK: lshr i32 %x, 16 ; CHECK: ret } diff --git a/test/Transforms/InstCombine/zext-bool-add-sub.ll b/test/Transforms/InstCombine/zext-bool-add-sub.ll index b531057..d7f338b 100644 --- a/test/Transforms/InstCombine/zext-bool-add-sub.ll +++ b/test/Transforms/InstCombine/zext-bool-add-sub.ll @@ -3,7 +3,7 @@ define i32 @a(i1 zeroext %x, i1 zeroext %y) { entry: -; CHECK: @a +; CHECK-LABEL: @a( ; CHECK: [[TMP1:%.*]] = sext i1 %y to i32 ; CHECK: [[TMP2:%.*]] = select i1 %x, i32 2, i32 1 ; CHECK-NEXT: add i32 [[TMP2]], [[TMP1]] |