[SelectionDAG] Prevent scalable vector warning from ComputeNumSignBits on extract_vector_elt on a scalable vector.

This commit is contained in:
Craig Topper 2021-02-01 23:08:46 -08:00
parent 6ee1f64a2e
commit 4553821815
1 changed files with 3 additions and 0 deletions

View File

@ -3922,6 +3922,9 @@ unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, const APInt &DemandedElts,
SDValue InVec = Op.getOperand(0);
SDValue EltNo = Op.getOperand(1);
EVT VecVT = InVec.getValueType();
// ComputeNumSignBits not yet implemented for scalable vectors.
if (VecVT.isScalableVector())
break;
const unsigned BitWidth = Op.getValueSizeInBits();
const unsigned EltBitWidth = Op.getOperand(0).getScalarValueSizeInBits();
const unsigned NumSrcElts = VecVT.getVectorNumElements();