[PATCH] [x86] Combine x86mmx/i64 to v2i64 conversion to use	scalar_to_vector
    Nadav Rotem 
    nrotem at apple.com
       
    Thu Jan 22 10:20:11 PST 2015
    
    
  
LGTM. 
> On Jan 22, 2015, at 5:10 AM, Bruno Cardoso Lopes <bruno.cardoso at gmail.com> wrote:
> 
> Hi chandlerc, spatel, nadav,
> 
> Handle the poor codegen for i64/x86xmm->v2i64 (%mm -> %xmm) moves. Instead of using stack store/load pair to do the job, use scalar_to_vector directly, which in the MMX case can use movq2dq. This was the current behavior prior to improvements for vector legalization of extloads in r213897. This patch fixes the regression and as a side-effect also remove some unnecessary shuffles.
> 
> In the new attached testcase, we go from:
> 
> pshufw  $-18, (%rdi), %mm0
> movq    %mm0, -8(%rsp)
> movq    -8(%rsp), %xmm0
> pshufd  $-44, %xmm0, %xmm0
> movd    %xmm0, %eax
> ...
> 
> To:
> 
> pshufw  $-18, (%rdi), %mm0
> movq2dq %mm0, %xmm0
> movd    %xmm0, %eax
> ...
> 
> REPOSITORY
>  rL LLVM
> 
> http://reviews.llvm.org/D7126
> 
> Files:
>  lib/Target/X86/X86ISelLowering.cpp
>  test/CodeGen/X86/2012-01-18-vbitcast.ll
>  test/CodeGen/X86/lower-bitcast.ll
>  test/CodeGen/X86/mmx-movq2dq.ll
>  test/CodeGen/X86/widen_load-2.ll
> 
> EMAIL PREFERENCES
>  http://reviews.llvm.org/settings/panel/emailpreferences/
> <D7126.18606.patch>
    
    
More information about the llvm-commits
mailing list