Optimize merging of scalar loads for 32-byte vectors [X86, AVX]
authorSanjay Patel <spatel@rotateright.com>
Fri, 5 Dec 2014 21:28:14 +0000 (21:28 +0000)
committerSanjay Patel <spatel@rotateright.com>
Fri, 5 Dec 2014 21:28:14 +0000 (21:28 +0000)
commit4bf9b7685ced4eda2426491e759c77852c707578
treef68f42300a039664536ed3132813a92a793b0583
parentfd860bc41aa083b8f6fafecb63b242de40659241
Optimize merging of scalar loads for 32-byte vectors [X86, AVX]

Fix the poor codegen seen in PR21710 ( http://llvm.org/bugs/show_bug.cgi?id=21710 ).
Before we crack 32-byte build vectors into smaller chunks (and then subsequently
glue them back together), we should look for the easy case where we can just load
all elements in a single op.

An example of the codegen change is:

From:

vmovss  16(%rdi), %xmm1
vmovups (%rdi), %xmm0
vinsertps       $16, 20(%rdi), %xmm1, %xmm1
vinsertps       $32, 24(%rdi), %xmm1, %xmm1
vinsertps       $48, 28(%rdi), %xmm1, %xmm1
vinsertf128     $1, %xmm1, %ymm0, %ymm0
retq

To:

vmovups (%rdi), %ymm0
retq

Differential Revision: http://reviews.llvm.org/D6536

llvm-svn: 223518
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/vec_loadsingles.ll