summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/not.ll
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2008-03-01 09:15:35 +0000
committerTanya Lattner <tonic@nondot.org>2008-03-01 09:15:35 +0000
commitec9a35a6f9143cfa325e0413cc297c48f627973a (patch)
treec1b0621415acc20f94152c51174d53fae3dbc8cc /test/Transforms/InstCombine/not.ll
parentab3b77834c9232e4c13acb29afe1920b97c5a20b (diff)
downloadllvm-ec9a35a6f9143cfa325e0413cc297c48f627973a.tar.gz
llvm-ec9a35a6f9143cfa325e0413cc297c48f627973a.tar.bz2
llvm-ec9a35a6f9143cfa325e0413cc297c48f627973a.tar.xz
Remove llvm-upgrade and update test cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47793 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/not.ll')
-rw-r--r--test/Transforms/InstCombine/not.ll57
1 files changed, 28 insertions, 29 deletions
diff --git a/test/Transforms/InstCombine/not.ll b/test/Transforms/InstCombine/not.ll
index 3e85692500..757e1de940 100644
--- a/test/Transforms/InstCombine/not.ll
+++ b/test/Transforms/InstCombine/not.ll
@@ -1,45 +1,44 @@
; This test makes sure that these instructions are properly eliminated.
;
-; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep xor
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep xor
-implementation
-
-int %test1(int %A) {
- %B = xor int %A, -1
- %C = xor int %B, -1
- ret int %C
+define i32 @test1(i32 %A) {
+ %B = xor i32 %A, -1 ; <i32> [#uses=1]
+ %C = xor i32 %B, -1 ; <i32> [#uses=1]
+ ret i32 %C
}
-bool %test2(int %A, int %B) {
- %cond = setle int %A, %B ; Can change into setge
- %Ret = xor bool %cond, true
- ret bool %Ret
+define i1 @test2(i32 %A, i32 %B) {
+ ; Can change into setge
+ %cond = icmp sle i32 %A, %B ; <i1> [#uses=1]
+ %Ret = xor i1 %cond, true ; <i1> [#uses=1]
+ ret i1 %Ret
}
-
; Test that demorgans law can be instcombined
-int %test3(int %A, int %B) {
- %a = xor int %A, -1
- %b = xor int %B, -1
- %c = and int %a, %b
- %d = xor int %c, -1
- ret int %d
+define i32 @test3(i32 %A, i32 %B) {
+ %a = xor i32 %A, -1 ; <i32> [#uses=1]
+ %b = xor i32 %B, -1 ; <i32> [#uses=1]
+ %c = and i32 %a, %b ; <i32> [#uses=1]
+ %d = xor i32 %c, -1 ; <i32> [#uses=1]
+ ret i32 %d
}
; Test that demorgens law can work with constants
-int %test4(int %A, int %B) {
- %a = xor int %A, -1
- %c = and int %a, 5 ; 5 = ~c2
- %d = xor int %c, -1
- ret int %d
+define i32 @test4(i32 %A, i32 %B) {
+ %a = xor i32 %A, -1 ; <i32> [#uses=1]
+ %c = and i32 %a, 5 ; <i32> [#uses=1]
+ %d = xor i32 %c, -1 ; <i32> [#uses=1]
+ ret i32 %d
}
; test the mirror of demorgans law...
-int %test5(int %A, int %B) {
- %a = xor int %A, -1
- %b = xor int %B, -1
- %c = or int %a, %b
- %d = xor int %c, -1
- ret int %d
+define i32 @test5(i32 %A, i32 %B) {
+ %a = xor i32 %A, -1 ; <i32> [#uses=1]
+ %b = xor i32 %B, -1 ; <i32> [#uses=1]
+ %c = or i32 %a, %b ; <i32> [#uses=1]
+ %d = xor i32 %c, -1 ; <i32> [#uses=1]
+ ret i32 %d
}
+