Lines Matching full:instruction
160 Value *simplify(Instruction *FAdd);
167 Value *performFactorization(Instruction *I);
180 void createInstPostProc(Instruction *NewInst, bool NoNumber = false);
183 Instruction *Instr;
353 Instruction *I = nullptr;
354 if (!Val || !(I = dyn_cast<Instruction>(Val)))
359 if (Opcode == Instruction::FAdd || Opcode == Instruction::FSub) {
382 if (Opcode == Instruction::FSub)
394 if (I->getOpcode() == Instruction::FMul) {
432 // Try to perform following optimization on the input instruction I. Return the
435 // Instruction "I" is Simplified into
440 Value *FAddCombine::performFactorization(Instruction *I) {
441 assert((I->getOpcode() == Instruction::FAdd ||
442 I->getOpcode() == Instruction::FSub) && "Expect add/sub");
444 Instruction *I0 = dyn_cast<Instruction>(I->getOperand(0));
445 Instruction *I1 = dyn_cast<Instruction>(I->getOperand(1));
451 if (I0->getOpcode() == Instruction::FMul)
453 else if (I0->getOpcode() != Instruction::FDiv)
494 Value *NewAddSub = (I->getOpcode() == Instruction::FAdd) ?
501 } else if (Instruction *II = dyn_cast<Instruction>(NewAddSub))
506 if (Instruction *II = dyn_cast<Instruction>(RI))
512 if (Instruction *II = dyn_cast<Instruction>(RI))
517 Value *FAddCombine::simplify(Instruction *I) {
524 assert((I->getOpcode() == Instruction::FAdd ||
525 I->getOpcode() == Instruction::FSub) && "Expect add/sub");
527 // Save the instruction before calling other member-functions.
555 // Compute instruction quota. We should save at least one instruction.
568 // The input instruction is : "I=0.0 +/- V". If the "V" were able to be
569 // splitted into two addends, say "V = X - Y", the instruction would have
710 // The resulting optimized addition should have at least one less instruction
748 "Inconsistent in instruction numbers");
756 if (Instruction *I = dyn_cast<Instruction>(V))
764 if (Instruction *I = dyn_cast<Instruction>(NewV))
765 createInstPostProc(I, true); // fneg's don't receive instruction numbers.
771 if (Instruction *I = dyn_cast<Instruction>(V))
778 if (Instruction *I = dyn_cast<Instruction>(V))
785 if (Instruction *I = dyn_cast<Instruction>(V))
790 void FAddCombine::createInstPostProc(Instruction *NewInstr, bool NoNumber) {
793 // Keep track of the number of instruction created.
801 // Return the number of instruction needed to emit the N-ary addition.
822 // is immediately available; otherwise, it needs exactly one instruction
894 Instruction &CxtI) {
946 Instruction &CxtI) {
975 Instruction &CxtI) {
1050 Instruction *InstCombiner::visitAdd(BinaryOperator &I) {
1127 if (Instruction *NV = FoldOpIntoPhi(I))
1210 if (Instruction *R = FoldOpIntoSelect(I, SI))
1327 Instruction *InstCombiner::visitFAdd(BinaryOperator &I) {
1340 if (Instruction *NV = FoldOpIntoPhi(I))
1344 if (Instruction *NV = FoldOpIntoSelect(I, SI))
1351 Instruction *RI = BinaryOperator::CreateFSub(RHS, LHSV);
1359 Instruction *RI = BinaryOperator::CreateFSub(LHS, V);
1505 Instruction *InstCombiner::visitSub(BinaryOperator &I) {
1524 assert(BO->getOpcode() == Instruction::Sub &&
1551 if (Instruction *R = FoldOpIntoSelect(I, SI))
1692 Instruction *InstCombiner::visitFSub(BinaryOperator &I) {
1705 Instruction *NewI = BinaryOperator::CreateFNeg(Op1);
1712 if (Instruction *NV = FoldOpIntoSelect(I, SI))
1718 Instruction *NewI = BinaryOperator::CreateFAdd(Op0, V);
1725 Instruction *NewI = BinaryOperator::CreateFAdd(Op0, NewTrunc);
1732 Instruction *NewI = BinaryOperator::CreateFAdd(Op0, NewExt);