@@ -9789,6 +9789,7 @@ static bool IsElementEquivalent(int MaskSize, SDValue Op, SDValue ExpectedOp,
97899789 if (!Op || !ExpectedOp || Op.getOpcode() != ExpectedOp.getOpcode())
97909790 return false;
97919791
9792+ EVT VT = Op.getValueType();
97929793 switch (Op.getOpcode()) {
97939794 case ISD::BUILD_VECTOR:
97949795 // If the values are build vectors, we can look through them to find
@@ -9800,9 +9801,8 @@ static bool IsElementEquivalent(int MaskSize, SDValue Op, SDValue ExpectedOp,
98009801 break;
98019802 case X86ISD::VBROADCAST:
98029803 case X86ISD::VBROADCAST_LOAD:
9803- // TODO: Handle MaskSize != Op.getValueType().getVectorNumElements()?
9804- return (Op == ExpectedOp &&
9805- (int)Op.getValueType().getVectorNumElements() == MaskSize);
9804+ // TODO: Handle MaskSize != VT.getVectorNumElements()?
9805+ return (Op == ExpectedOp && (int)VT.getVectorNumElements() == MaskSize);
98069806 case X86ISD::HADD:
98079807 case X86ISD::HSUB:
98089808 case X86ISD::FHADD:
@@ -9813,7 +9813,6 @@ static bool IsElementEquivalent(int MaskSize, SDValue Op, SDValue ExpectedOp,
98139813 // TODO: Handle MaskSize != NumElts?
98149814 // TODO: Handle HOP(X,Y) vs HOP(Y,X) equivalence cases.
98159815 if (Op == ExpectedOp && Op.getOperand(0) == Op.getOperand(1)) {
9816- MVT VT = Op.getSimpleValueType();
98179816 int NumElts = VT.getVectorNumElements();
98189817 if (MaskSize == NumElts) {
98199818 int NumLanes = VT.getSizeInBits() / 128;
0 commit comments