New testcase
[oota-llvm.git] / test / Transforms / InstCombine / add.ll
index 70bb85a6c849c0e9514f1ef1b806accf5e25e9c1..d3e358d0ebbbabe54bcddbe6604aefdfaa35d688 100644 (file)
@@ -39,3 +39,22 @@ int %test5(int %A, int %B) {
         ret int %D
 }
 
+int %test6(int %A) {
+        %B = mul int 7, %A
+        %C = add int %B, %A      ; C = 7*A+A == 8*A == A << 3
+        ret int %C
+}
+
+int %test7(int %A) {
+        %B = mul int 7, %A
+        %C = add int %A, %B      ; C = A+7*A == 8*A == A << 3
+        ret int %C
+}
+
+int %test8(int %A, int %B) {     ; (A & C1)+(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0
+       %A1 = and int %A, 7
+       %B1 = and int %B, 128
+       %C = add int %A1, %B1
+       ret int %C
+}
+