diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-12-18 18:40:20 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-12-18 18:40:20 +0000 |
commit | f0e5d2f032496b9484c7634cb127b2d645d4b337 (patch) | |
tree | aef57a2bccdb563e43c456e166f8ef630f908658 /llvm/lib/CodeGen/MachineBasicBlock.cpp | |
parent | 39e7c6e370ffaf941503cd8b3f54767e4e7fa886 (diff) | |
download | llvm-f0e5d2f032496b9484c7634cb127b2d645d4b337.zip llvm-f0e5d2f032496b9484c7634cb127b2d645d4b337.tar.gz llvm-f0e5d2f032496b9484c7634cb127b2d645d4b337.tar.bz2 |
LoopVectorize: Emit reductions as log2(vectorsize) shuffles + vector ops instead of scalar operations.
For example on x86 with SSE4.2 a <8 x i8> add reduction becomes
movdqa %xmm0, %xmm1
movhlps %xmm1, %xmm1 ## xmm1 = xmm1[1,1]
paddw %xmm0, %xmm1
pshufd $1, %xmm1, %xmm0 ## xmm0 = xmm1[1,0,0,0]
paddw %xmm1, %xmm0
phaddw %xmm0, %xmm0
pextrb $0, %xmm0, %edx
instead of
pextrb $2, %xmm0, %esi
pextrb $0, %xmm0, %edx
addb %sil, %dl
pextrb $4, %xmm0, %esi
addb %dl, %sil
pextrb $6, %xmm0, %edx
addb %sil, %dl
pextrb $8, %xmm0, %esi
addb %dl, %sil
pextrb $10, %xmm0, %edi
pextrb $14, %xmm0, %edx
addb %sil, %dil
pextrb $12, %xmm0, %esi
addb %dil, %sil
addb %sil, %dl
llvm-svn: 170439
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
0 files changed, 0 insertions, 0 deletions