forked from OSchip/llvm-project
{DAGCombine] Convert (Val & Mask) == Mask to Mask.isSubsetof(Val). NFCI.
llvm-svn: 308460
This commit is contained in:
parent
4c5fd9cd7f
commit
c77e262260
|
@ -7854,7 +7854,7 @@ SDValue DAGCombiner::GetDemandedBits(SDValue V, const APInt &Mask) {
|
|||
case ISD::AND: {
|
||||
// X & -1 -> X (ignoring bits which aren't demanded).
|
||||
ConstantSDNode *AndVal = isConstOrConstSplat(V.getOperand(1));
|
||||
if (AndVal && (AndVal->getAPIntValue() & Mask) == Mask)
|
||||
if (AndVal && Mask.isSubsetOf(AndVal->getAPIntValue()))
|
||||
return V.getOperand(0);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue