reduce indentation; NFCI

llvm-svn: 270007
This commit is contained in:
Sanjay Patel 2016-05-19 00:33:07 +00:00
parent fc91edb062
commit b2bcd95aab
1 changed files with 7 additions and 9 deletions

View File

@ -2430,15 +2430,13 @@ SDValue DAGCombiner::visitREM(SDNode *N) {
}
// fold (urem x, (shl pow2, y)) -> (and x, (add (shl pow2, y), -1))
if (N1.getOpcode() == ISD::SHL) {
if (ConstantSDNode *SHC = getAsNonOpaqueConstant(N1.getOperand(0))) {
if (SHC->getAPIntValue().isPowerOf2()) {
SDValue Add =
DAG.getNode(ISD::ADD, DL, VT, N1,
DAG.getConstant(APInt::getAllOnesValue(VT.getSizeInBits()), DL,
VT));
AddToWorklist(Add.getNode());
return DAG.getNode(ISD::AND, DL, VT, N0, Add);
}
ConstantSDNode *SHC = getAsNonOpaqueConstant(N1.getOperand(0));
if (SHC && SHC->getAPIntValue().isPowerOf2()) {
APInt NegOne = APInt::getAllOnesValue(VT.getSizeInBits());
SDValue Add =
DAG.getNode(ISD::ADD, DL, VT, N1, DAG.getConstant(NegOne, DL, VT));
AddToWorklist(Add.getNode());
return DAG.getNode(ISD::AND, DL, VT, N0, Add);
}
}
}