Lines Matching full:instruction
158 Value *simplify(Instruction *FAdd);
165 Value *performFactorization(Instruction *I);
178 void createInstPostProc(Instruction *NewInst);
181 Instruction *Instr;
351 Instruction *I = 0;
352 if (Val == 0 || !(I = dyn_cast<Instruction>(Val)))
357 if (Opcode == Instruction::FAdd || Opcode == Instruction::FSub) {
380 if (Opcode == Instruction::FSub)
392 if (I->getOpcode() == Instruction::FMul) {
430 // Try to perform following optimization on the input instruction I. Return the
433 // Instruction "I" is Simplified into
438 Value *FAddCombine::performFactorization(Instruction *I) {
439 assert((I->getOpcode() == Instruction::FAdd ||
440 I->getOpcode() == Instruction::FSub) && "Expect add/sub");
442 Instruction *I0 = dyn_cast<Instruction>(I->getOperand(0));
443 Instruction *I1 = dyn_cast<Instruction>(I->getOperand(1));
449 if (I0->getOpcode() == Instruction::FMul)
451 else if (I0->getOpcode() != Instruction::FDiv)
487 Value *NewAddSub = (I->getOpcode() == Instruction::FAdd) ?
502 Value *FAddCombine::simplify(Instruction *I) {
509 assert((I->getOpcode() == Instruction::FAdd ||
510 I->getOpcode() == Instruction::FSub) && "Expect add/sub");
512 // Save the instruction before calling other member-functions.
540 // Compute instruction quota. We should save at least one instruction.
553 // The input instruction is : "I=0.0 +/- V". If the "V" were able to be
554 // splitted into two addends, say "V = X - Y", the instruction would have
695 // The resulting optimized addition should have at least one less instruction
733 "Inconsistent in instruction numbers");
742 if (Instruction *I = dyn_cast<Instruction>(V))
755 if (Instruction *I = dyn_cast<Instruction>(V))
762 if (Instruction *I = dyn_cast<Instruction>(V))
769 if (Instruction *I = dyn_cast<Instruction>(V))
774 void FAddCombine::createInstPostProc(Instruction *NewInstr) {
777 // Keep track of the number of instruction created.
784 // Return the number of instruction needed to emit the N-ary addition.
805 // is immediately available; otherwise, it needs exactly one instruction
868 Instruction *I = dyn_cast<Instruction>(V);
871 if (I->getOpcode() == Instruction::Mul)
874 if (I->getOpcode() == Instruction::Shl)
913 Instruction *InstCombiner::visitAdd(BinaryOperator &I) {
987 if (Instruction *NV = FoldOpIntoPhi(I))
1102 if (Instruction *R = FoldOpIntoSelect(I, SI))
1182 Instruction *InstCombiner::visitFAdd(BinaryOperator &I) {
1191 if (Instruction *NV = FoldOpIntoPhi(I))
1195 if (Instruction *NV = FoldOpIntoSelect(I, SI))
1352 Instruction *InstCombiner::visitSub(BinaryOperator &I) {
1401 if (Instruction *R = FoldOpIntoSelect(I, SI))
1520 Instruction *InstCombiner::visitFSub(BinaryOperator &I) {
1528 if (Instruction *NV = FoldOpIntoSelect(I, SI))
1534 Instruction *NewI = BinaryOperator::CreateFAdd(Op0, V);
1541 Instruction *NewI = BinaryOperator::CreateFAdd(Op0, NewTrunc);
1548 Instruction *NewI = BinaryOperator::CreateFAdd(Op0, NewExt);