}
case X86ISD::VBROADCAST: {
SDValue Src = N.getOperand(0);
- if (!Src.getSimpleValueType().isVector())
- return false;
+ if (!Src.getSimpleValueType().isVector()) {
+ if (Src.getOpcode() != ISD::EXTRACT_VECTOR_ELT ||
+ !isNullConstant(Src.getOperand(1)) ||
+ Src.getOperand(0).getValueType().getScalarType() !=
+ VT.getScalarType())
+ return false;
+ Src = Src.getOperand(0);
+ }
Ops.push_back(Src);
Mask.append(NumElts, 0);
return true;
; X86-LABEL: broadcast_v2i64_multiuse:
; X86: # %bb.0: # %entry
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
-; X86-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
-; X86-NEXT: vmovddup {{.*#+}} xmm0 = xmm0[0,0]
-; X86-NEXT: vextractps $2, %xmm0, %eax
+; X86-NEXT: vmovq {{.*#+}} xmm0 = mem[0],zero
+; X86-NEXT: vmovd %xmm0, %eax
; X86-NEXT: addl (%ecx), %eax
; X86-NEXT: retl
;