diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-01-11 04:05:13 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-01-11 04:05:13 +0000 |
| commit | 4052afef7f803222301b9d05f08630f293d81dcc (patch) | |
| tree | c08e8a420a122b404ec6f293aa7e3561d5d0034e /lib/Transforms/InstCombine/InstCombineAndOrXor.cpp | |
| parent | de7097f9a3c2f1a50c971920ac112527febf5d2e (diff) | |
| download | external_llvm-4052afef7f803222301b9d05f08630f293d81dcc.zip external_llvm-4052afef7f803222301b9d05f08630f293d81dcc.tar.gz external_llvm-4052afef7f803222301b9d05f08630f293d81dcc.tar.bz2 | |
Extend CanEvaluateZExtd to handle and/or/xor more aggressively in the
BitsToClear case. This allows it to promote expressions which have an
and/or/xor after the lshr, promoting cases like test2 (from PR4216)
and test3 (random extample extracted from a spec benchmark).
clang now compiles the code in PR4216 into:
_test_bitfield: ## @test_bitfield
movl %edi, %eax
orl $194, %eax
movl $4294902010, %ecx
andq %rax, %rcx
orl $32768, %edi
andq $39936, %rdi
movq %rdi, %rax
orq %rcx, %rax
ret
instead of:
_test_bitfield: ## @test_bitfield
movl %edi, %eax
orl $194, %eax
movl $4294902010, %ecx
andq %rax, %rcx
shrl $8, %edi
orl $128, %edi
shlq $8, %rdi
andq $39936, %rdi
movq %rdi, %rax
orq %rcx, %rax
ret
which is still not great, but is progress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93145 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstCombineAndOrXor.cpp')
0 files changed, 0 insertions, 0 deletions
