diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2013-05-16 18:47:58 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2013-05-16 18:47:58 +0000 |
commit | 8401ed21aa7c8ca022aad4b83fc9c63c0b824720 (patch) | |
tree | 9dc9ec90781d9b0616299366f8040ddfa9181272 /test/CodeGen/X86 | |
parent | afcca55ff9475cdb97ec576847fc676e95397fb4 (diff) | |
download | external_llvm-8401ed21aa7c8ca022aad4b83fc9c63c0b824720.zip external_llvm-8401ed21aa7c8ca022aad4b83fc9c63c0b824720.tar.gz external_llvm-8401ed21aa7c8ca022aad4b83fc9c63c0b824720.tar.bz2 |
DAGCombine: Also shrink eq compares where the constant is exactly as large as the smaller type.
if ((x & 255) == 255)
before: movzbl %al, %eax
cmpl $255, %eax
after: cmpb $-1, %al
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182038 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86')
-rw-r--r-- | test/CodeGen/X86/shrink-compare.ll | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeGen/X86/shrink-compare.ll b/test/CodeGen/X86/shrink-compare.ll index 8d4b07f..0c16f86 100644 --- a/test/CodeGen/X86/shrink-compare.ll +++ b/test/CodeGen/X86/shrink-compare.ll @@ -34,3 +34,19 @@ if.end: ; CHECK: test2: ; CHECK: cmpb $47, %{{dil|cl}} } + +define void @test3(i32 %X) nounwind { +entry: + %and = and i32 %X, 255 + %cmp = icmp eq i32 %and, 255 + br i1 %cmp, label %if.then, label %if.end + +if.then: + tail call void @bar() nounwind + br label %if.end + +if.end: + ret void +; CHECK: test3: +; CHECK: cmpb $-1, %{{dil|cl}} +} |