setcc of booleans should always be eliminated
authorChris Lattner <sabre@nondot.org>
Fri, 9 Aug 2002 23:34:18 +0000 (23:34 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 9 Aug 2002 23:34:18 +0000 (23:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3284 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/set.ll

index e7057bd444f2e40c62e625dc4c4e7af9094e13ff..38a490d48e25d881ab08567944f86ebdca0a03ce 100644 (file)
@@ -51,3 +51,30 @@ bool "test8"(uint %A) {
        %B = setlt uint %A, 0  ; false
        ret bool %B
 }
+
+;; test operations on boolean values these should all be eliminated$a
+bool %test9(bool %A) {
+       %B = setlt bool %A, false ; false
+       ret bool %B
+}
+bool %test10(bool %A) {
+       %B = setgt bool %A, true  ; false
+       ret bool %B
+}
+bool %test11(bool %A) {
+       %B = setle bool %A, true ; true
+       ret bool %B
+}
+bool %test12(bool %A) {
+       %B = setge bool %A, false  ; true
+       ret bool %B
+}
+bool %test13(bool %A, bool %B) {
+       %C = setge bool %A, %B       ; A | ~B
+       ret bool %C
+}
+bool %test14(bool %A, bool %B) {
+       %C = seteq bool %A, %B  ; ~(A ^ B)
+       ret bool %C
+}
+