diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2009-10-14 17:57:32 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2009-10-14 17:57:32 +0000 |
commit | cd749a9c07f1de2fb8affde90537efa4bc3e7c54 (patch) | |
tree | b21f6de4e08b89bb7931806bab798fc2a5e3a686 /test/Transforms/InstCombine/mul.ll | |
parent | 72621d11de5b873f1695f391eb95f0b336c3d2d4 (diff) | |
download | FreeBSD-src-cd749a9c07f1de2fb8affde90537efa4bc3e7c54.zip FreeBSD-src-cd749a9c07f1de2fb8affde90537efa4bc3e7c54.tar.gz |
Update llvm to r84119.
Diffstat (limited to 'test/Transforms/InstCombine/mul.ll')
-rw-r--r-- | test/Transforms/InstCombine/mul.ll | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/test/Transforms/InstCombine/mul.ll b/test/Transforms/InstCombine/mul.ll index 9b5f7a5..53a5643 100644 --- a/test/Transforms/InstCombine/mul.ll +++ b/test/Transforms/InstCombine/mul.ll @@ -1,5 +1,5 @@ ; This test makes sure that mul instructions are properly eliminated. -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep mul +; RUN: opt < %s -instcombine -S | not grep mul define i32 @test1(i32 %A) { %B = mul i32 %A, 1 ; <i32> [#uses=1] @@ -83,3 +83,34 @@ define internal void @test13(<4 x float>*) { store <4 x float> %3, <4 x float>* %0, align 1 ret void } + +define <16 x i8> @test14(<16 x i8> %a) { + %b = mul <16 x i8> %a, zeroinitializer + ret <16 x i8> %b +} + +; rdar://7293527 +define i32 @test15(i32 %A, i32 %B) { +entry: + %shl = shl i32 1, %B + %m = mul i32 %shl, %A + ret i32 %m +} + +; X * Y (when Y is 0 or 1) --> x & (0-Y) +define i32 @test16(i32 %b, i1 %c) { + %d = zext i1 %c to i32 ; <i32> [#uses=1] + ; e = b & (a >> 31) + %e = mul i32 %d, %b ; <i32> [#uses=1] + ret i32 %e +} + +; X * Y (when Y is 0 or 1) --> x & (0-Y) +define i32 @test17(i32 %a, i32 %b) { + %a.lobit = lshr i32 %a, 31 + %e = mul i32 %a.lobit, %b + ret i32 %e +} + + + |