[X86][SSE] Support combining MOVLHPS undef inputs

llvm-svn: 322459
This commit is contained in:
Simon Pilgrim 2018-01-14 18:50:34 +00:00
parent 73cebe807b
commit 9904fe77a0
2 changed files with 2 additions and 2 deletions

View File

@ -28233,6 +28233,7 @@ static bool matchBinaryVectorShuffle(MVT MaskVT, ArrayRef<int> Mask,
if (MaskVT.is128BitVector()) {
if (isTargetShuffleEquivalent(Mask, {0, 0}) && AllowFloatDomain) {
V2 = V1;
V1 = (SM_SentinelUndef == Mask[0] ? DAG.getUNDEF(MVT::v4f32) : V1);
Shuffle = X86ISD::MOVLHPS;
SrcVT = DstVT = MVT::v4f32;
return true;

View File

@ -301,8 +301,7 @@ define <2 x double> @shuffle_v2f64_21(<2 x double> %a, <2 x double> %b) {
define <2 x double> @shuffle_v2f64_u2(<2 x double> %a, <2 x double> %b) {
; SSE2-LABEL: shuffle_v2f64_u2:
; SSE2: # %bb.0:
; SSE2-NEXT: movlhps {{.*#+}} xmm1 = xmm1[0,0]
; SSE2-NEXT: movaps %xmm1, %xmm0
; SSE2-NEXT: movlhps {{.*#+}} xmm0 = xmm0[0],xmm1[0]
; SSE2-NEXT: retq
;
; SSE3-LABEL: shuffle_v2f64_u2: