diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-04-01 20:09:10 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-04-01 20:09:10 +0000 |
commit | 0baa94a13bf24cf7d916b4c6c415fb84b464bfd3 (patch) | |
tree | 5d431ec7da7f78c86da8b42e2f2733f412066b93 /lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp | |
parent | 0a30c42008f88c3fba64127da8d73ba2fcd16fd6 (diff) |
InstCombine: Turn icmp + sext into bitwise/integer ops when the input has only one unknown bit.
int test1(unsigned x) { return (x&8) ? 0 : -1; }
int test3(unsigned x) { return (x&8) ? -1 : 0; }
before (x86_64):
_test1:
andl $8, %edi
cmpl $1, %edi
sbbl %eax, %eax
ret
_test3:
andl $8, %edi
cmpl $1, %edi
sbbl %eax, %eax
notl %eax
ret
after:
_test1:
shrl $3, %edi
andl $1, %edi
leal -1(%rdi), %eax
ret
_test3:
shll $28, %edi
movl %edi, %eax
sarl $31, %eax
ret
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128732 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp')
0 files changed, 0 insertions, 0 deletions