forked from OSchip/llvm-project
[DAG] GetDemandedBits - don't bother asserting for a non-null cast<> result. NFC.
cast<> will assert on failure anyhow. This lets us fold the cast<> with the getAPIntValue() that uses it.
This commit is contained in:
parent
a2f32bfcc7
commit
c438b257f1
|
@ -2195,9 +2195,7 @@ SDValue SelectionDAG::GetDemandedBits(SDValue V, const APInt &DemandedBits,
|
||||||
*this, 0);
|
*this, 0);
|
||||||
break;
|
break;
|
||||||
case ISD::Constant: {
|
case ISD::Constant: {
|
||||||
auto *CV = cast<ConstantSDNode>(V.getNode());
|
const APInt &CVal = cast<ConstantSDNode>(V)->getAPIntValue();
|
||||||
assert(CV && "Const value should be ConstSDNode.");
|
|
||||||
const APInt &CVal = CV->getAPIntValue();
|
|
||||||
APInt NewVal = CVal & DemandedBits;
|
APInt NewVal = CVal & DemandedBits;
|
||||||
if (NewVal != CVal)
|
if (NewVal != CVal)
|
||||||
return getConstant(NewVal, SDLoc(V), V.getValueType());
|
return getConstant(NewVal, SDLoc(V), V.getValueType());
|
||||||
|
|
Loading…
Reference in New Issue