diff options
author | Shih-wei Liao <sliao@google.com> | 2010-02-10 11:10:31 -0800 |
---|---|---|
committer | Shih-wei Liao <sliao@google.com> | 2010-02-10 11:10:31 -0800 |
commit | e264f62ca09a8f65c87a46d562a4d0f9ec5d457e (patch) | |
tree | 59e3d57ef656cef79afa708ae0a3daf25cd91fcf /test/Transforms/InstCombine/apint-add1.ll | |
download | external_llvm-e264f62ca09a8f65c87a46d562a4d0f9ec5d457e.zip external_llvm-e264f62ca09a8f65c87a46d562a4d0f9ec5d457e.tar.gz external_llvm-e264f62ca09a8f65c87a46d562a4d0f9ec5d457e.tar.bz2 |
Check in LLVM r95781.
Diffstat (limited to 'test/Transforms/InstCombine/apint-add1.ll')
-rw-r--r-- | test/Transforms/InstCombine/apint-add1.ll | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/apint-add1.ll b/test/Transforms/InstCombine/apint-add1.ll new file mode 100644 index 0000000..02f1baf --- /dev/null +++ b/test/Transforms/InstCombine/apint-add1.ll @@ -0,0 +1,34 @@ +; This test makes sure that add instructions are properly eliminated. +; This test is for Integer BitWidth <= 64 && BitWidth % 8 != 0. + +; RUN: opt < %s -instcombine -S | \ +; RUN: grep -v OK | not grep add + + +define i1 @test1(i1 %x) { + %tmp.2 = xor i1 %x, 1 + ;; Add of sign bit -> xor of sign bit. + %tmp.4 = add i1 %tmp.2, 1 + ret i1 %tmp.4 +} + +define i47 @test2(i47 %x) { + %tmp.2 = xor i47 %x, 70368744177664 + ;; Add of sign bit -> xor of sign bit. + %tmp.4 = add i47 %tmp.2, 70368744177664 + ret i47 %tmp.4 +} + +define i15 @test3(i15 %x) { + %tmp.2 = xor i15 %x, 16384 + ;; Add of sign bit -> xor of sign bit. + %tmp.4 = add i15 %tmp.2, 16384 + ret i15 %tmp.4 +} + +define i49 @test6(i49 %x) { + ;; (x & 254)+1 -> (x & 254)|1 + %tmp.2 = and i49 %x, 562949953421310 + %tmp.4 = add i49 %tmp.2, 1 + ret i49 %tmp.4 +} |