Home | History | Annotate | Download | only in Scalar

Lines Matching refs:And

16 // function arguments are rank = 1, and other values are assigned ranks
79 /// \brief Utility class representing a base and exponent pair which form one
104 /// C1) The operand is in the form "X & C", where C is a constant and C != ~0
108 /// C2.2) Any operand E which doesn't fall into C1 and C2.1, we view this
128 // could potentially shorten crital path, and expose more loop-invariants.
198 I->getOpcode() == Instruction::And)) {
225 /// Return true if V is an instruction of the specified opcode and if it
291 // assures us that X and ~X will have the same rank.
370 /// Note that 0 <= k < Bitwidth, and if Bitwidth > 3 then x^(2^k) = 0 for every
384 /// the routine returns 1 in LHS in the first case, and 0 in LHS in the second.
388 // and the APInt sum LHS + RHS may not be correct if it wraps (it is correct
389 // for nilpotent operations and addition, but not for idempotent operations
390 // and multiplication), so it is important to correctly reduce the combined
428 // which case both x^W and x^(W - CM) are zero. By subtracting off multiples
498 /// The leaf nodes are C, E, F and G. The Ops array will contain (maybe not in
502 /// same kind as 'I', and all of its uses are non-leaf nodes of the expression,
504 /// it, and its operands also belong to the expression (but may be leaf nodes).
532 /// type and thus make the expression bigger.
540 "Expected an associative and commutative operation!");
545 // For example, if I = X + A, where X = A + B, then I, X and B have weight 1
561 // X to be a leaf, and won't analyze it further. When we first visit a value,
565 // from within the expression (and the value is a binary operator of the right
566 // kind) then the value is no longer considered to be a leaf, and its operands
625 // If the leaf is a binary operation of the right kind and we now see
627 // to the expression, then no longer consider it to be a leaf and add
648 // expression of the right kind, and secondly, is only used inside the
711 /// linearized and optimized, emit them in-order.
732 /// expression and must not be used as inner nodes (via NodesToRewrite) by
733 /// mistake. Inner nodes are always reassociable, and usually leaves are not
734 /// (if they were they would have been incorporated into the expression and so
740 /// leaves and refusing to reuse any of them as inner nodes.
828 // Otherwise, grab a spare node from the original expression and use that as
856 // starting from the operator specified in ExpressionChanged, and compactify
882 /// version of the value is returned, and BI is left pointing at the instruction
1004 /// If we have (X-Y), and if either X is an add, or if this is only used by an
1008 // Convert a subtract into an add and a neg instruction. This allows sub
1012 // and set it as the RHS of the add instruction we just made.
1054 /// Scan backwards and forwards among values with the same rank as element i
1082 /// and returning the result. Insert the tree before I.
1094 /// and if this sequence contains a multiply by Factor,
1095 /// remove Factor from the tree and return the new tree.
1150 // If this was just a single multiply, remove the multiply and return the only
1179 // Otherwise, add the LHS and RHS to the list of factors.
1184 /// Optimize a series of operands to an 'and', 'or', or 'xor' instruction.
1189 // Scan the operand lists looking for X and ~X pairs, along with X,X pairs.
1192 // First, check for X and ~X in the operand list.
1198 if (Opcode == Instruction::And) // ...&X&~X = 0
1210 if (Opcode == Instruction::And || Opcode == Instruction::Or) {
1211 // Drop duplicate values for And and Or.
1232 /// Helper function of CombineXorOpnd(). It creates a bitwise-and
1233 /// instruction with the given two operands, and return the resulting
1244 "and.ra", InsertBefore);
1254 // into "R ^ C", where C would be 0, and R is a symbolic value.
1256 // If it was successful, true is returned, and the "R" and "C" is returned
1257 // via "Res" and "ConstOpnd", respectively; otherwise, false is returned,
1258 // and both "Res" and "ConstOpnd" remain unchanged.
1288 // "Opnd1 ^ Opnd2 ^ ConstOpnd" into "R ^ C", where C would be 0, and R is a
1291 // If it was successful, true is returned, and the "R" and "C" is returned
1292 // via "Res" and "ConstOpnd", respectively (If the entire expression is
1294 // returned, and both "Res" and "ConstOpnd" remain unchanged.
1395 // It would otherwise invalidate the "Opnds"'s iterator, and hence invalidate
1432 // step 3.2: When previous and current operands share the same symbolic
1481 // Scan the operand lists looking for X and -X pairs. If we find any, we
1482 // can simplify expressions like X+-X == 0 and X+~X ==-1. While we're at it,
1527 // Check for X and -X or X and ~X in the operand list.
1542 // Remove X and -X from the operand list.
1547 // Remove X and ~X from the operand list.
1561 // if X and ~X we append -1 to the operand list.
1642 // from an expression will drop a use of maxocc, and this can cause
1708 /// Given a series of multiplication operands, build a vector of factors and
1788 /// equal and the powers are sorted in decreasing order, compute the minimal
1789 /// DAG of multiplies to compute the final product, and return that product
1827 // outer product, and halve each power in preparation for squaring the
1900 case Instruction::And:
1942 // and add that since that's where optimization actually happens.
2029 /// Inspect and optimize the given instruction. Note that erasing
2054 // This can potentially expose more CSE opportunities, and makes writing other
2070 // SimplifyCFG has folded to AND/OR expressions. If the expression
2072 // short-circuited form for code gen, and the source order may have been
2087 // and if this is not an inner node of a multiply tree.
2111 // and if this is not an inner node of a multiply tree.
2172 // Now that we have linearized the tree to a list and have gathered all of
2173 // the operands and their ranks, sort the operands by their rank. Use a
2175 // positions maintained (and so the compiler is deterministic). Note that
2198 // this is a multiply tree used only by an add, and the immediate is a -1.
2234 // Now that we ordered and optimized the expressions, splat them back into