aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/Transforms/InstSimplify/2010-12-20-Distribute.ll10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Transforms/InstSimplify/2010-12-20-Distribute.ll b/test/Transforms/InstSimplify/2010-12-20-Distribute.ll
index 56f7823417..4aac8dd588 100644
--- a/test/Transforms/InstSimplify/2010-12-20-Distribute.ll
+++ b/test/Transforms/InstSimplify/2010-12-20-Distribute.ll
@@ -10,6 +10,16 @@ define i32 @factorize(i32 %x, i32 %y) {
; CHECK: ret i32 %x
}
+define i32 @factorize2(i32 %x) {
+; CHECK: @factorize2
+; 3*X - 2*X -> X
+ %l = mul i32 3, %x
+ %r = mul i32 2, %x
+ %z = sub i32 %l, %r
+ ret i32 %z
+; CHECK: ret i32 %x
+}
+
define i32 @expand(i32 %x) {
; CHECK: @expand
; ((X & 1) | 2) & 1 -> ((X & 1) & 1) | (2 & 1) -> (X & 1) | 0 -> X & 1