Lines Matching full:instruction
29 Instruction &CxtI) {
60 if (I->getOpcode() == Instruction::LShr && !I->isExact()) {
65 if (I->getOpcode() == Instruction::Shl && !I->hasNoUnsignedWrap()) {
129 Instruction &CxtI) {
168 Instruction *InstCombiner::visitMul(BinaryOperator &I) {
261 if (Instruction *R = FoldOpIntoSelect(I, SI))
265 if (Instruction *NV = FoldOpIntoPhi(I))
299 (BO->getOpcode() != Instruction::UDiv &&
300 BO->getOpcode() != Instruction::SDiv)) {
307 (BO->getOpcode() == Instruction::UDiv ||
308 BO->getOpcode() == Instruction::SDiv)) {
320 if (BO->getOpcode() == Instruction::UDiv)
409 Instruction *I = dyn_cast<Instruction>(OpLog2Of);
412 if (I->getOpcode() != Instruction::FMul || !I->hasUnsafeAlgebra())
454 Instruction *I = dyn_cast<Instruction>(V);
455 if (!I || (I->getOpcode() != Instruction::FMul &&
456 I->getOpcode() != Instruction::FDiv))
475 Value *InstCombiner::foldFMulConst(Instruction *FMulOrDiv, Constant *C,
476 Instruction *InsertBefore) {
488 if (FMulOrDiv->getOpcode() == Instruction::FMul) {
523 Instruction *InstCombiner::visitFMul(BinaryOperator &I) {
543 if (Instruction *R = FoldOpIntoSelect(I, SI))
547 if (Instruction *NV = FoldOpIntoPhi(I))
553 Instruction *RI = BinaryOperator::CreateFSub(NegZero, Op0);
565 if (Value *V = foldFMulConst(cast<Instruction>(Op0), C, &I))
569 Instruction *FAddSub = dyn_cast<Instruction>(Op0);
571 (FAddSub->getOpcode() == Instruction::FAdd ||
572 FAddSub->getOpcode() == Instruction::FSub)) {
587 foldFMulConst(cast<Instruction>(Opnd0), C, &I) :
590 if (Swap && FAddSub->getOpcode() == Instruction::FSub)
593 Instruction *RI = (FAddSub->getOpcode() == Instruction::FAdd)
669 // latency of the instruction Y is amortized by the expression of X*X,
705 /// instruction.
749 for (Instruction::op_iterator I = BBI->op_begin(), E = BBI->op_end();
760 // If we past the instruction, quit looking for it.
779 Instruction *InstCombiner::commonIDivTransforms(BinaryOperator &I) {
793 if (Instruction *LHS = dyn_cast<Instruction>(Op0)) {
798 bool IsSigned = I.getOpcode() == Instruction::SDiv;
824 Instruction::Mul, X, ConstantInt::get(X->getType(), Quotient));
852 Instruction::Mul, X, ConstantInt::get(X->getType(), Quotient));
864 if (Instruction *R = FoldOpIntoSelect(I, SI))
867 if (Instruction *NV = FoldOpIntoPhi(I))
875 bool isSigned = I.getOpcode() == Instruction::SDiv;
892 // See if we can fold away this div instruction.
899 bool isSigned = I.getOpcode() == Instruction::SDiv;
923 typedef Instruction *(*FoldUDivOperandCb)(Value *Op0, Value *Op1,
935 Instruction *FoldResult; ///< The instruction returned when FoldAction is
950 static Instruction *foldUDivPow2Cst(Value *Op0, Value *Op1,
961 static Instruction *foldUDivNegCst(Value *Op0, Value *Op1,
970 static Instruction *foldUDivShl(Value *Op0, Value *Op1, const BinaryOperator &I,
972 Instruction *ShiftLeft = cast<Instruction>(Op1);
974 ShiftLeft = cast<Instruction>(ShiftLeft->getOperand(0));
990 // instruction, seeing through select instructions, to determine if we can
1032 Instruction *InstCombiner::visitUDiv(BinaryOperator &I) {
1042 if (Instruction *Common = commonIDivTransforms(I))
1077 Instruction *Inst;
1105 Instruction *InstCombiner::visitSDiv(BinaryOperator &I) {
1115 if (Instruction *Common = commonIDivTransforms(I))
1180 static Instruction *CvtFDivConstToReciprocal(Value *Dividend, Constant *Divisor,
1203 Instruction *InstCombiner::visitFDiv(BinaryOperator &I) {
1215 if (Instruction *R = FoldOpIntoSelect(I, SI))
1223 if (Instruction *R = FoldOpIntoSelect(I, SI))
1230 Instruction *Res = nullptr;
1256 if (Instruction *T = CvtFDivConstToReciprocal(Op0, Op1C, AllowReciprocal)) {
1283 Instruction *R = CreateDiv ? BinaryOperator::CreateFDiv(Fold, X)
1294 Instruction *SimpR = nullptr;
1301 if (Instruction *RI = dyn_cast<Instruction>(NewInst)) {
1303 Flags &= cast<Instruction>(Op0)->getFastMathFlags();
1313 if (Instruction *RI = dyn_cast<Instruction>(NewInst)) {
1315 Flags &= cast<Instruction>(Op1)->getFastMathFlags();
1323 if (Instruction *T = dyn_cast<Instruction>(NewInst))
1337 Instruction *InstCombiner::commonIRemTransforms(BinaryOperator &I) {
1351 if (Instruction *Op0I = dyn_cast<Instruction>(Op0)) {
1353 if (Instruction *R = FoldOpIntoSelect(I, SI))
1356 if (Instruction *NV = FoldOpIntoPhi(I))
1360 // See if we can fold away this rem instruction.
1369 Instruction *InstCombiner::visitURem(BinaryOperator &I) {
1378 if (Instruction *common = commonIRemTransforms(I))
1404 Instruction *InstCombiner::visitSRem(BinaryOperator &I) {
1414 if (Instruction *Common = commonIRemTransforms(I))
1479 Instruction *InstCombiner::visitFRem(BinaryOperator &I) {