add one more bitfield optimization, allowing clang to generate
authorChris Lattner <sabre@nondot.org>
Mon, 11 Jan 2010 06:55:24 +0000 (06:55 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 11 Jan 2010 06:55:24 +0000 (06:55 +0000)
commit8e76764de86d7906db5123626b65f593e159d9f3
tree2ceb1b4cbdd050c6c96bdb99bf354ca4bff32a09
parent7acc4b12813117774deefb54c5febb49a215aa70
add one more bitfield optimization, allowing clang to generate
good code on PR4216:

_test_bitfield:                                             ## @test_bitfield
orl $32962, %edi
movl $4294941946, %eax
andq %rdi, %rax
ret

instead of:

_test_bitfield:
        movl    $4294941696, %ecx
        movl    %edi, %eax
        orl     $194, %edi
        orl     $32768, %eax
        andq    $250, %rdi
        andq    %rax, %rcx
        movq    %rdi, %rax
        orq     %rcx, %rax
        ret

Evan is looking into the remaining andq+imm -> andl optimization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93147 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
test/Transforms/InstCombine/or.ll