[llvm-commits] [llvm] r122333 - /llvm/trunk/test/Transforms/InstSimplify/2010-12-20-Distribute.ll

Duncan Sands baldrick at free.fr
Tue Dec 21 07:12:22 PST 2010


Author: baldrick
Date: Tue Dec 21 09:12:22 2010
New Revision: 122333

URL: http://llvm.org/viewvc/llvm-project?rev=122333&view=rev
Log:
Add an additional InstructionSimplify factorization test.

Modified:
    llvm/trunk/test/Transforms/InstSimplify/2010-12-20-Distribute.ll

Modified: llvm/trunk/test/Transforms/InstSimplify/2010-12-20-Distribute.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstSimplify/2010-12-20-Distribute.ll?rev=122333&r1=122332&r2=122333&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstSimplify/2010-12-20-Distribute.ll (original)
+++ llvm/trunk/test/Transforms/InstSimplify/2010-12-20-Distribute.ll Tue Dec 21 09:12:22 2010
@@ -10,6 +10,16 @@
 ; 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





More information about the llvm-commits mailing list