From f396cc87302d9a69b3680c339d219c49262f5bf3 Mon Sep 17 00:00:00 2001 From: Tanya Lattner Date: Wed, 19 Mar 2008 04:14:49 +0000 Subject: [PATCH] Upgrade tests to not use llvm-upgrade. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48529 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../Transforms/SCCP/2002-05-02-EdgeFailure.ll | 27 +-- .../SCCP/2002-05-02-MissSecondInst.ll | 11 +- .../SCCP/2002-05-20-MissedIncomingValue.ll | 21 +- .../SCCP/2002-05-21-InvalidSimplify.ll | 51 ++--- .../SCCP/2002-08-30-GetElementPtrTest.ll | 13 +- .../SCCP/2003-06-24-OverdefinedPHIValue.ll | 52 +++-- .../SCCP/2003-08-26-InvokeHandling.ll | 23 +- test/Transforms/SCCP/2004-11-16-DeadInvoke.ll | 19 +- .../SCCP/2004-12-10-UndefBranchBug.ll | 13 +- .../SCCP/2006-10-23-IPSCCP-Crash.ll | 189 +++++++--------- test/Transforms/SCCP/2006-12-04-PackedType.ll | 202 +++++++++--------- test/Transforms/SCCP/2006-12-19-UndefBug.ll | 9 +- .../Transforms/SCCP/2007-05-16-InvokeCrash.ll | 13 +- test/Transforms/SCCP/basictest.ll | 19 +- test/Transforms/SCCP/calltest.ll | 27 ++- test/Transforms/SCCP/ipsccp-basic.ll | 17 +- test/Transforms/SCCP/ipsccp-conditional.ll | 29 ++- test/Transforms/SCCP/ipsccp-gvar.ll | 33 ++- test/Transforms/SCCP/loadtest.ll | 30 +-- test/Transforms/SCCP/logical-nuke.ll | 9 +- test/Transforms/SCCP/phitest.ll | 35 ++- test/Transforms/SCCP/sccptest.ll | 44 ++-- test/Transforms/SCCP/select.ll | 15 +- 23 files changed, 421 insertions(+), 480 deletions(-) diff --git a/test/Transforms/SCCP/2002-05-02-EdgeFailure.ll b/test/Transforms/SCCP/2002-05-02-EdgeFailure.ll index 2136ca644c8..13b45f59a94 100644 --- a/test/Transforms/SCCP/2002-05-02-EdgeFailure.ll +++ b/test/Transforms/SCCP/2002-05-02-EdgeFailure.ll @@ -5,19 +5,22 @@ ; real benchmark (mst from Olden benchmark, MakeGraph function). When SCCP is ; fixed, this should be eliminated by a single SCCP application. ; -; RUN: llvm-upgrade < %s | llvm-as | opt -sccp | llvm-dis | not grep loop +; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep loop -int* %test() { +define i32* @test() { bb1: - %A = malloc int + %A = malloc i32 ; [#uses=2] br label %bb2 -bb2: - %i = phi int [ %i2, %bb2 ], [ 0, %bb1 ] ;; Always 0 - %i2 = add int %i, 1 ;; Always 1 - store int %i, int *%A - %loop = setle int %i2, 0 ;; Always false - br bool %loop, label %bb2, label %bb3 - -bb3: - ret int * %A +bb2: ; preds = %bb2, %bb1 + ;; Always 0 + %i = phi i32 [ %i2, %bb2 ], [ 0, %bb1 ] ; [#uses=2] + ;; Always 1 + %i2 = add i32 %i, 1 ; [#uses=2] + store i32 %i, i32* %A + ;; Always false + %loop = icmp sle i32 %i2, 0 ; [#uses=1] + br i1 %loop, label %bb2, label %bb3 +bb3: ; preds = %bb2 + ret i32* %A } + diff --git a/test/Transforms/SCCP/2002-05-02-MissSecondInst.ll b/test/Transforms/SCCP/2002-05-02-MissSecondInst.ll index 24e99b19e39..fd4083d1374 100644 --- a/test/Transforms/SCCP/2002-05-02-MissSecondInst.ll +++ b/test/Transforms/SCCP/2002-05-02-MissSecondInst.ll @@ -1,7 +1,8 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -sccp | llvm-dis | not grep sub +; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep sub -void %test3(int, int) { - add int 0, 0 - sub int 0, 4 - ret void +define void @test3(i32, i32) { + add i32 0, 0 ; :3 [#uses=0] + sub i32 0, 4 ; :4 [#uses=0] + ret void } + diff --git a/test/Transforms/SCCP/2002-05-20-MissedIncomingValue.ll b/test/Transforms/SCCP/2002-05-20-MissedIncomingValue.ll index c851efdb0e1..61bf5db4444 100644 --- a/test/Transforms/SCCP/2002-05-20-MissedIncomingValue.ll +++ b/test/Transforms/SCCP/2002-05-20-MissedIncomingValue.ll @@ -1,20 +1,19 @@ ; This test shows a case where SCCP is incorrectly eliminating the PHI node ; because it thinks it has a constant 0 value, when it really doesn't. -; RUN: llvm-upgrade < %s | llvm-as | opt -sccp | llvm-dis | grep phi +; RUN: llvm-as < %s | opt -sccp | llvm-dis | grep phi -int "test"(int %A, bool %c) { +define i32 @test(i32 %A, i1 %c) { bb1: br label %BB2 -BB2: - %V = phi int [0, %bb1], [%A, %BB4] +BB2: ; preds = %BB4, %bb1 + %V = phi i32 [ 0, %bb1 ], [ %A, %BB4 ] ; [#uses=1] br label %BB3 - -BB3: - br bool %c, label %BB4, label %BB5 -BB4: +BB3: ; preds = %BB2 + br i1 %c, label %BB4, label %BB5 +BB4: ; preds = %BB3 br label %BB2 - -BB5: - ret int %V +BB5: ; preds = %BB3 + ret i32 %V } + diff --git a/test/Transforms/SCCP/2002-05-21-InvalidSimplify.ll b/test/Transforms/SCCP/2002-05-21-InvalidSimplify.ll index 231bdb95cd7..b46d23a9dcf 100644 --- a/test/Transforms/SCCP/2002-05-21-InvalidSimplify.ll +++ b/test/Transforms/SCCP/2002-05-21-InvalidSimplify.ll @@ -2,39 +2,32 @@ ; this is in fact NOT the case, so the return should still be alive in the code ; after sccp and CFG simplification have been performed. ; -; RUN: llvm-upgrade < %s | llvm-as | opt -sccp -simplifycfg | llvm-dis | \ +; RUN: llvm-as < %s | opt -sccp -simplifycfg | llvm-dis | \ ; RUN: grep ret - -void "old_main"() { -bb3: ;[#uses=1] +define void @old_main() { +bb3: br label %bb6 - -bb6: ;[#uses=3] - %reg403 = phi int [ %reg155, %bb14 ], [ 0, %bb3 ] ; [#uses=2] - %reg155 = add int %reg403, 1 ; [#uses=3] - +bb6: ; preds = %bb14, %bb3 + %reg403 = phi i32 [ %reg155, %bb14 ], [ 0, %bb3 ] ; [#uses=1] + %reg155 = add i32 %reg403, 1 ; [#uses=2] br label %bb11 - -bb11: - %reg407 = phi int [ %reg408, %bb11 ], [ 0, %bb6 ] ; [#uses=2] - %reg408 = add int %reg407, 1 ; [#uses=2] - %cond550 = setle int %reg407, 1 ; [#uses=1] - br bool %cond550, label %bb11, label %bb12 - -bb12: ;[#uses=2] +bb11: ; preds = %bb11, %bb6 + %reg407 = phi i32 [ %reg408, %bb11 ], [ 0, %bb6 ] ; [#uses=2] + %reg408 = add i32 %reg407, 1 ; [#uses=1] + %cond550 = icmp sle i32 %reg407, 1 ; [#uses=1] + br i1 %cond550, label %bb11, label %bb12 +bb12: ; preds = %bb11 br label %bb13 - -bb13: ;[#uses=3] - %reg409 = phi int [ %reg410, %bb13 ], [ 0, %bb12 ] ; [#uses=1] - %reg410 = add int %reg409, 1 ; [#uses=2] - %cond552 = setle int %reg410, 2 ; [#uses=1] - br bool %cond552, label %bb13, label %bb14 - -bb14: ;[#uses=2] - %cond553 = setle int %reg155, 31 ; [#uses=1] - br bool %cond553, label %bb6, label %bb15 - -bb15: ;[#uses=1] +bb13: ; preds = %bb13, %bb12 + %reg409 = phi i32 [ %reg410, %bb13 ], [ 0, %bb12 ] ; [#uses=1] + %reg410 = add i32 %reg409, 1 ; [#uses=2] + %cond552 = icmp sle i32 %reg410, 2 ; [#uses=1] + br i1 %cond552, label %bb13, label %bb14 +bb14: ; preds = %bb13 + %cond553 = icmp sle i32 %reg155, 31 ; [#uses=1] + br i1 %cond553, label %bb6, label %bb15 +bb15: ; preds = %bb14 ret void } + diff --git a/test/Transforms/SCCP/2002-08-30-GetElementPtrTest.ll b/test/Transforms/SCCP/2002-08-30-GetElementPtrTest.ll index 1577685717b..c5a7c790bd2 100644 --- a/test/Transforms/SCCP/2002-08-30-GetElementPtrTest.ll +++ b/test/Transforms/SCCP/2002-08-30-GetElementPtrTest.ll @@ -1,10 +1,9 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -sccp | llvm-dis | not grep %X +; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep %X -%G = uninitialized global [40x int] +@G = external global [40 x i32] ; <[40 x i32]*> [#uses=1] -implementation - -int* %test() { - %X = getelementptr [40x int]* %G, uint 0, uint 0 - ret int* %X +define i32* @test() { + %X = getelementptr [40 x i32]* @G, i64 0, i64 0 ; [#uses=1] + ret i32* %X } + diff --git a/test/Transforms/SCCP/2003-06-24-OverdefinedPHIValue.ll b/test/Transforms/SCCP/2003-06-24-OverdefinedPHIValue.ll index fd4713a31ed..03ff4dde8a1 100644 --- a/test/Transforms/SCCP/2003-06-24-OverdefinedPHIValue.ll +++ b/test/Transforms/SCCP/2003-06-24-OverdefinedPHIValue.ll @@ -1,34 +1,30 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -sccp -simplifycfg | llvm-dis | \ +; RUN: llvm-as < %s | opt -sccp -simplifycfg | llvm-dis | \ ; RUN: not grep then: -void %cprop_test11(int* %data.1) { -entry: ; No predecessors! - %tmp.1 = load int* %data.1 ; [#uses=3] - %tmp.41 = setgt int %tmp.1, 1 ; [#uses=1] - br bool %tmp.41, label %no_exit, label %loopexit - -no_exit: ; preds = %entry, %then, %endif - %j.0 = phi int [ %j.0, %endif ], [ %i.0, %then ], [ 1, %entry ] ; [#uses=3] - %i.0 = phi int [ %inc, %endif ], [ %inc1, %then ], [ 1, %entry ] ; [#uses=4] - %tmp.8.not = cast int %j.0 to bool ; [#uses=1] - br bool %tmp.8.not, label %endif, label %then - +define void @cprop_test11(i32* %data.1) { +entry: + %tmp.1 = load i32* %data.1 ; [#uses=3] + %tmp.41 = icmp sgt i32 %tmp.1, 1 ; [#uses=1] + br i1 %tmp.41, label %no_exit, label %loopexit +no_exit: ; preds = %endif, %then, %entry + %j.0 = phi i32 [ %j.0, %endif ], [ %i.0, %then ], [ 1, %entry ] ; [#uses=3] + %i.0 = phi i32 [ %inc, %endif ], [ %inc1, %then ], [ 1, %entry ] ; [#uses=4] + %tmp.8.not = icmp ne i32 %j.0, 0 ; [#uses=1] + br i1 %tmp.8.not, label %endif, label %then then: ; preds = %no_exit - %inc1 = add int %i.0, 1 ; [#uses=3] - %tmp.42 = setlt int %inc1, %tmp.1 ; [#uses=1] - br bool %tmp.42, label %no_exit, label %loopexit - + %inc1 = add i32 %i.0, 1 ; [#uses=3] + %tmp.42 = icmp slt i32 %inc1, %tmp.1 ; [#uses=1] + br i1 %tmp.42, label %no_exit, label %loopexit endif: ; preds = %no_exit - %inc = add int %i.0, 1 ; [#uses=3] - %tmp.4 = setlt int %inc, %tmp.1 ; [#uses=1] - br bool %tmp.4, label %no_exit, label %loopexit - -loopexit: ; preds = %entry, %endif, %then - %j.1 = phi int [ 1, %entry ], [ %j.0, %endif ], [ %i.0, %then ] ; [#uses=1] - %i.1 = phi int [ 1, %entry ], [ %inc, %endif ], [ %inc1, %then ] ; [#uses=1] - %tmp.17 = getelementptr int* %data.1, long 1 ; [#uses=1] - store int %j.1, int* %tmp.17 - %tmp.23 = getelementptr int* %data.1, long 2 ; [#uses=1] - store int %i.1, int* %tmp.23 + %inc = add i32 %i.0, 1 ; [#uses=3] + %tmp.4 = icmp slt i32 %inc, %tmp.1 ; [#uses=1] + br i1 %tmp.4, label %no_exit, label %loopexit +loopexit: ; preds = %endif, %then, %entry + %j.1 = phi i32 [ 1, %entry ], [ %j.0, %endif ], [ %i.0, %then ] ; [#uses=1] + %i.1 = phi i32 [ 1, %entry ], [ %inc, %endif ], [ %inc1, %then ] ; [#uses=1] + %tmp.17 = getelementptr i32* %data.1, i64 1 ; [#uses=1] + store i32 %j.1, i32* %tmp.17 + %tmp.23 = getelementptr i32* %data.1, i64 2 ; [#uses=1] + store i32 %i.1, i32* %tmp.23 ret void } diff --git a/test/Transforms/SCCP/2003-08-26-InvokeHandling.ll b/test/Transforms/SCCP/2003-08-26-InvokeHandling.ll index 36bfba4a404..020af7d16c7 100644 --- a/test/Transforms/SCCP/2003-08-26-InvokeHandling.ll +++ b/test/Transforms/SCCP/2003-08-26-InvokeHandling.ll @@ -1,15 +1,18 @@ ; The PHI cannot be eliminated from this testcase, SCCP is mishandling invoke's! -; RUN: llvm-upgrade < %s | llvm-as | opt -sccp | llvm-dis | grep phi +; RUN: llvm-as < %s | opt -sccp | llvm-dis | grep phi -declare void %foo() -int %test(bool %cond) { +declare void @foo() + +define i32 @test(i1 %cond) { Entry: - br bool %cond, label %Inv, label %Cont -Inv: - invoke void %foo() to label %Ok except label %Cont -Ok: + br i1 %cond, label %Inv, label %Cont +Inv: ; preds = %Entry + invoke void @foo( ) + to label %Ok unwind label %Cont +Ok: ; preds = %Inv br label %Cont -Cont: - %X = phi int [0, %Entry], [1,%Ok], [0, %Inv] - ret int %X +Cont: ; preds = %Ok, %Inv, %Entry + %X = phi i32 [ 0, %Entry ], [ 1, %Ok ], [ 0, %Inv ] ; [#uses=1] + ret i32 %X } + diff --git a/test/Transforms/SCCP/2004-11-16-DeadInvoke.ll b/test/Transforms/SCCP/2004-11-16-DeadInvoke.ll index 544edc0b3c5..cf64677334a 100644 --- a/test/Transforms/SCCP/2004-11-16-DeadInvoke.ll +++ b/test/Transforms/SCCP/2004-11-16-DeadInvoke.ll @@ -1,14 +1,13 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -sccp -disable-output +; RUN: llvm-as < %s | opt -sccp -disable-output -implementation +declare i32 @foo() -declare int %foo() - -void %caller() { - br bool true, label %T, label %F -F: - %X = invoke int %foo() to label %T unwind label %T - -T: +define void @caller() { + br i1 true, label %T, label %F +F: ; preds = %0 + %X = invoke i32 @foo( ) + to label %T unwind label %T ; [#uses=0] +T: ; preds = %F, %F, %0 ret void } + diff --git a/test/Transforms/SCCP/2004-12-10-UndefBranchBug.ll b/test/Transforms/SCCP/2004-12-10-UndefBranchBug.ll index c662e0f711b..6592e8b0892 100644 --- a/test/Transforms/SCCP/2004-12-10-UndefBranchBug.ll +++ b/test/Transforms/SCCP/2004-12-10-UndefBranchBug.ll @@ -1,11 +1,12 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -sccp | llvm-dis | grep {ret i32 1} +; RUN: llvm-as < %s | opt -sccp | llvm-dis | grep {ret i32 1} ; This function definitely returns 1, even if we don't know the direction ; of the branch. -int %foo() { - br bool undef, label %T, label %T -T: - %X = add int 0, 1 - ret int %X +define i32 @foo() { + br i1 undef, label %T, label %T +T: ; preds = %0, %0 + %X = add i32 0, 1 ; [#uses=1] + ret i32 %X } + diff --git a/test/Transforms/SCCP/2006-10-23-IPSCCP-Crash.ll b/test/Transforms/SCCP/2006-10-23-IPSCCP-Crash.ll index edfbe016c40..299b79f53e2 100644 --- a/test/Transforms/SCCP/2006-10-23-IPSCCP-Crash.ll +++ b/test/Transforms/SCCP/2006-10-23-IPSCCP-Crash.ll @@ -1,128 +1,103 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -sccp -disable-output - -target endian = big -target pointersize = 32 +; RUN: llvm-as < %s | opt -sccp -disable-output +; END. +target datalayout = "E-p:32:32" target triple = "powerpc-apple-darwin8.7.0" - %struct.pat_list = type { int, %struct.pat_list* } -%JUMP = external global int ; [#uses=1] -%old_D_pat = external global [16 x ubyte] ; <[16 x ubyte]*> [#uses=0] - -implementation ; Functions: + %struct.pat_list = type { i32, %struct.pat_list* } +@JUMP = external global i32 ; [#uses=1] +@old_D_pat = external global [16 x i8] ; <[16 x i8]*> [#uses=0] -void %asearch1(uint %D) { +define void @asearch1(i32 %D) { entry: - %tmp80 = setlt uint 0, %D ; [#uses=1] - br bool %tmp80, label %bb647.preheader, label %cond_true81.preheader - -cond_true81.preheader: ; preds = %entry - ret void - -bb647.preheader: ; preds = %entry - %tmp3.i = call int %read( ) ; [#uses=1] - %tmp6.i = add int %tmp3.i, 0 ; [#uses=1] - %tmp653 = setgt int %tmp6.i, 0 ; [#uses=1] - br bool %tmp653, label %cond_true654, label %UnifiedReturnBlock - -cond_true612: ; preds = %cond_true654 - ret void - -cond_next624: ; preds = %cond_true654 - ret void - -cond_true654: ; preds = %bb647.preheader - br bool undef, label %cond_true612, label %cond_next624 - -UnifiedReturnBlock: ; preds = %bb647.preheader - ret void + %tmp80 = icmp ult i32 0, %D ; [#uses=1] + br i1 %tmp80, label %bb647.preheader, label %cond_true81.preheader +cond_true81.preheader: ; preds = %entry + ret void +bb647.preheader: ; preds = %entry + %tmp3.i = call i32 @read( ) ; [#uses=1] + %tmp6.i = add i32 %tmp3.i, 0 ; [#uses=1] + %tmp653 = icmp sgt i32 %tmp6.i, 0 ; [#uses=1] + br i1 %tmp653, label %cond_true654, label %UnifiedReturnBlock +cond_true612: ; preds = %cond_true654 + ret void +cond_next624: ; preds = %cond_true654 + ret void +cond_true654: ; preds = %bb647.preheader + br i1 undef, label %cond_true612, label %cond_next624 +UnifiedReturnBlock: ; preds = %bb647.preheader + ret void } -void %bitap(int %D) { +define void @bitap(i32 %D) { entry: - %tmp29 = seteq int 0, 0 ; [#uses=1] - br bool %tmp29, label %cond_next50, label %cond_next37 - -cond_next37: ; preds = %entry - ret void - -cond_next50: ; preds = %entry - %tmp52 = setgt int %D, 0 ; [#uses=1] - br bool %tmp52, label %cond_true53, label %cond_next71 - -cond_true53: ; preds = %cond_next50 - %tmp54 = load int* %JUMP ; [#uses=1] - %tmp55 = seteq int %tmp54, 1 ; [#uses=1] - br bool %tmp55, label %cond_true56, label %cond_next63 - -cond_true56: ; preds = %cond_true53 - %tmp57 = cast int %D to uint ; [#uses=1] - call void %asearch1( uint %tmp57 ) - ret void - -cond_next63: ; preds = %cond_true53 - ret void - -cond_next71: ; preds = %cond_next50 - ret void + %tmp29 = icmp eq i32 0, 0 ; [#uses=1] + br i1 %tmp29, label %cond_next50, label %cond_next37 +cond_next37: ; preds = %entry + ret void +cond_next50: ; preds = %entry + %tmp52 = icmp sgt i32 %D, 0 ; [#uses=1] + br i1 %tmp52, label %cond_true53, label %cond_next71 +cond_true53: ; preds = %cond_next50 + %tmp54 = load i32* @JUMP ; [#uses=1] + %tmp55 = icmp eq i32 %tmp54, 1 ; [#uses=1] + br i1 %tmp55, label %cond_true56, label %cond_next63 +cond_true56: ; preds = %cond_true53 + %tmp57 = bitcast i32 %D to i32 ; [#uses=1] + call void @asearch1( i32 %tmp57 ) + ret void +cond_next63: ; preds = %cond_true53 + ret void +cond_next71: ; preds = %cond_next50 + ret void } -declare int %read() +declare i32 @read() -void %initial_value() { +define void @initial_value() { entry: - ret void + ret void } -void %main() { +define void @main() { entry: - br label %cond_next252 - -cond_next208: ; preds = %cond_true260 - %tmp229 = call int %atoi( ) ; [#uses=1] - br label %cond_next252 - -bb217: ; preds = %cond_true260 - ret void - -cond_next252: ; preds = %cond_next208, %entry - %D.0.0 = phi int [ 0, %entry ], [ %tmp229, %cond_next208 ] ; [#uses=1] - %tmp254 = getelementptr sbyte** null, int 1 ; [#uses=1] - %tmp256 = load sbyte** %tmp254 ; [#uses=1] - %tmp258 = load sbyte* %tmp256 ; [#uses=1] - %tmp259 = seteq sbyte %tmp258, 45 ; [#uses=1] - br bool %tmp259, label %cond_true260, label %bb263 - -cond_true260: ; preds = %cond_next252 - %tmp205818 = setgt sbyte 0, -1 ; [#uses=1] - br bool %tmp205818, label %cond_next208, label %bb217 - -bb263: ; preds = %cond_next252 - %tmp265 = seteq int 0, 0 ; [#uses=1] - br bool %tmp265, label %cond_next276, label %cond_true266 - -cond_true266: ; preds = %bb263 - ret void - -cond_next276: ; preds = %bb263 - %tmp278 = seteq int 0, 0 ; [#uses=1] - br bool %tmp278, label %cond_next298, label %cond_true279 - -cond_true279: ; preds = %cond_next276 - ret void - -cond_next298: ; preds = %cond_next276 - call void %bitap( int %D.0.0 ) - ret void + br label %cond_next252 +cond_next208: ; preds = %cond_true260 + %tmp229 = call i32 @atoi( ) ; [#uses=1] + br label %cond_next252 +bb217: ; preds = %cond_true260 + ret void +cond_next252: ; preds = %cond_next208, %entry + %D.0.0 = phi i32 [ 0, %entry ], [ %tmp229, %cond_next208 ] ; [#uses=1] + %tmp254 = getelementptr i8** null, i32 1 ; [#uses=1] + %tmp256 = load i8** %tmp254 ; [#uses=1] + %tmp258 = load i8* %tmp256 ; [#uses=1] + %tmp259 = icmp eq i8 %tmp258, 45 ; [#uses=1] + br i1 %tmp259, label %cond_true260, label %bb263 +cond_true260: ; preds = %cond_next252 + %tmp205818 = icmp sgt i8 0, -1 ; [#uses=1] + br i1 %tmp205818, label %cond_next208, label %bb217 +bb263: ; preds = %cond_next252 + %tmp265 = icmp eq i32 0, 0 ; [#uses=1] + br i1 %tmp265, label %cond_next276, label %cond_true266 +cond_true266: ; preds = %bb263 + ret void +cond_next276: ; preds = %bb263 + %tmp278 = icmp eq i32 0, 0 ; [#uses=1] + br i1 %tmp278, label %cond_next298, label %cond_true279 +cond_true279: ; preds = %cond_next276 + ret void +cond_next298: ; preds = %cond_next276 + call void @bitap( i32 %D.0.0 ) + ret void } -declare int %atoi() +declare i32 @atoi() -void %subset_pset() { +define void @subset_pset() { entry: - ret void + ret void } -void %strcmp() { +define void @strcmp() { entry: - ret void + ret void } - diff --git a/test/Transforms/SCCP/2006-12-04-PackedType.ll b/test/Transforms/SCCP/2006-12-04-PackedType.ll index 4868c30783e..b7a7880b0fa 100644 --- a/test/Transforms/SCCP/2006-12-04-PackedType.ll +++ b/test/Transforms/SCCP/2006-12-04-PackedType.ll @@ -1,150 +1,140 @@ -; Test VectorType handling by SCCP. +; Test VectorType handling by SCCP. ; SCCP ignores VectorTypes until PR 1034 is fixed ; -; RUN: llvm-upgrade < %s | llvm-as | opt -sccp +; RUN: llvm-as < %s | opt -sccp ; END. + target datalayout = "E-p:32:32" -target endian = big -target pointersize = 32 target triple = "powerpc-apple-darwin8" - %struct.GLDAlphaTest = type { float, ushort, ubyte, ubyte } - %struct.GLDArrayRange = type { ubyte, ubyte, ubyte, ubyte } - %struct.GLDBlendMode = type { ushort, ushort, ushort, ushort, %struct.GLTColor4, ushort, ushort, ubyte, ubyte, ubyte, ubyte } + %struct.GLDAlphaTest = type { float, i16, i8, i8 } + %struct.GLDArrayRange = type { i8, i8, i8, i8 } + %struct.GLDBlendMode = type { i16, i16, i16, i16, %struct.GLTColor4, i16, i16, i8, i8, i8, i8 } %struct.GLDBufferRec = type opaque - %struct.GLDBufferstate = type { %struct.GLTDimensions, %struct.GLTDimensions, %struct.GLTFixedColor4, %struct.GLTFixedColor4, ubyte, ubyte, ubyte, ubyte, [2 x %struct.GLSBuffer], [4 x %struct.GLSBuffer], %struct.GLSBuffer, %struct.GLSBuffer, %struct.GLSBuffer, [4 x %struct.GLSBuffer*], %struct.GLSBuffer*, %struct.GLSBuffer*, %struct.GLSBuffer*, ubyte, ubyte } - %struct.GLDClearColor = type { double, %struct.GLTColor4, %struct.GLTColor4, float, int } - %struct.GLDClipPlane = type { uint, [6 x %struct.GLTColor4] } - %struct.GLDColorBuffer = type { ushort, ushort, [4 x ushort] } + %struct.GLDBufferstate = type { %struct.GLTDimensions, %struct.GLTDimensions, %struct.GLTFixedColor4, %struct.GLTFixedColor4, i8, i8, i8, i8, [2 x %struct.GLSBuffer], [4 x %struct.GLSBuffer], %struct.GLSBuffer, %struct.GLSBuffer, %struct.GLSBuffer, [4 x %struct.GLSBuffer*], %struct.GLSBuffer*, %struct.GLSBuffer*, %struct.GLSBuffer*, i8, i8 } + %struct.GLDClearColor = type { double, %struct.GLTColor4, %struct.GLTColor4, float, i32 } + %struct.GLDClipPlane = type { i32, [6 x %struct.GLTColor4] } + %struct.GLDColorBuffer = type { i16, i16, [4 x i16] } %struct.GLDColorMatrix = type { [16 x float]*, %struct.GLDImagingColorScale } - %struct.GLDContextRec = type { float, float, float, float, float, float, float, float, %struct.GLTColor4, %struct.GLTColor4, %struct.GLVMFPContext, %struct.GLDTextureMachine, %struct.GLGProcessor, %struct._GLVMConstants*, void (%struct.GLDContextRec*, int, int, %struct.GLVMFragmentAttribRec*, %struct.GLVMFragmentAttribRec*, int)*, %struct._GLVMFunction*, void (%struct.GLDContextRec*, %struct.GLDVertex*)*, void (%struct.GLDContextRec*, %struct.GLDVertex*, %struct.GLDVertex*)*, void (%struct.GLDContextRec*, %struct.GLDVertex*, %struct.GLDVertex*, %struct.GLDVertex*)*, %struct._GLVMFunction*, %struct._GLVMFunction*, %struct._GLVMFunction*, uint, uint, uint, float, float, float, uint, %struct.GLSDrawable, %struct.GLDRect, %struct.GLDFormat, %struct.GLDBufferstate, %struct.GLDSharedRec*, %struct.GLDState*, %struct.GLDPluginState*, %struct.GLTDimensions, %struct.GLTColor4*, %struct.GLTColor4*, %struct.GLVMFragmentAttribRec*, %struct.GLVMFragmentAttribRec*, %struct.GLVMFragmentAttribRec*, %struct.GLDPipelineProgramRec*, %struct.GLDStateProgramRec, %struct.GLVMTextures, { [4 x sbyte*], sbyte*, sbyte* }, [64 x float], %struct.GLDStippleData, ushort, ubyte, ubyte, uint, %struct.GLDFramebufferRec*, ubyte, %struct.GLDQueryRec*, %struct.GLDQueryRec* } - %struct.GLDConvolution = type { %struct.GLTColor4, %struct.GLDImagingColorScale, ushort, ushort, float*, int, int } - %struct.GLDDepthTest = type { ushort, ushort, ubyte, ubyte, ubyte, ubyte, double, double } - %struct.GLDFogMode = type { %struct.GLTColor4, float, float, float, float, float, ushort, ushort, ushort, ubyte, ubyte } - %struct.GLDFormat = type { int, int, int, int, int, int, uint, uint, ubyte, ubyte, ubyte, ubyte, int, int, int } - %struct.GLDFramebufferAttachment = type { uint, uint, uint, int, uint, uint } - %struct.GLDFramebufferData = type { [6 x %struct.GLDFramebufferAttachment], [4 x ushort], ushort, ushort, ushort, ushort, uint } + %struct.GLDContextRec = type { float, float, float, float, float, float, float, float, %struct.GLTColor4, %struct.GLTColor4, %struct.GLVMFPContext, %struct.GLDTextureMachine, %struct.GLGProcessor, %struct._GLVMConstants*, void (%struct.GLDContextRec*, i32, i32, %struct.GLVMFragmentAttribRec*, %struct.GLVMFragmentAttribRec*, i32)*, %struct._GLVMFunction*, void (%struct.GLDContextRec*, %struct.GLDVertex*)*, void (%struct.GLDContextRec*, %struct.GLDVertex*, %struct.GLDVertex*)*, void (%struct.GLDContextRec*, %struct.GLDVertex*, %struct.GLDVertex*, %struct.GLDVertex*)*, %struct._GLVMFunction*, %struct._GLVMFunction*, %struct._GLVMFunction*, i32, i32, i32, float, float, float, i32, %struct.GLSDrawable, %struct.GLDFramebufferAttachment, %struct.GLDFormat, %struct.GLDBufferstate, %struct.GLDSharedRec*, %struct.GLDState*, %struct.GLDPluginState*, %struct.GLTDimensions, %struct.GLTColor4*, %struct.GLTColor4*, %struct.GLVMFragmentAttribRec*, %struct.GLVMFragmentAttribRec*, %struct.GLVMFragmentAttribRec*, %struct.GLDPipelineProgramRec*, %struct.GLDStateProgramRec, %struct.GLVMTextures, { [4 x i8*], i8*, i8* }, [64 x float], %struct.GLDStippleData, i16, i8, i8, i32, %struct.GLDFramebufferRec*, i8, %struct.GLDQueryRec*, %struct.GLDQueryRec* } + %struct.GLDConvolution = type { %struct.GLTColor4, %struct.GLDImagingColorScale, i16, i16, float*, i32, i32 } + %struct.GLDDepthTest = type { i16, i16, i8, i8, i8, i8, double, double } + %struct.GLDFogMode = type { %struct.GLTColor4, float, float, float, float, float, i16, i16, i16, i8, i8 } + %struct.GLDFormat = type { i32, i32, i32, i32, i32, i32, i32, i32, i8, i8, i8, i8, i32, i32, i32 } + %struct.GLDFramebufferAttachment = type { i32, i32, i32, i32, i32, i32 } + %struct.GLDFramebufferData = type { [6 x %struct.GLDFramebufferAttachment], [4 x i16], i16, i16, i16, i16, i32 } %struct.GLDFramebufferRec = type { %struct.GLDFramebufferData*, %struct.GLDPluginFramebufferData*, %struct.GLDPixelFormat } - %struct.GLDHintMode = type { ushort, ushort, ushort, ushort, ushort, ushort, ushort, ushort, ushort, ushort } - %struct.GLDHistogram = type { %struct.GLTFixedColor4*, int, ushort, ubyte, ubyte } + %struct.GLDHintMode = type { i16, i16, i16, i16, i16, i16, i16, i16, i16, i16 } + %struct.GLDHistogram = type { %struct.GLTFixedColor4*, i32, i16, i8, i8 } %struct.GLDImagingColorScale = type { { float, float }, { float, float }, { float, float }, { float, float } } - %struct.GLDImagingSubset = type { %struct.GLDConvolution, %struct.GLDConvolution, %struct.GLDConvolution, %struct.GLDColorMatrix, %struct.GLDMinmax, %struct.GLDHistogram, %struct.GLDImagingColorScale, %struct.GLDImagingColorScale, %struct.GLDImagingColorScale, %struct.GLDImagingColorScale, uint } + %struct.GLDImagingSubset = type { %struct.GLDConvolution, %struct.GLDConvolution, %struct.GLDConvolution, %struct.GLDColorMatrix, %struct.GLDMinmax, %struct.GLDHistogram, %struct.GLDImagingColorScale, %struct.GLDImagingColorScale, %struct.GLDImagingColorScale, %struct.GLDImagingColorScale, i32 } %struct.GLDLight = type { %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTCoord3, float, float, float, float, float, %struct.GLTCoord3, float, float, float, float, float } - %struct.GLDLightModel = type { %struct.GLTColor4, [8 x %struct.GLDLight], [2 x %struct.GLDMaterial], uint, ushort, ushort, ushort, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte } + %struct.GLDLightModel = type { %struct.GLTColor4, [8 x %struct.GLDLight], [2 x %struct.GLDMaterial], i32, i16, i16, i16, i8, i8, i8, i8, i8, i8 } %struct.GLDLightProduct = type { %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4 } - %struct.GLDLineMode = type { float, int, ushort, ushort, ubyte, ubyte, ubyte, ubyte } - %struct.GLDLogicOp = type { ushort, ubyte, ubyte } - %struct.GLDMaskMode = type { uint, [3 x uint], ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte } - %struct.GLDMaterial = type { %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, float, float, float, float, [8 x %struct.GLDLightProduct], %struct.GLTColor4, [6 x int], [2 x int] } - %struct.GLDMinmax = type { %struct.GLDMinmaxTable*, ushort, ubyte, ubyte } + %struct.GLDLineMode = type { float, i32, i16, i16, i8, i8, i8, i8 } + %struct.GLDLogicOp = type { i16, i8, i8 } + %struct.GLDMaskMode = type { i32, [3 x i32], i8, i8, i8, i8, i8, i8, i8, i8 } + %struct.GLDMaterial = type { %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, float, float, float, float, [8 x %struct.GLDLightProduct], %struct.GLTColor4, [6 x i32], [2 x i32] } + %struct.GLDMinmax = type { %struct.GLDMinmaxTable*, i16, i8, i8 } %struct.GLDMinmaxTable = type { %struct.GLTColor4, %struct.GLTColor4 } - %struct.GLDMipmaplevel = type { [4 x uint], [4 x float], [4 x uint], [4 x uint], [4 x float], [4 x uint], [3 x uint], uint, float*, float*, float*, uint, uint, sbyte*, short, ushort, ushort, short } - %struct.GLDMultisample = type { float, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte } - %struct.GLDPipelineProgramData = type { ushort, ushort, uint, %struct._PPStreamToken*, ulong, %struct.GLDShaderSourceData*, %struct.GLTColor4*, uint } - %struct.GLDPipelineProgramRec = type { %struct.GLDPipelineProgramData*, %struct._PPStreamToken*, %struct._PPStreamToken*, %struct._GLVMFunction*, uint, uint, uint } - %struct.GLDPipelineProgramState = type { ubyte, ubyte, ubyte, ubyte, %struct.GLTColor4* } - %struct.GLDPixelFormat = type { ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte } - %struct.GLDPixelMap = type { int*, float*, float*, float*, float*, float*, float*, float*, float*, int*, int, int, int, int, int, int, int, int, int, int } - %struct.GLDPixelMode = type { float, float, %struct.GLDPixelStore, %struct.GLDPixelTransfer, %struct.GLDPixelMap, %struct.GLDImagingSubset, uint, uint } - %struct.GLDPixelPack = type { int, int, int, int, int, int, int, int, ubyte, ubyte, ubyte, ubyte } + %struct.GLDMipmaplevel = type { [4 x i32], [4 x float], [4 x i32], [4 x i32], [4 x float], [4 x i32], [3 x i32], i32, float*, float*, float*, i32, i32, i8*, i16, i16, i16, i16 } + %struct.GLDMultisample = type { float, i8, i8, i8, i8, i8, i8, i8, i8 } + %struct.GLDPipelineProgramData = type { i16, i16, i32, %struct._PPStreamToken*, i64, %struct.GLDShaderSourceData*, %struct.GLTColor4*, i32 } + %struct.GLDPipelineProgramRec = type { %struct.GLDPipelineProgramData*, %struct._PPStreamToken*, %struct._PPStreamToken*, %struct._GLVMFunction*, i32, i32, i32 } + %struct.GLDPipelineProgramState = type { i8, i8, i8, i8, %struct.GLTColor4* } + %struct.GLDPixelFormat = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } + %struct.GLDPixelMap = type { i32*, float*, float*, float*, float*, float*, float*, float*, float*, i32*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 } + %struct.GLDPixelMode = type { float, float, %struct.GLDPixelStore, %struct.GLDPixelTransfer, %struct.GLDPixelMap, %struct.GLDImagingSubset, i32, i32 } + %struct.GLDPixelPack = type { i32, i32, i32, i32, i32, i32, i32, i32, i8, i8, i8, i8 } %struct.GLDPixelStore = type { %struct.GLDPixelPack, %struct.GLDPixelPack } - %struct.GLDPixelTransfer = type { float, float, float, float, float, float, float, float, float, float, int, int, float, float, float, float, float, float, float, float, float, float, float, float } - %struct.GLDPluginFramebufferData = type { [6 x %struct.GLDTextureRec*], uint, uint } - %struct.GLDPluginProgramData = type { [3 x %struct.GLDPipelineProgramRec*], %struct.GLDBufferRec**, uint } + %struct.GLDPixelTransfer = type { float, float, float, float, float, float, float, float, float, float, i32, i32, float, float, float, float, float, float, float, float, float, float, float, float } + %struct.GLDPluginFramebufferData = type { [6 x %struct.GLDTextureRec*], i32, i32 } + %struct.GLDPluginProgramData = type { [3 x %struct.GLDPipelineProgramRec*], %struct.GLDBufferRec**, i32 } %struct.GLDPluginState = type { [16 x [5 x %struct.GLDTextureRec*]], [3 x %struct.GLDTextureRec*], [16 x %struct.GLDTextureRec*], [3 x %struct.GLDPipelineProgramRec*], %struct.GLDProgramRec*, %struct.GLDVertexArrayRec*, [16 x %struct.GLDBufferRec*], %struct.GLDFramebufferRec*, %struct.GLDFramebufferRec* } - %struct.GLDPointMode = type { float, float, float, float, %struct.GLTCoord3, float, ubyte, ubyte, ubyte, ubyte, ushort, ushort, uint, ushort, ushort } - %struct.GLDPolygonMode = type { [128 x ubyte], float, float, ushort, ushort, ushort, ushort, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte } - %struct.GLDProgramData = type { uint, [16 x int], int, int, uint, int } - %struct.GLDProgramRec = type { %struct.GLDProgramData*, %struct.GLDPluginProgramData*, uint } - %struct.GLDQueryRec = type { uint, uint, %struct.GLDQueryRec* } - %struct.GLDRect = type { int, int, int, int, int, int } - %struct.GLDRegisterCombiners = type { ubyte, ubyte, ubyte, ubyte, int, [2 x %struct.GLTColor4], [8 x %struct.GLDRegisterCombinersPerStageState], %struct.GLDRegisterCombinersFinalStageState } - %struct.GLDRegisterCombinersFinalStageState = type { ubyte, ubyte, ubyte, ubyte, [7 x %struct.GLDRegisterCombinersPerVariableState] } - %struct.GLDRegisterCombinersPerPortionState = type { [4 x %struct.GLDRegisterCombinersPerVariableState], ubyte, ubyte, ubyte, ubyte, ushort, ushort, ushort, ushort, ushort, ushort } + %struct.GLDPointMode = type { float, float, float, float, %struct.GLTCoord3, float, i8, i8, i8, i8, i16, i16, i32, i16, i16 } + %struct.GLDPolygonMode = type { [128 x i8], float, float, i16, i16, i16, i16, i8, i8, i8, i8, i8, i8, i8, i8 } + %struct.GLDProgramData = type { i32, [16 x i32], i32, i32, i32, i32 } + %struct.GLDProgramRec = type { %struct.GLDProgramData*, %struct.GLDPluginProgramData*, i32 } + %struct.GLDQueryRec = type { i32, i32, %struct.GLDQueryRec* } + %struct.GLDRect = type { i32, i32, i32, i32, i32, i32 } + %struct.GLDRegisterCombiners = type { i8, i8, i8, i8, i32, [2 x %struct.GLTColor4], [8 x %struct.GLDRegisterCombinersPerStageState], %struct.GLDRegisterCombinersFinalStageState } + %struct.GLDRegisterCombinersFinalStageState = type { i8, i8, i8, i8, [7 x %struct.GLDRegisterCombinersPerVariableState] } + %struct.GLDRegisterCombinersPerPortionState = type { [4 x %struct.GLDRegisterCombinersPerVariableState], i8, i8, i8, i8, i16, i16, i16, i16, i16, i16 } %struct.GLDRegisterCombinersPerStageState = type { [2 x %struct.GLDRegisterCombinersPerPortionState], [2 x %struct.GLTColor4] } - %struct.GLDRegisterCombinersPerVariableState = type { ushort, ushort, ushort, ushort } - %struct.GLDScissorTest = type { %struct.GLTFixedColor4, ubyte, ubyte, ubyte, ubyte } - %struct.GLDShaderSourceData = type { uint, uint, sbyte*, int*, uint, uint, sbyte*, int*, sbyte* } + %struct.GLDRegisterCombinersPerVariableState = type { i16, i16, i16, i16 } + %struct.GLDScissorTest = type { %struct.GLTFixedColor4, i8, i8, i8, i8 } + %struct.GLDShaderSourceData = type { i32, i32, i8*, i32*, i32, i32, i8*, i32*, i8* } %struct.GLDSharedRec = type opaque - %struct.GLDState = type { short, short, uint, uint, uint, [256 x %struct.GLTColor4], [128 x %struct.GLTColor4], %struct.GLDViewport, %struct.GLDTransform, %struct.GLDLightModel, uint*, int, int, int, %struct.GLDAlphaTest, %struct.GLDBlendMode, %struct.GLDClearColor, %struct.GLDColorBuffer, %struct.GLDDepthTest, %struct.GLDArrayRange, %struct.GLDFogMode, %struct.GLDHintMode, %struct.GLDLineMode, %struct.GLDLogicOp, %struct.GLDMaskMode, %struct.GLDPixelMode, %struct.GLDPointMode, %struct.GLDPolygonMode, %struct.GLDScissorTest, uint, %struct.GLDStencilTest, [16 x %struct.GLDTextureMode], %struct.GLDArrayRange, [8 x %struct.GLDTextureCoordGen], %struct.GLDClipPlane, %struct.GLDMultisample, %struct.GLDRegisterCombiners, %struct.GLDArrayRange, %struct.GLDArrayRange, [3 x %struct.GLDPipelineProgramState], %struct.GLDTransformFeedback } + %struct.GLDState = type { i16, i16, i32, i32, i32, [256 x %struct.GLTColor4], [128 x %struct.GLTColor4], %struct.GLDViewport, %struct.GLDTransform, %struct.GLDLightModel, i32*, i32, i32, i32, %struct.GLDAlphaTest, %struct.GLDBlendMode, %struct.GLDClearColor, %struct.GLDColorBuffer, %struct.GLDDepthTest, %struct.GLDArrayRange, %struct.GLDFogMode, %struct.GLDHintMode, %struct.GLDLineMode, %struct.GLDLogicOp, %struct.GLDMaskMode, %struct.GLDPixelMode, %struct.GLDPointMode, %struct.GLDPolygonMode, %struct.GLDScissorTest, i32, %struct.GLDStencilTest, [16 x %struct.GLDTextureMode], %struct.GLDArrayRange, [8 x %struct.GLDTextureCoordGen], %struct.GLDClipPlane, %struct.GLDMultisample, %struct.GLDRegisterCombiners, %struct.GLDArrayRange, %struct.GLDArrayRange, [3 x %struct.GLDPipelineProgramState], %struct.GLDTransformFeedback } %struct.GLDStateProgramRec = type { %struct.GLDPipelineProgramData*, %struct.GLDPipelineProgramRec* } - %struct.GLDStencilTest = type { [3 x { uint, int, ushort, ushort, ushort, ushort }], uint, [4 x ubyte] } - %struct.GLDStippleData = type { uint, ushort, ushort, [32 x [32 x ubyte]] } - %struct.GLDTextureCoordGen = type { { ushort, ushort, %struct.GLTColor4, %struct.GLTColor4 }, { ushort, ushort, %struct.GLTColor4, %struct.GLTColor4 }, { ushort, ushort, %struct.GLTColor4, %struct.GLTColor4 }, { ushort, ushort, %struct.GLTColor4, %struct.GLTColor4 }, ubyte, ubyte, ubyte, ubyte } - %struct.GLDTextureGeomState = type { ushort, ushort, ushort, ushort, ushort, ubyte, ubyte, ushort, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, [6 x ushort], [6 x ushort] } - %struct.GLDTextureLevel = type { uint, uint, ushort, ushort, ushort, ubyte, ubyte, ushort, ushort, ushort, ushort, ubyte* } - %struct.GLDTextureMachine = type { [8 x %struct.GLDTextureRec*], %struct.GLDTextureRec*, ubyte, ubyte, ubyte, ubyte } - %struct.GLDTextureMode = type { %struct.GLTColor4, uint, ushort, ushort, ushort, ushort, ushort, ushort, ushort, ushort, ushort, ushort, ushort, ushort, ushort, ushort, ushort, ushort, float, float, float, ushort, ushort, ushort, ushort, ushort, ushort, [4 x ushort], ubyte, ubyte, ubyte, ubyte, [3 x float], [4 x float], float, float } - %struct.GLDTextureParamState = type { ushort, ushort, ushort, ushort, ushort, ushort, %struct.GLTColor4, float, float, float, float, short, short, ushort, ushort, float, ushort, ubyte, ubyte, int, sbyte* } - %struct.GLDTextureRec = type { %struct.GLDTextureState*, int, [2 x float], float, uint, float, float, float, float, float, float, %struct.GLDMipmaplevel*, %struct.GLDMipmaplevel*, int, int, uint, uint, uint, uint, %struct.GLDTextureParamState, uint, [2 x %struct._PPStreamToken] } - %struct.GLDTextureState = type { ushort, ushort, ushort, float, uint, ushort, %struct.GLISWRSurface*, ubyte, ubyte, ubyte, ubyte, %struct.GLDTextureParamState, %struct.GLDTextureGeomState, %struct.GLDTextureLevel, [6 x [15 x %struct.GLDTextureLevel]] } - %struct.GLDTransform = type { [24 x [16 x float]], [24 x [16 x float]], [16 x float], float, float, float, float, int, float, ushort, ushort, ubyte, ubyte, ubyte, ubyte } - %struct.GLDTransformFeedback = type { ubyte, ubyte, ubyte, [16 x uint], [16 x uint] } - %struct.GLDVertex = type { %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTCoord3, float, %struct.GLTColor4, float, float, float, ubyte, ubyte, ubyte, ubyte, [4 x float], [2 x %struct.GLDMaterial*], uint, uint, [8 x %struct.GLTColor4] } + %struct.GLDStencilTest = type { [3 x { i32, i32, i16, i16, i16, i16 }], i32, [4 x i8] } + %struct.GLDStippleData = type { i32, i16, i16, [32 x [32 x i8]] } + %struct.GLDTextureCoordGen = type { { i16, i16, %struct.GLTColor4, %struct.GLTColor4 }, { i16, i16, %struct.GLTColor4, %struct.GLTColor4 }, { i16, i16, %struct.GLTColor4, %struct.GLTColor4 }, { i16, i16, %struct.GLTColor4, %struct.GLTColor4 }, i8, i8, i8, i8 } + %struct.GLDTextureGeomState = type { i16, i16, i16, i16, i16, i8, i8, i16, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, [6 x i16], [6 x i16] } + %struct.GLDTextureLevel = type { i32, i32, i16, i16, i16, i8, i8, i16, i16, i16, i16, i8* } + %struct.GLDTextureMachine = type { [8 x %struct.GLDTextureRec*], %struct.GLDTextureRec*, i8, i8, i8, i8 } + %struct.GLDTextureMode = type { %struct.GLTColor4, i32, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, float, float, float, i16, i16, i16, i16, i16, i16, [4 x i16], i8, i8, i8, i8, [3 x float], [4 x float], float, float } + %struct.GLDTextureParamState = type { i16, i16, i16, i16, i16, i16, %struct.GLTColor4, float, float, float, float, i16, i16, i16, i16, float, i16, i8, i8, i32, i8* } + %struct.GLDTextureRec = type { %struct.GLDTextureState*, i32, [2 x float], float, i32, float, float, float, float, float, float, %struct.GLDMipmaplevel*, %struct.GLDMipmaplevel*, i32, i32, i32, i32, i32, i32, %struct.GLDTextureParamState, i32, [2 x %struct._PPStreamToken] } + %struct.GLDTextureState = type { i16, i16, i16, float, i32, i16, %struct.GLISWRSurface*, i8, i8, i8, i8, %struct.GLDTextureParamState, %struct.GLDTextureGeomState, %struct.GLDTextureLevel, [6 x [15 x %struct.GLDTextureLevel]] } + %struct.GLDTransform = type { [24 x [16 x float]], [24 x [16 x float]], [16 x float], float, float, float, float, i32, float, i16, i16, i8, i8, i8, i8 } + %struct.GLDTransformFeedback = type { i8, i8, i8, [16 x i32], [16 x i32] } + %struct.GLDVertex = type { %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTCoord3, float, %struct.GLTColor4, float, float, float, i8, i8, i8, i8, [4 x float], [2 x %struct.GLDMaterial*], i32, i32, [8 x %struct.GLTColor4] } %struct.GLDVertexArrayRec = type opaque - %struct.GLDViewport = type { float, float, float, float, float, float, float, float, double, double, int, int, int, int, float, float, float, float } - %struct.GLGColorTable = type { uint, uint, int, sbyte* } - %struct.GLGOperation = type { sbyte*, sbyte*, int, uint, uint, int, uint, uint, uint, uint, uint, uint, uint, float, float, %struct.GLGColorTable, %struct.GLGColorTable, %struct.GLGColorTable } + %struct.GLDViewport = type { float, float, float, float, float, float, float, float, double, double, i32, i32, i32, i32, float, float, float, float } + %struct.GLGColorTable = type { i32, i32, i32, i8* } + %struct.GLGOperation = type { i8*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, float, %struct.GLGColorTable, %struct.GLGColorTable, %struct.GLGColorTable } %struct.GLGProcessor = type { void (%struct.GLDPixelMode*, %struct.GLGOperation*, %struct._GLGFunctionKey*)*, %struct._GLVMFunction*, %struct._GLGFunctionKey* } - %struct.GLISWRSurface = type { int, int, int, int, int, int, int, int, int, int, ubyte*, ubyte*, ubyte*, [4 x ubyte*], uint } - %struct.GLIWindow = type { uint, uint, uint } - %struct.GLSBuffer = type { sbyte* } + %struct.GLISWRSurface = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i8*, i8*, [4 x i8*], i32 } + %struct.GLIWindow = type { i32, i32, i32 } + %struct.GLSBuffer = type { i8* } %struct.GLSDrawable = type { %struct.GLSWindowRec* } - %struct.GLSWindowRec = type { %struct.GLTDimensions, %struct.GLTDimensions, uint, uint, %struct.GLSDrawable, [2 x ubyte*], ubyte*, ubyte*, ubyte*, [4 x ubyte*], uint, uint, uint, uint, [4 x uint], ushort, ushort, ushort, %struct.GLIWindow, uint, uint, sbyte*, ubyte* } + %struct.GLSWindowRec = type { %struct.GLTDimensions, %struct.GLTDimensions, i32, i32, %struct.GLSDrawable, [2 x i8*], i8*, i8*, i8*, [4 x i8*], i32, i32, i32, i32, [4 x i32], i16, i16, i16, %struct.GLIWindow, i32, i32, i8*, i8* } %struct.GLTColor4 = type { float, float, float, float } %struct.GLTCoord3 = type { float, float, float } - %struct.GLTDimensions = type { int, int } - %struct.GLTFixedColor4 = type { int, int, int, int } - %struct.GLVMFPContext = type { float, uint, uint, uint } + %struct.GLTDimensions = type { i32, i32 } + %struct.GLTFixedColor4 = type { i32, i32, i32, i32 } + %struct.GLVMFPContext = type { float, i32, i32, i32 } %struct.GLVMFragmentAttribRec = type { <4 x float>, <4 x float>, <4 x float>, <4 x float>, [8 x <4 x float>] } %struct.GLVMTextures = type { [8 x %struct.GLDTextureRec*] } %struct._GLGFunctionKey = type opaque %struct._GLVMConstants = type opaque %struct._GLVMFunction = type opaque - %struct._PPStreamToken = type { { ushort, ubyte, ubyte, uint } } - -implementation ; Functions: + %struct._PPStreamToken = type { { i16, i8, i8, i32 } } -void %gldLLVMVecPointRender(%struct.GLDContextRec* %ctx) { +define void @gldLLVMVecPointRender(%struct.GLDContextRec* %ctx) { entry: - %tmp.uip = getelementptr %struct.GLDContextRec* %ctx, int 0, uint 22 ; [#uses=1] - %tmp = load uint* %tmp.uip ; [#uses=3] - %tmp91 = lshr uint %tmp, ubyte 5 ; [#uses=1] - %tmp92 = trunc uint %tmp91 to bool ; [#uses=1] - br bool %tmp92, label %cond_true93, label %cond_next116 - + %tmp.uip = getelementptr %struct.GLDContextRec* %ctx, i32 0, i32 22 ; [#uses=1] + %tmp = load i32* %tmp.uip ; [#uses=3] + %tmp91 = lshr i32 %tmp, 5 ; [#uses=1] + %tmp92 = trunc i32 %tmp91 to i1 ; [#uses=1] + br i1 %tmp92, label %cond_true93, label %cond_next116 cond_true93: ; preds = %entry - %tmp = getelementptr %struct.GLDContextRec* %ctx, int 0, uint 31, uint 14 ; [#uses=1] - %tmp95 = load int* %tmp ; [#uses=1] - %tmp95 = sitofp int %tmp95 to float ; [#uses=1] - %tmp108 = mul float undef, %tmp95 ; [#uses=1] + %tmp.upgrd.1 = getelementptr %struct.GLDContextRec* %ctx, i32 0, i32 31, i32 14 ; [#uses=1] + %tmp95 = load i32* %tmp.upgrd.1 ; [#uses=1] + %tmp95.upgrd.2 = sitofp i32 %tmp95 to float ; [#uses=1] + %tmp108 = mul float undef, %tmp95.upgrd.2 ; [#uses=1] br label %cond_next116 - cond_next116: ; preds = %cond_true93, %entry %point_size.2 = phi float [ %tmp108, %cond_true93 ], [ undef, %entry ] ; [#uses=2] - %tmp457 = setlt float %point_size.2, 1.000000e+00 ; [#uses=1] - %tmp460 = lshr uint %tmp, ubyte 6 ; [#uses=1] - %tmp461 = trunc uint %tmp460 to bool ; [#uses=1] - br bool %tmp457, label %cond_true458, label %cond_next484 - + %tmp457 = fcmp olt float %point_size.2, 1.000000e+00 ; [#uses=1] + %tmp460 = lshr i32 %tmp, 6 ; [#uses=1] + %tmp461 = trunc i32 %tmp460 to i1 ; [#uses=1] + br i1 %tmp457, label %cond_true458, label %cond_next484 cond_true458: ; preds = %cond_next116 - br bool %tmp461, label %cond_true462, label %cond_next487 - + br i1 %tmp461, label %cond_true462, label %cond_next487 cond_true462: ; preds = %cond_true458 - %tmp26 = bitcast uint %tmp to int ; [#uses=1] - %tmp465 = and int %tmp26, 128 ; [#uses=1] - %tmp466 = seteq int %tmp465, 0 ; [#uses=1] - br bool %tmp466, label %cond_true467, label %cond_next487 - + %tmp26 = bitcast i32 %tmp to i32 ; [#uses=1] + %tmp465 = and i32 %tmp26, 128 ; [#uses=1] + %tmp466 = icmp eq i32 %tmp465, 0 ; [#uses=1] + br i1 %tmp466, label %cond_true467, label %cond_next487 cond_true467: ; preds = %cond_true462 ret void - cond_next484: ; preds = %cond_next116 %tmp486 = mul float %point_size.2, 5.000000e-01 ; [#uses=1] br label %cond_next487 - cond_next487: ; preds = %cond_next484, %cond_true462, %cond_true458 %radius.0 = phi float [ %tmp486, %cond_next484 ], [ 5.000000e-01, %cond_true458 ], [ 5.000000e-01, %cond_true462 ] ; [#uses=2] - %tmp494 = insertelement <4 x float> zeroinitializer, float %radius.0, uint 2 ; <<4 x float>> [#uses=1] - %tmp495 = insertelement <4 x float> %tmp494, float %radius.0, uint 3 ; <<4 x float>> [#uses=0] + %tmp494 = insertelement <4 x float> zeroinitializer, float %radius.0, i32 2 ; <<4 x float>> [#uses=1] + %tmp495 = insertelement <4 x float> %tmp494, float %radius.0, i32 3 ; <<4 x float>> [#uses=0] ret void } diff --git a/test/Transforms/SCCP/2006-12-19-UndefBug.ll b/test/Transforms/SCCP/2006-12-19-UndefBug.ll index 3cc61f716b4..4d686690b98 100644 --- a/test/Transforms/SCCP/2006-12-19-UndefBug.ll +++ b/test/Transforms/SCCP/2006-12-19-UndefBug.ll @@ -1,7 +1,8 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -sccp | llvm-dis | \ +; RUN: llvm-as < %s | opt -sccp | llvm-dis | \ ; RUN: grep {ret i1 false} -bool %foo() { - %X = and bool false, undef - ret bool %X +define i1 @foo() { + %X = and i1 false, undef ; [#uses=1] + ret i1 %X } + diff --git a/test/Transforms/SCCP/2007-05-16-InvokeCrash.ll b/test/Transforms/SCCP/2007-05-16-InvokeCrash.ll index ad6a469f0c4..c099b88044c 100644 --- a/test/Transforms/SCCP/2007-05-16-InvokeCrash.ll +++ b/test/Transforms/SCCP/2007-05-16-InvokeCrash.ll @@ -1,43 +1,35 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -sccp -disable-output +; RUN: llvm-as < %s | opt -sccp -disable-output ; PR 1431 -void @_ada_bench() { +define void @_ada_bench() { entry: br label %cond_next - cond_next: ; preds = %cond_next, %entry %indvar46 = phi i32 [ 0, %entry ], [ %indvar.next47, %cond_next ] ; [#uses=1] %indvar.next47 = add i32 %indvar46, 1 ; [#uses=2] %exitcond48 = icmp eq i32 %indvar.next47, 10000 ; [#uses=1] br i1 %exitcond48, label %cond_next40, label %cond_next - cond_next40: ; preds = %cond_next40, %cond_next %indvar43 = phi i32 [ %indvar.next44, %cond_next40 ], [ 0, %cond_next ] ; [#uses=1] %indvar.next44 = add i32 %indvar43, 1 ; [#uses=2] %exitcond45 = icmp eq i32 %indvar.next44, 10000 ; [#uses=1] br i1 %exitcond45, label %cond_next53, label %cond_next40 - cond_next53: ; preds = %cond_next53, %cond_next40 %indvar41 = phi i32 [ %indvar.next42, %cond_next53 ], [ 0, %cond_next40 ] ; [#uses=1] %indvar.next42 = add i32 %indvar41, 1 ; [#uses=2] %exitcond = icmp eq i32 %indvar.next42, 10000 ; [#uses=1] br i1 %exitcond, label %bb67, label %cond_next53 - bb67: ; preds = %cond_next53 %tmp112 = invoke double @sin( double 5.000000e-01 ) to label %bb114 unwind label %cleanup ; [#uses=0] - bb114: ; preds = %bb67 %tmp147 = invoke double @log( double 5.000000e-01 ) to label %bb149 unwind label %cleanup ; [#uses=0] - bb149: ; preds = %bb114 %tmp175 = invoke double @sqrt( double 5.000000e-01 ) to label %bb177 unwind label %cleanup ; [#uses=0] - bb177: ; preds = %bb149 unreachable - cleanup: ; preds = %bb149, %bb114, %bb67 unwind } @@ -47,4 +39,3 @@ declare double @sin(double) declare double @log(double) declare double @sqrt(double) - diff --git a/test/Transforms/SCCP/basictest.ll b/test/Transforms/SCCP/basictest.ll index 417f847e64a..08640a9a239 100644 --- a/test/Transforms/SCCP/basictest.ll +++ b/test/Transforms/SCCP/basictest.ll @@ -1,16 +1,17 @@ ; This is a basic sanity check for constant propogation. The add instruction ; should be eliminated. -; RUN: llvm-upgrade < %s | llvm-as | opt -sccp | llvm-dis | not grep add +; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep add -int %test(bool %B) { - br bool %B, label %BB1, label %BB2 -BB1: - %Val = add int 0, 0 +define i32 @test(i1 %B) { + br i1 %B, label %BB1, label %BB2 +BB1: ; preds = %0 + %Val = add i32 0, 0 ; [#uses=1] br label %BB3 -BB2: +BB2: ; preds = %0 br label %BB3 -BB3: - %Ret = phi int [%Val, %BB1], [1, %BB2] - ret int %Ret +BB3: ; preds = %BB2, %BB1 + %Ret = phi i32 [ %Val, %BB1 ], [ 1, %BB2 ] ; [#uses=1] + ret i32 %Ret } + diff --git a/test/Transforms/SCCP/calltest.ll b/test/Transforms/SCCP/calltest.ll index 43df00c6940..481ba9c229a 100644 --- a/test/Transforms/SCCP/calltest.ll +++ b/test/Transforms/SCCP/calltest.ll @@ -1,25 +1,22 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -sccp -adce -simplifycfg | llvm-dis | \ +; RUN: llvm-as < %s | opt -sccp -adce -simplifycfg | llvm-dis | \ ; RUN: not grep br ; No matter how hard you try, sqrt(1.0) is always 1.0. This allows the ; optimizer to delete this loop. -declare double %sqrt(double) +declare double @sqrt(double) -double %test(uint %param) { +define double @test(i32 %param) { entry: br label %Loop - -Loop: - %I2 = phi uint [ 0, %entry ], [ %I3, %Loop ] - %V = phi double [ 1.0, %entry], [ %V2, %Loop ] - - %V2 = call double %sqrt(double %V) - - %I3 = add uint %I2, 1 - %tmp.7 = setne uint %I3, %param - br bool %tmp.7, label %Loop, label %Exit - -Exit: +Loop: ; preds = %Loop, %entry + %I2 = phi i32 [ 0, %entry ], [ %I3, %Loop ] ; [#uses=1] + %V = phi double [ 1.000000e+00, %entry ], [ %V2, %Loop ] ; [#uses=2] + %V2 = call double @sqrt( double %V ) ; [#uses=1] + %I3 = add i32 %I2, 1 ; [#uses=2] + %tmp.7 = icmp ne i32 %I3, %param ; [#uses=1] + br i1 %tmp.7, label %Loop, label %Exit +Exit: ; preds = %Loop ret double %V } + diff --git a/test/Transforms/SCCP/ipsccp-basic.ll b/test/Transforms/SCCP/ipsccp-basic.ll index 2390d619ae6..1449ea70c39 100644 --- a/test/Transforms/SCCP/ipsccp-basic.ll +++ b/test/Transforms/SCCP/ipsccp-basic.ll @@ -1,14 +1,13 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -ipsccp | llvm-dis | \ +; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | \ ; RUN: grep -v {ret i32 17} | grep -v {ret i32 undef} | not grep ret -implementation - -internal int %bar(int %A) { - %X = add int 1, 2 - ret int %A +define internal i32 @bar(i32 %A) { + %X = add i32 1, 2 ; [#uses=0] + ret i32 %A } -int %foo() { - %X = call int %bar(int 17) - ret int %X +define i32 @foo() { + %X = call i32 @bar( i32 17 ) ; [#uses=1] + ret i32 %X } + diff --git a/test/Transforms/SCCP/ipsccp-conditional.ll b/test/Transforms/SCCP/ipsccp-conditional.ll index db36228e9cd..b98bbf44be6 100644 --- a/test/Transforms/SCCP/ipsccp-conditional.ll +++ b/test/Transforms/SCCP/ipsccp-conditional.ll @@ -1,20 +1,19 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -ipsccp | llvm-dis | \ +; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | \ ; RUN: grep -v {ret i32 0} | grep -v {ret i32 undef} | not grep ret -implementation - -internal int %bar(int %A) { - %C = seteq int %A, 0 - br bool %C, label %T, label %F -T: - %B = call int %bar(int 0) - ret int 0 -F: ; unreachable - %C = call int %bar(int 1) - ret int %C +define internal i32 @bar(i32 %A) { + %C = icmp eq i32 %A, 0 ; [#uses=1] + br i1 %C, label %T, label %F +T: ; preds = %0 + %B = call i32 @bar( i32 0 ) ; [#uses=0] + ret i32 0 +F: ; preds = %0 + %C.upgrd.1 = call i32 @bar( i32 1 ) ; [#uses=1] + ret i32 %C.upgrd.1 } -int %foo() { - %X = call int %bar(int 0) - ret int %X +define i32 @foo() { + %X = call i32 @bar( i32 0 ) ; [#uses=1] + ret i32 %X } + diff --git a/test/Transforms/SCCP/ipsccp-gvar.ll b/test/Transforms/SCCP/ipsccp-gvar.ll index d76b4810cb0..6f2ee1f4d8a 100644 --- a/test/Transforms/SCCP/ipsccp-gvar.ll +++ b/test/Transforms/SCCP/ipsccp-gvar.ll @@ -1,23 +1,22 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -ipsccp | llvm-dis | not grep global +; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | not grep global -%G = internal global int undef +@G = internal global i32 undef ; [#uses=5] -implementation - -void %foo() { - %X = load int* %G - store int %X, int* %G +define void @foo() { + %X = load i32* @G ; [#uses=1] + store i32 %X, i32* @G ret void } -int %bar() { - %V = load int* %G - %C = seteq int %V, 17 - br bool %C, label %T, label %F -T: - store int 17, int* %G - ret int %V -F: - store int 123, int* %G - ret int 0 +define i32 @bar() { + %V = load i32* @G ; [#uses=2] + %C = icmp eq i32 %V, 17 ; [#uses=1] + br i1 %C, label %T, label %F +T: ; preds = %0 + store i32 17, i32* @G + ret i32 %V +F: ; preds = %0 + store i32 123, i32* @G + ret i32 0 } + diff --git a/test/Transforms/SCCP/loadtest.ll b/test/Transforms/SCCP/loadtest.ll index 58a9ff6a289..0cbbdf60366 100644 --- a/test/Transforms/SCCP/loadtest.ll +++ b/test/Transforms/SCCP/loadtest.ll @@ -1,26 +1,26 @@ ; This test makes sure that these instructions are properly constant propagated. ; -; RUN: llvm-upgrade < %s | llvm-as | opt -sccp | llvm-dis | not grep load +; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep load -%X = constant int 42 -%Y = constant [2 x { int, float }] [ { int, float } { int 12, float 1.0 }, - { int, float } { int 37, float 0x3FF3B2FEC0000000 } ] -int %test1() { - %B = load int* %X - ret int %B + +@X = constant i32 42 ; [#uses=1] +@Y = constant [2 x { i32, float }] [ { i32, float } { i32 12, float 1.000000e+00 }, { i32, float } { i32 37, float 0x3FF3B2FEC0000000 } ] ; <[2 x { i32, float }]*> [#uses=2] + +define i32 @test1() { + %B = load i32* @X ; [#uses=1] + ret i32 %B } -float %test2() { - %A = getelementptr [2 x { int, float}]* %Y, long 0, long 1, uint 1 - %B = load float* %A +define float @test2() { + %A = getelementptr [2 x { i32, float }]* @Y, i64 0, i64 1, i32 1 ; [#uses=1] + %B = load float* %A ; [#uses=1] ret float %B } -int %test3() { - %A = getelementptr [2 x { int, float}]* %Y, long 0, long 0, uint 0 - %B = load int* %A - ret int %B +define i32 @test3() { + %A = getelementptr [2 x { i32, float }]* @Y, i64 0, i64 0, i32 0 ; [#uses=1] + %B = load i32* %A ; [#uses=1] + ret i32 %B } - diff --git a/test/Transforms/SCCP/logical-nuke.ll b/test/Transforms/SCCP/logical-nuke.ll index 02c3ac0e36f..87454e4dcea 100644 --- a/test/Transforms/SCCP/logical-nuke.ll +++ b/test/Transforms/SCCP/logical-nuke.ll @@ -1,8 +1,9 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -sccp | llvm-dis | grep {ret i32 0} +; RUN: llvm-as < %s | opt -sccp | llvm-dis | grep {ret i32 0} ; Test that SCCP has basic knowledge of when and/or nuke overdefined values. -int %test(int %X) { - %Y = and int %X, 0 - ret int %Y +define i32 @test(i32 %X) { + %Y = and i32 %X, 0 ; [#uses=1] + ret i32 %Y } + diff --git a/test/Transforms/SCCP/phitest.ll b/test/Transforms/SCCP/phitest.ll index b44a3189fe1..c75de5dde8f 100644 --- a/test/Transforms/SCCP/phitest.ll +++ b/test/Transforms/SCCP/phitest.ll @@ -1,24 +1,21 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -sccp -dce -simplifycfg | llvm-dis | \ +; RUN: llvm-as < %s | opt -sccp -dce -simplifycfg | llvm-dis | \ ; RUN: not grep br -int %test(int %param) { +define i32 @test(i32 %param) { entry: - %tmp.1 = setne int %param, 0 - br bool %tmp.1, label %endif.0, label %else - -else: + %tmp.1 = icmp ne i32 %param, 0 ; [#uses=1] + br i1 %tmp.1, label %endif.0, label %else +else: ; preds = %entry br label %endif.0 - -endif.0: - %a.0 = phi int [ 2, %else ], [ 3, %entry ] - %b.0 = phi int [ 3, %else ], [ 2, %entry ] - %tmp.5 = add int %a.0, %b.0 - %tmp.7 = setne int %tmp.5, 5 - br bool %tmp.7, label %UnifiedReturnBlock, label %endif.1 - -endif.1: - ret int 0 - -UnifiedReturnBlock: - ret int 2 +endif.0: ; preds = %else, %entry + %a.0 = phi i32 [ 2, %else ], [ 3, %entry ] ; [#uses=1] + %b.0 = phi i32 [ 3, %else ], [ 2, %entry ] ; [#uses=1] + %tmp.5 = add i32 %a.0, %b.0 ; [#uses=1] + %tmp.7 = icmp ne i32 %tmp.5, 5 ; [#uses=1] + br i1 %tmp.7, label %UnifiedReturnBlock, label %endif.1 +endif.1: ; preds = %endif.0 + ret i32 0 +UnifiedReturnBlock: ; preds = %endif.0 + ret i32 2 } + diff --git a/test/Transforms/SCCP/sccptest.ll b/test/Transforms/SCCP/sccptest.ll index f0a8244ecfa..84ba2d43cde 100644 --- a/test/Transforms/SCCP/sccptest.ll +++ b/test/Transforms/SCCP/sccptest.ll @@ -1,35 +1,31 @@ ; This is the test case taken from appel's book that illustrates a hard case ; that SCCP gets right. BB3 should be completely eliminated. ; -; RUN: llvm-upgrade < %s | llvm-as | opt -sccp -constprop -dce -simplifycfg | \ +; RUN: llvm-as < %s | opt -sccp -constprop -dce -simplifycfg | \ ; RUN: llvm-dis | not grep BB3 -int %testfunction(int %i0, int %j0) { +define i32 @testfunction(i32 %i0, i32 %j0) { BB1: br label %BB2 -BB2: - %j2 = phi int [%j4, %BB7], [1, %BB1] - %k2 = phi int [%k4, %BB7], [0, %BB1] - %kcond = setlt int %k2, 100 - br bool %kcond, label %BB3, label %BB4 - -BB3: - %jcond = setlt int %j2, 20 - br bool %jcond, label %BB5, label %BB6 - -BB4: - ret int %j2 - -BB5: - %k3 = add int %k2, 1 +BB2: ; preds = %BB7, %BB1 + %j2 = phi i32 [ %j4, %BB7 ], [ 1, %BB1 ] ; [#uses=2] + %k2 = phi i32 [ %k4, %BB7 ], [ 0, %BB1 ] ; [#uses=4] + %kcond = icmp slt i32 %k2, 100 ; [#uses=1] + br i1 %kcond, label %BB3, label %BB4 +BB3: ; preds = %BB2 + %jcond = icmp slt i32 %j2, 20 ; [#uses=1] + br i1 %jcond, label %BB5, label %BB6 +BB4: ; preds = %BB2 + ret i32 %j2 +BB5: ; preds = %BB3 + %k3 = add i32 %k2, 1 ; [#uses=1] br label %BB7 - -BB6: - %k5 = add int %k2, 1 +BB6: ; preds = %BB3 + %k5 = add i32 %k2, 1 ; [#uses=1] br label %BB7 - -BB7: - %j4 = phi int [1, %BB5], [%k2, %BB6] - %k4 = phi int [%k3, %BB5], [%k5, %BB6] +BB7: ; preds = %BB6, %BB5 + %j4 = phi i32 [ 1, %BB5 ], [ %k2, %BB6 ] ; [#uses=1] + %k4 = phi i32 [ %k3, %BB5 ], [ %k5, %BB6 ] ; [#uses=1] br label %BB2 } + diff --git a/test/Transforms/SCCP/select.ll b/test/Transforms/SCCP/select.ll index cd488e3f02c..74b20d09c14 100644 --- a/test/Transforms/SCCP/select.ll +++ b/test/Transforms/SCCP/select.ll @@ -1,11 +1,12 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -sccp | llvm-dis | not grep select +; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep select -int %test1(bool %C) { - %X = select bool %C, int 0, int 0 - ret int %X +define i32 @test1(i1 %C) { + %X = select i1 %C, i32 0, i32 0 ; [#uses=1] + ret i32 %X } -int %test2(bool %C) { - %X = select bool %C, int 0, int undef - ret int %X +define i32 @test2(i1 %C) { + %X = select i1 %C, i32 0, i32 undef ; [#uses=1] + ret i32 %X } + -- 2.34.1