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 | 41dc0fcb68e7ea5d7c043af2a6303adfdad19c72 (patch) | |
tree | 05a451b401a19eabcd7223c1279f3675a318a197 /test | |
parent | fa5a91a71ee3c62c6f0bc6cc1388175ad6f925c4 (diff) | |
download | external_llvm-41dc0fcb68e7ea5d7c043af2a6303adfdad19c72.zip external_llvm-41dc0fcb68e7ea5d7c043af2a6303adfdad19c72.tar.gz external_llvm-41dc0fcb68e7ea5d7c043af2a6303adfdad19c72.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48631 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/InstCombine/add.ll | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/add.ll b/test/Transforms/InstCombine/add.ll index b479514..6ff2187 100644 --- a/test/Transforms/InstCombine/add.ll +++ b/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 +} |