if (ShiftInst *XS = dyn_cast<ShiftInst>(Op0BO->getOperand(1)))
if (isLeftShift && XS->hasOneUse() && XS->getOperand(1) == CUI &&
XS->getOpcode() == Instruction::Shr) {
- break;
Instruction *YS = new ShiftInst(Instruction::Shl,
Op0BO->getOperand(0), CUI,
Op0BO->getName());
InsertNewInstBefore(X, I); // (X + (Y << C))
Constant *C2 = ConstantInt::getAllOnesValue(X->getType());
C2 = ConstantExpr::getShl(C2, CUI);
- std::cerr << "FOLD1: " << *Op0BO;
return BinaryOperator::createAnd(X, C2);
}
// Fall through.
InsertNewInstBefore(X, I); // (X + (Y << C))
Constant *C2 = ConstantInt::getAllOnesValue(X->getType());
C2 = ConstantExpr::getShl(C2, CUI);
- std::cerr << "FOLD2: " << *Op0BO;
return BinaryOperator::createAnd(X, C2);
}
break;