diff options
author | Tanya Lattner <tonic@nondot.org> | 2008-03-19 05:39:35 +0000 |
---|---|---|
committer | Tanya Lattner <tonic@nondot.org> | 2008-03-19 05:39:35 +0000 |
commit | ce7d5db4d86b6eef20ffb9e981a1f0d428879e57 (patch) | |
tree | 99ed3d8480f6747c8a0c002b3d5945cf1d5ae3bf /test/Transforms/PredicateSimplifier/predsimplify.ll | |
parent | d8ff3caaa0d5dd4a7cbbe25c42d70af2e3caca7f (diff) | |
download | external_llvm-ce7d5db4d86b6eef20ffb9e981a1f0d428879e57.zip external_llvm-ce7d5db4d86b6eef20ffb9e981a1f0d428879e57.tar.gz external_llvm-ce7d5db4d86b6eef20ffb9e981a1f0d428879e57.tar.bz2 |
Upgrade tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48536 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/PredicateSimplifier/predsimplify.ll')
-rw-r--r-- | test/Transforms/PredicateSimplifier/predsimplify.ll | 484 |
1 files changed, 227 insertions, 257 deletions
diff --git a/test/Transforms/PredicateSimplifier/predsimplify.ll b/test/Transforms/PredicateSimplifier/predsimplify.ll index 76546dc..a6848df 100644 --- a/test/Transforms/PredicateSimplifier/predsimplify.ll +++ b/test/Transforms/PredicateSimplifier/predsimplify.ll @@ -1,309 +1,279 @@ -; RUN: llvm-upgrade < %s | llvm-as | \ +; RUN: llvm-as < %s | \ ; RUN: opt -predsimplify -instcombine -simplifycfg | llvm-dis > %t -; RUN: grep -v declare %t | not grep fail +; RUN: grep -v declare %t | not grep fail ; RUN: grep -v declare %t | grep pass | count 4 -void %test1(int %x) { + +define void @test1(i32 %x) { entry: - %A = seteq int %x, 0 - br bool %A, label %then.1, label %else.1 -then.1: - %B = seteq int %x, 1 - br bool %B, label %then.2, label %else.1 -then.2: - call void (...)* %fail( ) - ret void -else.1: - ret void + %A = icmp eq i32 %x, 0 ; <i1> [#uses=1] + br i1 %A, label %then.1, label %else.1 +then.1: ; preds = %entry + %B = icmp eq i32 %x, 1 ; <i1> [#uses=1] + br i1 %B, label %then.2, label %else.1 +then.2: ; preds = %then.1 + call void (...)* @fail( ) + ret void +else.1: ; preds = %then.1, %entry + ret void } -void %test2(int %x) { +define void @test2(i32 %x) { entry: - %A = seteq int %x, 0 - %B = seteq int %x, 1 - br bool %A, label %then.1, label %else.1 -then.1: - br bool %B, label %then.2, label %else.1 -then.2: - call void (...)* %fail( ) - ret void -else.1: - ret void + %A = icmp eq i32 %x, 0 ; <i1> [#uses=1] + %B = icmp eq i32 %x, 1 ; <i1> [#uses=1] + br i1 %A, label %then.1, label %else.1 +then.1: ; preds = %entry + br i1 %B, label %then.2, label %else.1 +then.2: ; preds = %then.1 + call void (...)* @fail( ) + ret void +else.1: ; preds = %then.1, %entry + ret void } -void %test3(int %x) { +define void @test3(i32 %x) { entry: - %A = seteq int %x, 0 - %B = seteq int %x, 1 - br bool %A, label %then.1, label %else.1 -then.1: - br bool %B, label %then.2, label %else.1 -then.2: - call void (...)* %fail( ) - ret void -else.1: - ret void + %A = icmp eq i32 %x, 0 ; <i1> [#uses=1] + %B = icmp eq i32 %x, 1 ; <i1> [#uses=1] + br i1 %A, label %then.1, label %else.1 +then.1: ; preds = %entry + br i1 %B, label %then.2, label %else.1 +then.2: ; preds = %then.1 + call void (...)* @fail( ) + ret void +else.1: ; preds = %then.1, %entry + ret void } -void %test4(int %x, int %y) { +define void @test4(i32 %x, i32 %y) { entry: - %A = seteq int %x, 0 - %B = seteq int %y, 0 - %C = and bool %A, %B - br bool %C, label %then.1, label %else.1 -then.1: - %D = seteq int %x, 0 - br bool %D, label %then.2, label %else.2 -then.2: - %E = seteq int %y, 0 - br bool %E, label %else.1, label %else.2 -else.1: - ret void -else.2: - call void (...)* %fail( ) - ret void + %A = icmp eq i32 %x, 0 ; <i1> [#uses=1] + %B = icmp eq i32 %y, 0 ; <i1> [#uses=1] + %C = and i1 %A, %B ; <i1> [#uses=1] + br i1 %C, label %then.1, label %else.1 +then.1: ; preds = %entry + %D = icmp eq i32 %x, 0 ; <i1> [#uses=1] + br i1 %D, label %then.2, label %else.2 +then.2: ; preds = %then.1 + %E = icmp eq i32 %y, 0 ; <i1> [#uses=1] + br i1 %E, label %else.1, label %else.2 +else.1: ; preds = %then.2, %entry + ret void +else.2: ; preds = %then.2, %then.1 + call void (...)* @fail( ) + ret void } -void %test5(int %x) { +define void @test5(i32 %x) { entry: - %A = seteq int %x, 0 - br bool %A, label %then.1, label %else.1 -then.1: - ret void -then.2: - call void (...)* %fail( ) - ret void -else.1: - %B = seteq int %x, 0 - br bool %B, label %then.2, label %then.1 + %A = icmp eq i32 %x, 0 ; <i1> [#uses=1] + br i1 %A, label %then.1, label %else.1 +then.1: ; preds = %else.1, %entry + ret void +then.2: ; preds = %else.1 + call void (...)* @fail( ) + ret void +else.1: ; preds = %entry + %B = icmp eq i32 %x, 0 ; <i1> [#uses=1] + br i1 %B, label %then.2, label %then.1 } -void %test6(int %x, int %y) { +define void @test6(i32 %x, i32 %y) { entry: - %A = seteq int %x, 0 - %B = seteq int %y, 0 - %C = or bool %A, %B - br bool %C, label %then.1, label %else.1 -then.1: - ret void -then.2: - call void (...)* %fail( ) - ret void -else.1: - %D = seteq int %x, 0 - br bool %D, label %then.2, label %else.2 -else.2: - %E = setne int %y, 0 - br bool %E, label %then.1, label %then.2 + %A = icmp eq i32 %x, 0 ; <i1> [#uses=1] + %B = icmp eq i32 %y, 0 ; <i1> [#uses=1] + %C = or i1 %A, %B ; <i1> [#uses=1] + br i1 %C, label %then.1, label %else.1 +then.1: ; preds = %else.2, %entry + ret void +then.2: ; preds = %else.2, %else.1 + call void (...)* @fail( ) + ret void +else.1: ; preds = %entry + %D = icmp eq i32 %x, 0 ; <i1> [#uses=1] + br i1 %D, label %then.2, label %else.2 +else.2: ; preds = %else.1 + %E = icmp ne i32 %y, 0 ; <i1> [#uses=1] + br i1 %E, label %then.1, label %then.2 } -void %test7(int %x) { +define void @test7(i32 %x) { entry: - %A = setne int %x, 0 - %B = xor bool %A, true - br bool %B, label %then.1, label %else.1 -then.1: - %C = seteq int %x, 1 - br bool %C, label %then.2, label %else.1 -then.2: - call void (...)* %fail( ) - ret void -else.1: - ret void + %A = icmp ne i32 %x, 0 ; <i1> [#uses=1] + %B = xor i1 %A, true ; <i1> [#uses=1] + br i1 %B, label %then.1, label %else.1 +then.1: ; preds = %entry + %C = icmp eq i32 %x, 1 ; <i1> [#uses=1] + br i1 %C, label %then.2, label %else.1 +then.2: ; preds = %then.1 + call void (...)* @fail( ) + ret void +else.1: ; preds = %then.1, %entry + ret void } -void %test8(int %x) { +define void @test8(i32 %x) { entry: - %A = add int %x, 1 - %B = seteq int %x, 0 - br bool %B, label %then.1, label %then.2 -then.1: - %C = seteq int %A, 1 - br bool %C, label %then.2, label %else.2 -then.2: - ret void -else.2: - call void (...)* %fail( ) - ret void + %A = add i32 %x, 1 ; <i32> [#uses=1] + %B = icmp eq i32 %x, 0 ; <i1> [#uses=1] + br i1 %B, label %then.1, label %then.2 +then.1: ; preds = %entry + %C = icmp eq i32 %A, 1 ; <i1> [#uses=1] + br i1 %C, label %then.2, label %else.2 +then.2: ; preds = %then.1, %entry + ret void +else.2: ; preds = %then.1 + call void (...)* @fail( ) + ret void } -void %test9(int %y, int %z) { +define void @test9(i32 %y, i32 %z) { entry: - %x = add int %y, %z - %A = seteq int %y, 3 - %B = seteq int %z, 5 - %C = and bool %A, %B - br bool %C, label %cond_true, label %return - -cond_true: - %D = seteq int %x, 8 - br bool %D, label %then, label %oops - -then: - call void (...)* %pass( ) - ret void - -oops: - call void (...)* %fail( ) - ret void - -return: - ret void + %x = add i32 %y, %z ; <i32> [#uses=1] + %A = icmp eq i32 %y, 3 ; <i1> [#uses=1] + %B = icmp eq i32 %z, 5 ; <i1> [#uses=1] + %C = and i1 %A, %B ; <i1> [#uses=1] + br i1 %C, label %cond_true, label %return +cond_true: ; preds = %entry + %D = icmp eq i32 %x, 8 ; <i1> [#uses=1] + br i1 %D, label %then, label %oops +then: ; preds = %cond_true + call void (...)* @pass( ) + ret void +oops: ; preds = %cond_true + call void (...)* @fail( ) + ret void +return: ; preds = %entry + ret void } -void %test10() { +define void @test10() { entry: - %A = alloca int - %B = seteq int* %A, null - br bool %B, label %cond_true, label %cond_false - -cond_true: - call void (...)* %fail ( ) - ret void - -cond_false: - call void (...)* %pass ( ) - ret void + %A = alloca i32 ; <i32*> [#uses=1] + %B = icmp eq i32* %A, null ; <i1> [#uses=1] + br i1 %B, label %cond_true, label %cond_false +cond_true: ; preds = %entry + call void (...)* @fail( ) + ret void +cond_false: ; preds = %entry + call void (...)* @pass( ) + ret void } -void %switch1(int %x) { +define void @switch1(i32 %x) { entry: - %A = seteq int %x, 10 - br bool %A, label %return, label %cond_false - -cond_false: - switch int %x, label %return [ - int 9, label %then1 - int 10, label %then2 - ] - -then1: - call void (...)* %pass( ) - ret void - -then2: - call void (...)* %fail( ) - ret void - -return: - ret void + %A = icmp eq i32 %x, 10 ; <i1> [#uses=1] + br i1 %A, label %return, label %cond_false +cond_false: ; preds = %entry + switch i32 %x, label %return [ + i32 9, label %then1 + i32 10, label %then2 + ] +then1: ; preds = %cond_false + call void (...)* @pass( ) + ret void +then2: ; preds = %cond_false + call void (...)* @fail( ) + ret void +return: ; preds = %cond_false, %entry + ret void } -void %switch2(int %x) { +define void @switch2(i32 %x) { entry: - %A = seteq int %x, 10 - br bool %A, label %return, label %cond_false - -cond_false: - switch int %x, label %return [ - int 8, label %then1 - int 9, label %then1 - int 10, label %then1 - ] - -then1: - %B = setne int %x, 8 - br bool %B, label %then2, label %return - -then2: - call void (...)* %pass( ) - ret void - -return: - ret void + %A = icmp eq i32 %x, 10 ; <i1> [#uses=1] + br i1 %A, label %return, label %cond_false +cond_false: ; preds = %entry + switch i32 %x, label %return [ + i32 8, label %then1 + i32 9, label %then1 + i32 10, label %then1 + ] +then1: ; preds = %cond_false, %cond_false, %cond_false + %B = icmp ne i32 %x, 8 ; <i1> [#uses=1] + br i1 %B, label %then2, label %return +then2: ; preds = %then1 + call void (...)* @pass( ) + ret void +return: ; preds = %then1, %cond_false, %entry + ret void } -void %switch3(int %x) { +define void @switch3(i32 %x) { entry: - %A = seteq int %x, 10 - br bool %A, label %return, label %cond_false - -cond_false: - switch int %x, label %return [ - int 9, label %then1 - int 10, label %then1 - ] - -then1: - %B = seteq int %x, 9 - br bool %B, label %return, label %oops - -oops: - call void (...)* %fail( ) - ret void - -return: - ret void + %A = icmp eq i32 %x, 10 ; <i1> [#uses=1] + br i1 %A, label %return, label %cond_false +cond_false: ; preds = %entry + switch i32 %x, label %return [ + i32 9, label %then1 + i32 10, label %then1 + ] +then1: ; preds = %cond_false, %cond_false + %B = icmp eq i32 %x, 9 ; <i1> [#uses=1] + br i1 %B, label %return, label %oops +oops: ; preds = %then1 + call void (...)* @fail( ) + ret void +return: ; preds = %then1, %cond_false, %entry + ret void } -void %switch4(int %x) { +define void @switch4(i32 %x) { entry: - %A = seteq int %x, 10 - br bool %A, label %then1, label %cond_false - -cond_false: - switch int %x, label %default [ - int 9, label %then1 - int 10, label %then2 - ] - -then1: - ret void - -then2: - ret void - -default: - %B = seteq int %x, 9 - br bool %B, label %oops, label %then1 - -oops: - call void (...)* %fail( ) - ret void + %A = icmp eq i32 %x, 10 ; <i1> [#uses=1] + br i1 %A, label %then1, label %cond_false +cond_false: ; preds = %entry + switch i32 %x, label %default [ + i32 9, label %then1 + i32 10, label %then2 + ] +then1: ; preds = %default, %cond_false, %entry + ret void +then2: ; preds = %cond_false + ret void +default: ; preds = %cond_false + %B = icmp eq i32 %x, 9 ; <i1> [#uses=1] + br i1 %B, label %oops, label %then1 +oops: ; preds = %default + call void (...)* @fail( ) + ret void } -void %select1(int %x) { +define void @select1(i32 %x) { entry: - %A = seteq int %x, 10 - %B = select bool %A, int 1, int 2 - %C = seteq int %B, 1 - br bool %C, label %then, label %else - -then: - br bool %A, label %return, label %oops - -else: - br bool %A, label %oops, label %return - -oops: - call void (...)* %fail( ) - ret void - -return: - ret void + %A = icmp eq i32 %x, 10 ; <i1> [#uses=3] + %B = select i1 %A, i32 1, i32 2 ; <i32> [#uses=1] + %C = icmp eq i32 %B, 1 ; <i1> [#uses=1] + br i1 %C, label %then, label %else +then: ; preds = %entry + br i1 %A, label %return, label %oops +else: ; preds = %entry + br i1 %A, label %oops, label %return +oops: ; preds = %else, %then + call void (...)* @fail( ) + ret void +return: ; preds = %else, %then + ret void } -void %select2(int %x) { +define void @select2(i32 %x) { entry: - %A = seteq int %x, 10 - %B = select bool %A, int 1, int 2 - %C = seteq int %B, 1 - br bool %A, label %then, label %else - -then: - br bool %C, label %return, label %oops - -else: - br bool %C, label %oops, label %return - -oops: - call void (...)* %fail( ) - ret void - -return: - ret void + %A = icmp eq i32 %x, 10 ; <i1> [#uses=2] + %B = select i1 %A, i32 1, i32 2 ; <i32> [#uses=1] + %C = icmp eq i32 %B, 1 ; <i1> [#uses=2] + br i1 %A, label %then, label %else +then: ; preds = %entry + br i1 %C, label %return, label %oops +else: ; preds = %entry + br i1 %C, label %oops, label %return +oops: ; preds = %else, %then + call void (...)* @fail( ) + ret void +return: ; preds = %else, %then + ret void } -declare void %fail(...) +declare void @fail(...) -declare void %pass(...) +declare void @pass(...) |