[llvm-commits] [llvm] r92380 - /llvm/trunk/test/Transforms/Reassociate/basictest.ll

Chris Lattner sabre at nondot.org
Thu Dec 31 16:50:00 PST 2009


Author: lattner
Date: Thu Dec 31 18:50:00 2009
New Revision: 92380

URL: http://llvm.org/viewvc/llvm-project?rev=92380&view=rev
Log:
test case we alredy get right.

Modified:
    llvm/trunk/test/Transforms/Reassociate/basictest.ll

Modified: llvm/trunk/test/Transforms/Reassociate/basictest.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Reassociate/basictest.ll?rev=92380&r1=92379&r2=92380&view=diff

==============================================================================
--- llvm/trunk/test/Transforms/Reassociate/basictest.ll (original)
+++ llvm/trunk/test/Transforms/Reassociate/basictest.ll Thu Dec 31 18:50:00 2009
@@ -179,3 +179,15 @@
 ; CHECK-NEXT: ret i32
 }
 
+define i32 @test13(i32 %X1, i32 %X2, i32 %X3) {
+  %A = sub i32 0, %X1
+  %B = mul i32 %A, %X2   ; -X1*X2
+  %C = mul i32 %X1, %X3  ; X1*X3
+  %D = add i32 %B, %C    ; -X1*X2 + X1*X3 -> X1*(X3-X2)
+  ret i32 %D
+; CHECK: @test13
+; CHECK-NEXT: sub i32 %X3, %X2
+; CHECK-NEXT: mul i32 {{.*}}, %X1
+; CHECK-NEXT: ret i32
+}
+





More information about the llvm-commits mailing list