summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2009-01-30 02:55:25 +0000
committerBill Wendling <isanbard@gmail.com>2009-01-30 02:55:25 +0000
commitaff3e03765af9762d3f146bb464bd41e6caca42c (patch)
tree29fb57170d5c3d50a1211f72300da37fd1afc340 /llvm/lib
parent5b663e7b53fc1e1ef7a18f0fb9fbbe16b3597c6c (diff)
downloadbcm5719-llvm-aff3e03765af9762d3f146bb464bd41e6caca42c.tar.gz
bcm5719-llvm-aff3e03765af9762d3f146bb464bd41e6caca42c.zip
Propagate debug loc info for UDIV.
llvm-svn: 63373
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 2b59fe57917..64e7f3aa3ab 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/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<ConstantSDNode>(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);
}
}
}
OpenPOWER on IntegriCloud