[X86] Add extra rules for combining vselect dag nodes into movsd.
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Tue, 28 Jan 2014 18:14:21 +0000 (18:14 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Tue, 28 Jan 2014 18:14:21 +0000 (18:14 +0000)
commit106b79744b185969faf8a74c6bd7cad35e6f11bd
tree4c15347510f68dd40e18caff39499634243557a1
parentbb6f2367296bf6e78049ff32e7fa4f7c96d80a47
[X86] Add extra rules for combining vselect dag nodes into movsd.

This improves the fix committed at revision 199683 adding the
following new target specific combine rules:

1) fold (v4i32: vselect <0,0,-1,-1>, A, B) ->
        (v4i32 (bitcast (movsd (v2i64 (bitcast A)), (v2i64 (bitcast B))) ))

2) fold (v4f32: vselect <0,0,-1,-1>, A, B) ->
        (v4f32 (bitcast (movsd (v2f64 (bitcast A)), (v2f64 (bitcast B))) ))

3) fold (v4i32: vselect <-1,-1,0,0>, A, B) ->
        (v4i32 (bitcast (movsd (v2i64 (bitcast B)), (v2i64 (bitcast A))) ))

4) fold (v4f32: vselect <-1,-1,0,0>, A, B) ->
        (v4f32 (bitcast (movsd (v2i64 (bitcast B)), (v2i64 (bitcast A))) ))

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200324 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/sse41-blend.ll
test/CodeGen/X86/vselect-2.ll [new file with mode: 0644]