diff options
author | Chris Lattner <sabre@nondot.org> | 2008-03-21 05:19:58 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-03-21 05:19:58 +0000 |
commit | c44160ce6ec851580bc7c11892ca97bd56090479 (patch) | |
tree | b5a9c3a199addbafc2c4a77b8cf558aea8c1a884 /llvm/test/Transforms/InstCombine/add.ll | |
parent | 92b4488202ac9f758ea887315e3a1303060e1e94 (diff) | |
download | bcm5719-llvm-c44160ce6ec851580bc7c11892ca97bd56090479.tar.gz bcm5719-llvm-c44160ce6ec851580bc7c11892ca97bd56090479.zip |
Teach masked value is zero about add and sub, and use MVIZ to
simplify things like (X & 4) >> 1 == 2 --> (X & 4) == 4.
since it is obvious that the shift doesn't remove any bits.
llvm-svn: 48631
Diffstat (limited to 'llvm/test/Transforms/InstCombine/add.ll')
-rw-r--r-- | llvm/test/Transforms/InstCombine/add.ll | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/add.ll b/llvm/test/Transforms/InstCombine/add.ll index b4795147c6e..6ff2187474f 100644 --- a/llvm/test/Transforms/InstCombine/add.ll +++ b/llvm/test/Transforms/InstCombine/add.ll @@ -268,3 +268,10 @@ define i32 @test35(i32 %a) { ret i32 %tmp2 } +define i32 @test36(i32 %a) { + %x = and i32 %a, -2 + %y = and i32 %a, -126 + %z = add i32 %x, %y + %q = and i32 %z, 1 ; always zero + ret i32 %q +} |