More testcases, which I'll implement later
authorChris Lattner <sabre@nondot.org>
Thu, 24 Jul 2003 19:44:51 +0000 (19:44 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 24 Jul 2003 19:44:51 +0000 (19:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7298 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/add.ll
test/Transforms/InstCombine/and.ll
test/Transforms/InstCombine/or.ll

index e3b9c98f317b2e30628360473b100bbae578260b..10040f972cc3288182b5ff643755eef6ea221778 100644 (file)
@@ -55,3 +55,8 @@ int %test8(int %A, int %B) {     ; (A & C1)+(B & C2) -> (A & C1)|(B & C2) iff C1
        ret int %C
 }
 
+int %test9(int %A) {
+       %B = shl int %A, ubyte 4
+       %C = add int %B, %B      ; === shl int %A, 5
+       ret int %C
+}
index 3eeac3b17f5320ca984ba9af338414754868ad48..23bd2df3977ca3c7195caf53f4cd9a5fc7e68832 100644 (file)
@@ -74,4 +74,17 @@ uint %test11(uint %A, uint* %P) {
        ret uint %D
 }
 
+bool %test12(uint %A, uint %B) {
+       %C1 = setlt uint %A, %B
+       %C2 = setle uint %A, %B
+       %D = and bool %C1, %C2      ; (A < B) & (A <= B) === (A < B)
+       ret bool %D
+}
+
+bool %test13(uint %A, uint %B) {
+       %C1 = setlt uint %A, %B
+       %C2 = setgt uint %A, %B
+       %D = and bool %C1, %C2      ; (A < B) & (A > B) === false
+       ret bool %D
+}
 
index c4a62283f3c2d456ef0ba8da2761769ae76a290e..43ed83d6188c451604a0e98a57fc2dda1c87b3a9 100644 (file)
@@ -93,3 +93,10 @@ bool %test14(uint %A, uint %B) {
        ret bool %D
 }
 
+bool %test15(uint %A, uint %B) {
+        %C1 = setlt uint %A, %B
+        %C2 = seteq uint %A, %B
+        %D = or bool %C1, %C2      ; (A < B) | (A == B) === A <= B
+        ret bool %D
+}
+