Home | History | Annotate | Download | only in SelectionDAG

Lines Matching defs:Add

114     /// This is used to allow us to reliably add any operands of a DAG node
121 /// When an instruction is simplified, add all users of the instruction to
132 /// Add to the worklist making sure its instance is at the back (next to be
421 /// of folding (mul (add x, c1), c2) -> (add (mul x, c2), c1*c2).
422 /// MulNode is the original multiply, AddNode is (add x, c1),
1249 // Add all the dag nodes to the worklist.
1295 // Add any operands of the new node which have not yet been combined to the
1354 case ISD::ADD: return visitADD(N);
1471 case ISD::ADD:
1577 // Only add if it isn't already in the list.
1599 // Add users to worklist if AA is enabled, since it may introduce
1603 return CombineTo(N, Result, UseAA /*add to worklist*/);
1615 // First add the users of this node to the work list so that they
1643 // fold (add x, 0) -> x, vector edition
1650 // fold (add x, undef) -> undef
1658 return DAG.getNode(ISD::ADD, SDLoc(N), VT, N1, N0);
1659 // fold (add c1, c2) -> c1+c2
1660 return DAG.FoldConstantArithmetic(ISD::ADD, SDLoc(N), VT,
1663 // fold (add x, 0) -> x
1677 // reassociate add
1678 if (SDValue RADD = ReassociateOps(ISD::ADD, SDLoc(N), N0, N1))
1693 if (N1.getOpcode() == ISD::SUB && N1.getOperand(1).getOpcode() == ISD::ADD &&
1698 if (N1.getOpcode() == ISD::SUB && N1.getOperand(1).getOpcode() == ISD::ADD &&
1703 if ((N1.getOpcode() == ISD::SUB || N1.getOpcode() == ISD::ADD) &&
1718 DAG.getNode(ISD::ADD, SDLoc(N0), VT, N00, N10),
1719 DAG.getNode(ISD::ADD, SDLoc(N1), VT, N01, N11));
1730 // fold (add x, shl(0 - y, n)) -> sub(x, shl(y, n))
1749 // (add z, (and (sbbl x, x), 1)) -> (sub z, (sbbl x, x))
1757 // add (sext i1), X -> sub X, (zext i1)
1766 // add X, (sextinreg Y i1) -> sub X, (and Y 1)
1785 // If the flag result is dead, turn this into an ADD.
1787 return CombineTo(N, DAG.getNode(ISD::ADD, SDLoc(N), VT, N0, N1),
1879 // fold (sub x, c) -> (add x, -c)
1882 return DAG.getNode(ISD::ADD, DL, VT, N0,
1892 if (N0.getOpcode() == ISD::ADD && N0.getOperand(0) == N1)
1895 if (N0.getOpcode() == ISD::ADD && N0.getOperand(1) == N1)
1898 ConstantSDNode *N1C1 = N1.getOpcode() != ISD::ADD ? nullptr :
1900 if (N1.getOpcode() == ISD::ADD && N0C && N1C1) {
1908 if (N0.getOpcode() == ISD::ADD &&
1910 N0.getOperand(1).getOpcode() == ISD::ADD) &&
1915 if (N0.getOpcode() == ISD::ADD &&
1916 N0.getOperand(1).getOpcode() == ISD::ADD &&
1918 return DAG.getNode(ISD::ADD, SDLoc(N), VT,
1948 // sub X, (sextinreg Y i1) -> add X, (and Y 1)
1955 return DAG.getNode(ISD::ADD, DL, VT, N0, ZExt);
2075 // single-use add), we should put the negate there.
2115 // fold (mul (add x, c1), c2) -> (add (mul x, c2), c1*c2)
2117 N0.getOpcode() == ISD::ADD &&
2120 return DAG.getNode(ISD::ADD, SDLoc(N), VT,
2275 // Add (N0 < 0) ? abs2 - 1 : 0;
2280 SDValue ADD = DAG.getNode(ISD::ADD, DL, VT, N0, SRL);
2282 AddToWorklist(ADD.getNode()); // Divide by pow2
2283 SDValue SRA = DAG.getNode(ISD::SRA, DL, VT, ADD,
2285 getShiftAmountTy(ADD.getValueType())));
2351 SDValue Add = DAG.getNode(ISD::ADD, DL, ADDVT,
2356 AddToWorklist(Add.getNode());
2357 return DAG.getNode(ISD::SRL, DL, VT, N0, Add);
2415 // fold (urem x, (shl pow2, y)) -> (and x, (add (shl pow2, y), -1))
2420 SDValue Add =
2421 DAG.getNode(ISD::ADD, DL, VT, N1, DAG.getConstant(NegOne, DL, VT));
2422 AddToWorklist(Add.getNode());
2423 return DAG.getNode(ISD::AND, DL, VT, N0, Add);
2687 // fold (add c1, c2) -> c1+c2
2897 // Simplify (and (setne X, 0), (setne X, -1)) -> (setuge (add X, 1), 2)
2903 SDValue ADDNode = DAG.getNode(ISD::ADD, DL, LL.getValueType(),
2932 if (N0.getOpcode() == ISD::ADD && N1.getOpcode() == ISD::SRL &&
2937 // Look for (and (add x, c1), (lshr y, c2)). If C1 wasn't a legal
2938 // immediate for an add, but it is legal if its top c2 bits are set,
2939 // transform the ADD so the immediate doesn't need to be materialized
2949 DAG.getNode(ISD::ADD, DL, VT,
3261 // For big endian targets, we need to add an offset to the pointer
3269 NewPtr = DAG.getNode(ISD::ADD, DL, PtrType,
3966 // Check for cases where Pos has the form (add NegOp1, PosC) for some PosC.
3975 else if (Pos.getOpcode() == ISD::ADD && Pos.getOperand(0) == NegOp1) {
4297 // instead of (shift (and)), likewise for add, or, xor, etc. This sort of
4311 case ISD::ADD:
4313 return SDValue(); // only shl(add) not sr[al](add).
4466 // fold (shl (shl x, c1), c2) -> 0 or (shl x, (add c1, c2))
4479 // fold (shl (ext (shl x, c1)), c2) -> (ext (shl x, (add c1, c2)))
4586 // fold (shl (add x, c1), c2) -> (add (shl x, c2), c1 << c2)
4590 if (N1C && N0.getOpcode() == ISD::ADD && N0.getNode()->hasOneUse() &&
4595 return DAG.getNode(ISD::ADD, SDLoc(N), VT, Shl0, Shl1);
4659 // fold (sra (sra x, c1), c2) -> (sra x, (add c1, c2))
4793 // fold (srl (srl x, c1), c2) -> 0 or (srl x, (add c1, c2))
4806 // fold (srl (trunc (srl x, c1)), c2) -> 0 or (trunc (srl x, (add c1, c2)))
4944 // itself may not be optimized further. Look for it and add the BRCOND into
5441 Ptr = DAG.getNode(ISD::ADD, DL, Ptr.getValueType(), Ptr,
5593 Ptr = DAG.getNode(ISD::ADD, DL, Ptr.getValueType(), Ptr,
5634 // Y = sra (X, size(X)-1); xor (add (X, Y), Y)
5654 SDValue Add = DAG.getNode(ISD::ADD, DL, VT, LHS, Shift);
5656 AddToWorklist(Add.getNode());
5657 return DAG.getNode(ISD::XOR, DL, VT, Add, Shift);
5684 // Add the new VSELECT nodes to the work list in case they need to be split
5857 bool Add = false;
5864 Add = true;
5866 if (Add)
5992 BasePtr = DAG.getNode(ISD::ADD, DL, BasePtr.getValueType(), BasePtr,
6896 SDValue NewPtr = DAG.getNode(ISD::ADD, DL,
7771 // Floating-point multiply-add with intermediate rounding.
7774 // Floating-point multiply-add without intermediate rounding.
7959 // Floating-point multiply-add with intermediate rounding.
7962 // Floating-point multiply-add without intermediate rounding.
8229 // Floating-point multiply-add with intermediate rounding.
8232 // Floating-point multiply-add without intermediate rounding.
9506 // Don't add the new BRCond into the worklist or else SimplifySelectCC
9631 if (N->getOpcode() == ISD::ADD) {
9655 /// pointer is an add or subtract and it has other uses besides the load/store.
9657 /// the add/subtract in and all of its other uses are redirected to the
9687 // If the pointer is not an add/sub, or if it doesn't have multiple uses, bail
9689 if ((Ptr.getOpcode() != ISD::ADD && Ptr.getOpcode() != ISD::SUB) ||
9755 if (Use.getUser()->getOpcode() != ISD::ADD &&
9855 unsigned Opcode = (Y0 * Y1 < 0) ? ISD::SUB : ISD::ADD;
9882 /// Try to combine a load/store with a add/sub of the base pointer node into a
9883 /// post-indexed load/store. The transformation folded the add/subtract into the
9919 (Op->getOpcode() != ISD::ADD && Op->getOpcode() != ISD::SUB))
9948 if (Use->getOpcode() == ISD::ADD || Use->getOpcode() == ISD::SUB){
10010 // TargetConstants in general ADD nodes. We can convert these constants into
10022 (AM == ISD::PRE_INC || AM == ISD::POST_INC ? ISD::ADD : ISD::SUB);
10041 // v3 = add v2, c
10062 // the indexing into an add/sub directly (that TargetConstant may not be
10157 // Replace uses with load result and token factor. Don't add users
10360 if (!TLI.isOperationLegal(ISD::ADD, PtrType))
10410 BaseAddr = DAG->getNode(ISD::ADD, DL, ArithType, BaseAddr,
10836 Ptr = DAG.getNode(ISD::ADD, DL, Ptr.getValueType(),
10949 SDValue NewPtr = DAG.getNode(ISD::ADD, SDLoc(LD),
11041 /// (load (i64 add (i64 copyfromreg %c)
11042 /// (i64 signextend (add (i8 load %index)
11046 /// (load (i64 add (i64 copyfromreg %c)
11047 /// (i64 signextend (i32 add (i32 signextend (i8 load %index))
11084 // We only can pattern match BASE + INDEX + OFFSET. If Ptr is not an ADD
11087 if (Ptr->getOpcode() != ISD::ADD)
11090 // We know that we have at least an ADD instruction. Try to pattern match
11098 // Inside a loop the current BASE pointer is calculated using an ADD and a
11100 // (i64 add (i64 %array_ptr)
11117 if (IndexOffset->getOpcode() != ISD::ADD)
11140 // of folding (mul (add x, c1), c2) -> (add (mul x, c2), c1*c2).
11141 // MulNode is the original multiply, AddNode is (add x, c1),
11144 // If the (add x, c1) has multiple uses, we could increase
11157 // If the add only has one use, this would be OK to do.
11177 // Check to see if multiply is with the same operand of our "add".
11203 if (OtherOp->getOpcode() == ISD::ADD &&
11824 // We add +1 here because the LastXXX variables refer to location while
11926 // Don't add users to work list.
11998 Ptr = DAG.getNode(ISD::ADD, DL, Ptr.getValueType(), Ptr,
12287 NewPtr = DAG.getNode(ISD::ADD, DL, PtrType, NewPtr, Offset);
12324 // Since we're explicitly calling ReplaceAllUses, add the new node to the
12327 AddUsersToWorklist(Load.getNode()); // Add users too
13933 /// Visit a binary vector operation, like ADD.
14244 CPIdx = DAG.getNode(ISD::ADD, DL, CPIdx.getValueType(), CPIdx,
14376 // Y = sra (X, size(X)-1); xor (add (X, Y), Y)
14395 SDValue Add = DAG.getNode(ISD::ADD, DL,
14398 AddToWorklist(Add.getNode());
14399 return DAG.getNode(ISD::XOR, DL, XType, Add, Shift);
14717 if (Base.getOpcode() == ISD::ADD) {
14858 // Look at each chain and determine if it is an alias. If so, add it to the