From: Bill Wendling Date: Fri, 30 Jan 2009 02:55:25 +0000 (+0000) Subject: Propagate debug loc info for UDIV. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=07d85140497a8fb58d9d2daa723c6c8b64948b73;p=oota-llvm.git Propagate debug loc info for UDIV. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63373 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 2b59fe57917..64e7f3aa3ab 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -1463,7 +1463,7 @@ SDValue DAGCombiner::visitUDIV(SDNode *N) { return DAG.FoldConstantArithmetic(ISD::UDIV, VT, N0C, N1C); // fold (udiv x, (1 << c)) -> x >>u c if (N1C && N1C->getAPIntValue().isPowerOf2()) - return DAG.getNode(ISD::SRL, VT, N0, + return DAG.getNode(ISD::SRL, N->getDebugLoc(), VT, N0, DAG.getConstant(N1C->getAPIntValue().logBase2(), TLI.getShiftAmountTy())); // fold (udiv x, (shl c, y)) -> x >>u (log2(c)+y) iff c is power of 2 @@ -1471,12 +1471,13 @@ SDValue DAGCombiner::visitUDIV(SDNode *N) { if (ConstantSDNode *SHC = dyn_cast(N1.getOperand(0))) { if (SHC->getAPIntValue().isPowerOf2()) { MVT ADDVT = N1.getOperand(1).getValueType(); - SDValue Add = DAG.getNode(ISD::ADD, ADDVT, N1.getOperand(1), - DAG.getConstant(SHC->getAPIntValue() - .logBase2(), - ADDVT)); + SDValue Add = DAG.getNode(ISD::ADD, N->getDebugLoc(), ADDVT, + N1.getOperand(1), + DAG.getConstant(SHC->getAPIntValue() + .logBase2(), + ADDVT)); AddToWorkList(Add.getNode()); - return DAG.getNode(ISD::SRL, VT, N0, Add); + return DAG.getNode(ISD::SRL, N->getDebugLoc(), VT, N0, Add); } } }