Add an additional InstructionSimplify factorization test.

llvm-svn: 122333
This commit is contained in:
Duncan Sands 2010-12-21 15:12:22 +00:00
parent fecc642224
commit 76befde93a
1 changed files with 10 additions and 0 deletions

View File

@ -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