Lines Matching full:instruction
56 if (I->getOpcode() == Instruction::LShr && !I->isExact()) {
61 if (I->getOpcode() == Instruction::Shl && !I->hasNoUnsignedWrap()) {
117 Instruction *InstCombiner::visitMul(BinaryOperator &I) {
198 if (Instruction *R = FoldOpIntoSelect(I, SI))
202 if (Instruction *NV = FoldOpIntoPhi(I))
216 (BO->getOpcode() != Instruction::UDiv &&
217 BO->getOpcode() != Instruction::SDiv)) {
224 (BO->getOpcode() == Instruction::UDiv ||
225 BO->getOpcode() == Instruction::SDiv)) {
237 if (BO->getOpcode() == Instruction::UDiv)
310 Instruction *I = dyn_cast<Instruction>(OpLog2Of);
313 if (I->getOpcode() != Instruction::FMul || !I->hasUnsafeAlgebra())
330 Instruction *I = dyn_cast<Instruction>(V);
331 if (!I || (I->getOpcode() != Instruction::FMul &&
332 I->getOpcode() != Instruction::FDiv))
357 Value *InstCombiner::foldFMulConst(Instruction *FMulOrDiv, ConstantFP *C,
358 Instruction *InsertBefore) {
370 if (FMulOrDiv->getOpcode() == Instruction::FMul) {
402 Instruction *InstCombiner::visitFMul(BinaryOperator &I) {
418 if (Instruction *R = FoldOpIntoSelect(I, SI))
422 if (Instruction *NV = FoldOpIntoPhi(I))
432 Value *V = foldFMulConst(cast<Instruction>(Op0), C, &I);
438 Instruction *FAddSub = dyn_cast<Instruction>(Op0);
440 (FAddSub->getOpcode() == Instruction::FAdd ||
441 FAddSub->getOpcode() == Instruction::FSub)) {
457 foldFMulConst(cast<Instruction>(Opnd0), C, &I) :
460 if (Swap && FAddSub->getOpcode() == Instruction::FSub)
463 Value *R = (FAddSub->getOpcode() == Instruction::FAdd) ?
466 Instruction *RI = cast<Instruction>(R);
495 Instruction *FMul = cast<Instruction>(FMulVal);
497 Instruction *FSub = BinaryOperator::CreateFSub(FMulVal, OpX);
519 cast<Instruction>(T)->setDebugLoc(I.getDebugLoc());
520 Instruction *Neg = BinaryOperator::CreateFNeg(T);
522 cast<Instruction>(T)->copyFastMathFlags(&I);
533 // latency of the instruction Y is amortized by the expression of X*X,
548 Instruction *T = cast<Instruction>(Builder->CreateFMul(Opnd1, Opnd1));
552 Instruction *R = BinaryOperator::CreateFMul(T, Y);
598 /// instruction.
642 for (Instruction::op_iterator I = BBI->op_begin(), E = BBI->op_end();
653 // If we past the instruction, quit looking for it.
672 Instruction *InstCombiner::commonIDivTransforms(BinaryOperator &I) {
688 if (Instruction *LHS = dyn_cast<Instruction>(Op0))
689 if (Instruction::BinaryOps(LHS->getOpcode()) == I.getOpcode())
692 I.getOpcode()==Instruction::SDiv))
700 if (Instruction *R = FoldOpIntoSelect(I, SI))
703 if (Instruction *NV = FoldOpIntoPhi(I))
708 // See if we can fold away this div instruction.
715 bool isSigned = I.getOpcode() == Instruction::SDiv;
739 typedef Instruction *(*FoldUDivOperandCb)(Value *Op0, Value *Op1,
751 Instruction *FoldResult; ///< The instruction returned when FoldAction is
766 static Instruction *foldUDivPow2Cst(Value *Op0, Value *Op1,
776 static Instruction *foldUDivNegCst(Value *Op0, Value *Op1,
785 static Instruction *foldUDivShl(Value *Op0, Value *Op1, const BinaryOperator &I,
787 Instruction *ShiftLeft = cast<Instruction>(Op1);
789 ShiftLeft = cast<Instruction>(ShiftLeft->getOperand(0));
804 // instruction, seeing through select instructions, to determine if we can
845 Instruction *InstCombiner::visitUDiv(BinaryOperator &I) {
852 if (Instruction *Common = commonIDivTransforms(I))
878 Instruction *Inst;
906 Instruction *InstCombiner::visitSDiv(BinaryOperator &I) {
913 if (Instruction *Common = commonIDivTransforms(I))
966 static Instruction *CvtFDivConstToReciprocal(Value *Dividend,
987 Instruction *InstCombiner::visitFDiv(BinaryOperator &I) {
995 if (Instruction *R = FoldOpIntoSelect(I, SI))
1003 if (Instruction *R = FoldOpIntoSelect(I, SI))
1010 Instruction *Res = 0;
1039 if (Instruction *T = CvtFDivConstToReciprocal(Op0, Op1C, AllowReciprocal))
1066 Instruction *R = CreateDiv ?
1079 Instruction *SimpR = 0;
1098 if (Instruction *T = dyn_cast<Instruction>(NewInst))
1112 Instruction *InstCombiner::commonIRemTransforms(BinaryOperator &I) {
1126 if (Instruction *Op0I = dyn_cast<Instruction>(Op0)) {
1128 if (Instruction *R = FoldOpIntoSelect(I, SI))
1131 if (Instruction *NV = FoldOpIntoPhi(I))
1135 // See if we can fold away this rem instruction.
1144 Instruction *InstCombiner::visitURem(BinaryOperator &I) {
1150 if (Instruction *common = commonIRemTransforms(I))
1176 Instruction *InstCombiner::visitSRem(BinaryOperator &I) {
1183 if (Instruction *Common = commonIRemTransforms(I))
1247 Instruction *InstCombiner::visitFRem(BinaryOperator &I) {