[llvm-commits] [llvm] r63355 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Bill Wendling isanbard at gmail.com
Thu Jan 29 17:13:17 PST 2009


Author: void
Date: Thu Jan 29 19:13:16 2009
New Revision: 63355

URL: http://llvm.org/viewvc/llvm-project?rev=63355&view=rev
Log:
Propagate debug location info for the token factor.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=63355&r1=63354&r2=63355&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu Jan 29 19:13:16 2009
@@ -770,7 +770,6 @@
 }
 
 SDValue DAGCombiner::combine(SDNode *N) {
-
   SDValue RV = visit(N);
 
   // If nothing happened, try a target-specific DAG combine.
@@ -796,6 +795,7 @@
       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 @@
       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 @@
       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 @@
   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();





More information about the llvm-commits mailing list