@@ -4058,7 +4058,7 @@ unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, const APInt &DemandedElts,
4058
4058
4059
4059
case ISD::BITCAST: {
4060
4060
if (VT.isScalableVector ())
4061
- return 1 ;
4061
+ break ;
4062
4062
SDValue N0 = Op.getOperand (0 );
4063
4063
EVT SrcVT = N0.getValueType ();
4064
4064
unsigned SrcBits = SrcVT.getScalarSizeInBits ();
@@ -4117,7 +4117,7 @@ unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, const APInt &DemandedElts,
4117
4117
return std::max (Tmp, Tmp2);
4118
4118
case ISD::SIGN_EXTEND_VECTOR_INREG: {
4119
4119
if (VT.isScalableVector ())
4120
- return 1 ;
4120
+ break ;
4121
4121
SDValue Src = Op.getOperand (0 );
4122
4122
EVT SrcVT = Src.getValueType ();
4123
4123
APInt DemandedSrcElts = DemandedElts.zext (SrcVT.getVectorNumElements ());
@@ -4336,7 +4336,7 @@ unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, const APInt &DemandedElts,
4336
4336
}
4337
4337
case ISD::EXTRACT_ELEMENT: {
4338
4338
if (VT.isScalableVector ())
4339
- return 1 ;
4339
+ break ;
4340
4340
const int KnownSign = ComputeNumSignBits (Op.getOperand (0 ), Depth+1 );
4341
4341
const int BitWidth = Op.getValueSizeInBits ();
4342
4342
const int Items = Op.getOperand (0 ).getValueSizeInBits () / BitWidth;
@@ -4351,7 +4351,7 @@ unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, const APInt &DemandedElts,
4351
4351
}
4352
4352
case ISD::INSERT_VECTOR_ELT: {
4353
4353
if (VT.isScalableVector ())
4354
- return 1 ;
4354
+ break ;
4355
4355
// If we know the element index, split the demand between the
4356
4356
// source vector and the inserted element, otherwise assume we need
4357
4357
// the original demanded vector elements and the value.
@@ -4382,8 +4382,7 @@ unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, const APInt &DemandedElts,
4382
4382
return Tmp;
4383
4383
}
4384
4384
case ISD::EXTRACT_VECTOR_ELT: {
4385
- if (VT.isScalableVector ())
4386
- return 1 ;
4385
+ assert (!VT.isScalableVector ());
4387
4386
SDValue InVec = Op.getOperand (0 );
4388
4387
SDValue EltNo = Op.getOperand (1 );
4389
4388
EVT VecVT = InVec.getValueType ();
@@ -4423,7 +4422,7 @@ unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, const APInt &DemandedElts,
4423
4422
}
4424
4423
case ISD::CONCAT_VECTORS: {
4425
4424
if (VT.isScalableVector ())
4426
- return 1 ;
4425
+ break ;
4427
4426
// Determine the minimum number of sign bits across all demanded
4428
4427
// elts of the input vectors. Early out if the result is already 1.
4429
4428
Tmp = std::numeric_limits<unsigned >::max ();
@@ -4443,7 +4442,7 @@ unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, const APInt &DemandedElts,
4443
4442
}
4444
4443
case ISD::INSERT_SUBVECTOR: {
4445
4444
if (VT.isScalableVector ())
4446
- return 1 ;
4445
+ break ;
4447
4446
// Demand any elements from the subvector and the remainder from the src its
4448
4447
// inserted into.
4449
4448
SDValue Src = Op.getOperand (0 );
@@ -4551,12 +4550,12 @@ unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, const APInt &DemandedElts,
4551
4550
Opcode == ISD::INTRINSIC_VOID) {
4552
4551
// TODO: This can probably be removed once target code is audited. This
4553
4552
// is here purely to reduce patch size and review complexity.
4554
- if (VT.isScalableVector ())
4555
- return 1 ;
4556
- unsigned NumBits =
4553
+ if (!VT.isScalableVector ()) {
4554
+ unsigned NumBits =
4557
4555
TLI->ComputeNumSignBitsForTargetNode (Op, DemandedElts, *this , Depth);
4558
- if (NumBits > 1 )
4559
- FirstAnswer = std::max (FirstAnswer, NumBits);
4556
+ if (NumBits > 1 )
4557
+ FirstAnswer = std::max (FirstAnswer, NumBits);
4558
+ }
4560
4559
}
4561
4560
4562
4561
// Finally, if we can prove that the top bits of the result are 0's or 1's,
0 commit comments