Home | History | Annotate | Download | only in Scalar

Lines Matching refs:Add

263 /// IncorporateWeight - Add the extra weight 'RHS' to the existing weight 'LHS',
301 if (Opcode == Instruction::Add) {
442 // operation (eg: a constant, or a multiply in an add tree), or are, but have
474 // add its operands to the expression.
477 DEBUG(dbgs() << "DIRECT ADD: " << *Op << " (" << Weight << ")\n");
490 DEBUG(dbgs() << "ADD USES LEAF: " << *Op << " (" << Weight << ")\n");
512 // to the expression, then no longer consider it to be a leaf and add
555 DEBUG(dbgs() << "ADD LEAF: " << *Op << " (" << Weight << ")\n");
763 // expression chain as possible, to expose the add instructions. In practice,
770 if (BinaryOperator *I = isReassociableOp(V, Instruction::Add)) {
771 // Push the negates through the add.
775 // We must move the add instruction here, because the neg instructions do
776 // not dominate the old add instruction in general. By moving it, we are
829 // Don't bother to break this up unless either the LHS is an associable add or
831 if (isReassociableOp(Sub->getOperand(0), Instruction::Add) ||
834 if (isReassociableOp(Sub->getOperand(1), Instruction::Add) ||
838 (isReassociableOp(Sub->use_back(), Instruction::Add) ||
845 /// BreakUpSubtract - If we have (X-Y), and if either X is an add, or if this is
846 /// only used by an add, transform this into (X+(0-Y)) to promote better
849 // Convert a subtract into an add and a neg instruction. This allows sub
850 // instructions to be commuted with other add instructions.
853 // and set it as the RHS of the add instruction we just made.
862 // Everyone now refers to the add instruction.
904 /// EmitAddTreeOfValues - Emit a tree of add instructions, summing Ops together
977 /// add its operands as factors, otherwise add V to the list of factors.
979 /// Ops is the top-level list of add operands we're trying to factor.
989 // Otherwise, add the LHS and RHS to the list of factors.
1043 /// OptimizeAdd - Optimize a series of operands to an 'add' instruction. This
1079 // If every add operand was a duplicate, return the multiply.
1084 // "A + A + B" -> "A*2 + B". Add the new multiply to the list of
1121 // for any ADD operands that are MULs.
1138 // Add one to FactorOccurrences for each unique factor in this op.
1147 // If Factor is a negative constant, add the negated value as a factor
1199 // Now that we have inserted the add tree, optimize it. This allows us to
1214 // If every add operand included the factor (e.g. "A*B + A*C"), then the
1220 // "A*B + A*C + D" -> "A*(B+C) + D". Add the new multiply to the list of
1358 // Iteratively collect the base of each factor with an add power into the
1417 // there is no point. For example, an add of 0 gets dropped here, while a
1439 case Instruction::Add:
1469 // and add that since that's where optimization actually happens.
1488 // is used by a reassociable multiply or add, turn into a multiply.
1492 isReassociableOp(I->use_back(), Instruction::Add)))) {
1564 // If this is an add tree that is used by a sub instruction, ignore it
1566 if (BO->hasOneUse() && BO->getOpcode() == Instruction::Add &&
1615 // this is a multiply tree used only by an add, and the immediate is a -1.
1617 // can fold the negation into the add: (-X)*Y + Z -> Z-X*Y
1619 cast<Instruction>(I->use_back())->getOpcode() == Instruction::Add &&