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);
|
||||
break;
|
||||
case ISD::Constant: {
|
||||
auto *CV = cast<ConstantSDNode>(V.getNode());
|
||||
assert(CV && "Const value should be ConstSDNode.");
|
||||
const APInt &CVal = CV->getAPIntValue();
|
||||
const APInt &CVal = cast<ConstantSDNode>(V)->getAPIntValue();
|
||||
APInt NewVal = CVal & DemandedBits;
|
||||
if (NewVal != CVal)
|
||||
return getConstant(NewVal, SDLoc(V), V.getValueType());
|
||||
|
|
Loading…
Reference in New Issue