diff options
author | Chris Lattner <sabre@nondot.org> | 2008-08-06 07:35:52 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-08-06 07:35:52 +0000 |
commit | 46bbad217b9fe616cc9309e6ee6b507a118cd618 (patch) | |
tree | f5bf747f5901ee9092555ff9cee78c9b28e49866 /test | |
parent | bbe51362d53a532942997903a49faa7b5b50ad1f (diff) | |
download | llvm-46bbad217b9fe616cc9309e6ee6b507a118cd618.tar.gz llvm-46bbad217b9fe616cc9309e6ee6b507a118cd618.tar.bz2 llvm-46bbad217b9fe616cc9309e6ee6b507a118cd618.tar.xz |
optimize a common idiom generated by clang for bitfield access, PR2638.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54408 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/InstCombine/sext-misc.ll | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/sext-misc.ll b/test/Transforms/InstCombine/sext-misc.ll index 69850025ac..58749666ea 100644 --- a/test/Transforms/InstCombine/sext-misc.ll +++ b/test/Transforms/InstCombine/sext-misc.ll @@ -63,3 +63,13 @@ F: ret i16 %W } +; PR2638 +define i32 @test2(i32 %i) nounwind { +entry: + %tmp12 = trunc i32 %i to i8 ; <i8> [#uses=1] + %tmp16 = shl i8 %tmp12, 6 ; <i8> [#uses=1] + %a = ashr i8 %tmp16, 6 ; <i8> [#uses=1] + %b = sext i8 %a to i32 ; <i32> [#uses=1] + ret i32 %b +} + |