{DAGCombine] Convert (Val & Mask) == Mask to Mask.isSubsetof(Val). NFCI.

llvm-svn: 308460
This commit is contained in:
Simon Pilgrim 2017-07-19 13:39:58 +00:00
parent 4c5fd9cd7f
commit c77e262260
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}