OSDN Git Service

[X86][SSE] Enable commutation for SSE immediate blend instructions
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 4 Nov 2014 23:25:08 +0000 (23:25 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 4 Nov 2014 23:25:08 +0000 (23:25 +0000)
commit4ad0654bb4fef86b0cee8c0393d38304d352aa8d
tree06c1d14cf03bebb0986f7d1a45716afc46bfa9a3
parentffb62b7e7775c4dc2ab38cd3497a93abbd20f1cd
[X86][SSE] Enable commutation for SSE immediate blend instructions

Patch to allow (v)blendps, (v)blendpd, (v)pblendw and vpblendd instructions to be commuted - swaps the src registers and inverts the blend mask.

This is primarily to improve memory folding (see new tests), but it also improves the quality of shuffles (see modified tests).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221313 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86InstrInfo.cpp
lib/Target/X86/X86InstrSSE.td
test/CodeGen/X86/combine-or.ll
test/CodeGen/X86/commute-blend-avx2.ll [new file with mode: 0644]
test/CodeGen/X86/commute-blend-sse41.ll [new file with mode: 0644]
test/CodeGen/X86/vector-blend.ll
test/CodeGen/X86/vector-shuffle-128-v2.ll
test/CodeGen/X86/vector-shuffle-combining.ll