aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2009-01-30 01:13:16 +0000
committerBill Wendling <isanbard@gmail.com>2009-01-30 01:13:16 +0000
commit5c71acfb0600ea9272a2dcce00e1610a5b8ee081 (patch)
treecb49358131403cf451fe8119e0282e3bc83d273e /lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parentbf3f5a08eed98e723e920a06a0cde9699593aa41 (diff)
Propagate debug location info for the token factor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63355 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/DAGCombiner.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 13256e0e79..2947794e91 100644
--- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -770,7 +770,6 @@ SDValue DAGCombiner::visit(SDNode *N) {
}
SDValue DAGCombiner::combine(SDNode *N) {
-
SDValue RV = visit(N);
// If nothing happened, try a target-specific DAG combine.
@@ -796,6 +795,7 @@ SDValue DAGCombiner::combine(SDNode *N) {
N->getNumValues() == 1) {
SDValue N0 = N->getOperand(0);
SDValue N1 = N->getOperand(1);
+
// Constant operands are canonicalized to RHS.
if (isa<ConstantSDNode>(N0) || !isa<ConstantSDNode>(N1)) {
SDValue Ops[] = { N1, N0 };
@@ -821,7 +821,7 @@ static SDValue getInputChainForNode(SDNode *N) {
if (N->getOperand(i).getValueType() == MVT::Other)
return N->getOperand(i);
}
- return SDValue(0, 0);
+ return SDValue();
}
SDValue DAGCombiner::visitTokenFactor(SDNode *N) {
@@ -890,9 +890,10 @@ SDValue DAGCombiner::visitTokenFactor(SDNode *N) {
Result = DAG.getEntryNode();
} else {
// New and improved token factor.
- Result = DAG.getNode(ISD::TokenFactor, MVT::Other, &Ops[0], Ops.size());
+ Result = DAG.getNode(ISD::TokenFactor, N->getDebugLoc(),
+ MVT::Other, &Ops[0], Ops.size());
}
-
+
// Don't add users to work list.
return CombineTo(N, Result, false);
}
@@ -911,7 +912,6 @@ SDValue DAGCombiner::visitMERGE_VALUES(SDNode *N) {
return SDValue(N, 0); // Return N so it doesn't get rechecked!
}
-
static
SDValue combineShlAddConstant(SDValue N0, SDValue N1, SelectionDAG &DAG) {
MVT VT = N0.getValueType();