Add an assertion that we've calling MaskedElementsAreZero with a vector op and that the DemandedElts arg is a matching width.
Makes the error a lot easier to grok when something else accidentally gets used.
/// use this predicate to simplify operations downstream.
bool SelectionDAG::MaskedElementsAreZero(SDValue Op, const APInt &DemandedElts,
unsigned Depth) const {
+ assert(Op.getValueType().isFixedLengthVector() &&
+ Op.getValueType().getVectorNumElements() ==
+ DemandedElts.getBitWidth() &&
+ "MaskedElementsAreZero vector size mismatch");
unsigned BitWidth = Op.getScalarValueSizeInBits();
APInt DemandedBits = APInt::getAllOnesValue(BitWidth);
return MaskedValueIsZero(Op, DemandedBits, DemandedElts, Depth);