summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/Transforms/InstCombine/add.ll12
-rw-r--r--test/Transforms/InstCombine/and.ll5
-rw-r--r--test/Transforms/InstCombine/cast.ll23
-rw-r--r--test/Transforms/InstCombine/set.ll12
-rw-r--r--test/Transforms/InstCombine/sub.ll5
-rw-r--r--test/Transforms/InstCombine/xor.ll6
6 files changed, 28 insertions, 35 deletions
diff --git a/test/Transforms/InstCombine/add.ll b/test/Transforms/InstCombine/add.ll
index 10040f972c..d9788b99ca 100644
--- a/test/Transforms/InstCombine/add.ll
+++ b/test/Transforms/InstCombine/add.ll
@@ -60,3 +60,15 @@ int %test9(int %A) {
%C = add int %B, %B ; === shl int %A, 5
ret int %C
}
+
+bool %test10(ubyte %A, ubyte %b) {
+ %B = add ubyte %A, %b
+ %c = setne ubyte %B, 0 ; === A != -b
+ ret bool %c
+}
+
+bool %test11(ubyte %A) {
+ %B = add ubyte %A, 255
+ %c = setne ubyte %B, 0 ; === A != 1
+ ret bool %c
+}
diff --git a/test/Transforms/InstCombine/and.ll b/test/Transforms/InstCombine/and.ll
index 23bd2df397..e30d5d35a1 100644
--- a/test/Transforms/InstCombine/and.ll
+++ b/test/Transforms/InstCombine/and.ll
@@ -88,3 +88,8 @@ bool %test13(uint %A, uint %B) {
ret bool %D
}
+bool %test14(ubyte %A) {
+ %B = and ubyte %A, 128
+ %C = setne ubyte %B, 0
+ ret bool %C
+}
diff --git a/test/Transforms/InstCombine/cast.ll b/test/Transforms/InstCombine/cast.ll
index 3b5b14be99..d16ed4f6fb 100644
--- a/test/Transforms/InstCombine/cast.ll
+++ b/test/Transforms/InstCombine/cast.ll
@@ -66,26 +66,3 @@ short %test10(short %A) {
ret short %c2
}
-bool %test11(ubyte %A, ubyte %B) {
- %C = sub ubyte %A, %B
- %cD = cast ubyte %C to bool ; == setne A, B
- ret bool %cD
-}
-
-bool %test12(ubyte %A) {
- %B = add ubyte %A, 255
- %c = cast ubyte %B to bool ; === A != 1
- ret bool %c
-}
-
-bool %test13(ubyte %A, ubyte %b) {
- %B = add ubyte %A, %b
- %c = cast ubyte %B to bool ; === A != -b
- ret bool %c
-}
-
-bool %test14(ubyte %A) {
- %B = xor ubyte %A, 4
- %c = cast ubyte %B to bool
- ret bool %c
-}
diff --git a/test/Transforms/InstCombine/set.ll b/test/Transforms/InstCombine/set.ll
index 553a6be7f1..12e73e9621 100644
--- a/test/Transforms/InstCombine/set.ll
+++ b/test/Transforms/InstCombine/set.ll
@@ -75,18 +75,6 @@ bool %test14(bool %A, bool %B) {
ret bool %C
}
-; These instructions can be turned into cast-to-bool
-bool %test15(sbyte %A, short %A, int %A, long %A) {
- %B1 = setne sbyte %A, 0
- %B2 = seteq short %A, 0
- %B3 = setne int %A, 0
- %B4 = seteq long %A, 0
- %C1 = or bool %B1, %B2
- %C2 = or bool %B3, %B4
- %D = or bool %C1, %C2
- ret bool %D
-}
-
bool %test16(uint %A) {
%B = and uint %A, 5
%C = seteq uint %B, 8 ; Is never true
diff --git a/test/Transforms/InstCombine/sub.ll b/test/Transforms/InstCombine/sub.ll
index 2003abdbc1..b17e97d554 100644
--- a/test/Transforms/InstCombine/sub.ll
+++ b/test/Transforms/InstCombine/sub.ll
@@ -69,3 +69,8 @@ int %test10(int %A) { ; -A *c1 == A * -c1
ret int %E
}
+bool %test11(ubyte %A, ubyte %B) {
+ %C = sub ubyte %A, %B
+ %cD = setne ubyte %C, 0 ; == setne A, B
+ ret bool %cD
+}
diff --git a/test/Transforms/InstCombine/xor.ll b/test/Transforms/InstCombine/xor.ll
index 0273768f56..3707c5de3a 100644
--- a/test/Transforms/InstCombine/xor.ll
+++ b/test/Transforms/InstCombine/xor.ll
@@ -78,3 +78,9 @@ ubyte %test11(ubyte %A) {
%C = xor ubyte %B, 4 ; transform into an AND
ret ubyte %C
}
+
+bool %test12(ubyte %A) {
+ %B = xor ubyte %A, 4
+ %c = setne ubyte %B, 0
+ ret bool %c
+}