enhance the load/store narrowing optimization to handle a
authorChris Lattner <sabre@nondot.org>
Thu, 15 Apr 2010 06:10:49 +0000 (06:10 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 15 Apr 2010 06:10:49 +0000 (06:10 +0000)
commite6987587d62bb4de0f57e103f677f6bfb43a09f3
treed8b6a0ddeabc34187f25860834ee0394257bd9d3
parent6dc868581b20380802e6a011de8dd9766790cf7a
enhance the load/store narrowing optimization to handle a
tokenfactor in between the load/store.  This allows us to
optimize test7 into:

_test7:                                 ## @test7
## BB#0:                                ## %entry
movl (%rdx), %eax
                                        ## kill: SIL<def> ESI<kill>
movb %sil, 5(%rdi)
ret

instead of:

_test7:                                 ## @test7
## BB#0:                                ## %entry
movl 4(%esp), %ecx
movl $-65281, %eax           ## imm = 0xFFFFFFFFFFFF00FF
andl 4(%ecx), %eax
movzbl 8(%esp), %edx
shll $8, %edx
addl %eax, %edx
movl 12(%esp), %eax
movl (%eax), %eax
movl %edx, 4(%ecx)
ret

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101355 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/X86/store-narrow.ll