[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp SelectionDAG.cpp SelectionDAGPrinter.cpp

Jim Laskey jlaskey at apple.com
Tue Oct 17 12:34:10 PDT 2006



Changes in directory llvm/lib/CodeGen/SelectionDAG:

DAGCombiner.cpp updated: 1.227 -> 1.228
SelectionDAG.cpp updated: 1.352 -> 1.353
SelectionDAGPrinter.cpp updated: 1.38 -> 1.39
---
Log message:

Make it simplier to dump DAGs while in DAGCombiner.  Remove a nasty optimization.

---
Diffs of the changes:  (+7 -10)

 DAGCombiner.cpp         |   12 ++++--------
 SelectionDAG.cpp        |    2 +-
 SelectionDAGPrinter.cpp |    3 ++-
 3 files changed, 7 insertions(+), 10 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.227 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.228
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.227	Tue Oct 17 12:06:35 2006
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp	Tue Oct 17 14:33:52 2006
@@ -49,7 +49,7 @@
             
   static cl::opt<bool>
     CombinerAA("combiner-alias-analysis", cl::Hidden,
-               cl::desc("Turn on alias analysis turning testing"));
+               cl::desc("Turn on alias analysis during testing"));
 
 //------------------------------ DAGCombiner ---------------------------------//
 
@@ -388,6 +388,9 @@
   // changes of the root.
   HandleSDNode Dummy(DAG.getRoot());
   
+  // The root of the dag may dangle to deleted nodes until the dag combiner is
+  // done.  Set it to null to avoid confusion.
+  DAG.setRoot(SDOperand());
   
   /// DagCombineInfo - Expose the DAG combiner to the target combiner impls.
   TargetLowering::DAGCombinerInfo 
@@ -2759,13 +2762,6 @@
   }
   
   if (CombinerAA) { 
-    // If the store ptr is a frame index and the frame index has a use of one
-    // and this is a return block, then the store is redundant.
-    if (Ptr.hasOneUse() && isa<FrameIndexSDNode>(Ptr) &&
-        DAG.getRoot().getOpcode() == ISD::RET) {
-      return Chain;
-    }
-
     // Walk up chain skipping non-aliasing memory nodes.
     SDOperand BetterChain = FindBetterChain(N, Chain);
     


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.352 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.353
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.352	Fri Oct 13 19:41:01 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp	Tue Oct 17 14:33:52 2006
@@ -2684,7 +2684,7 @@
       DumpNodes(Nodes[i], 2, this);
   }
 
-  DumpNodes(getRoot().Val, 2, this);
+  if (getRoot().Val) DumpNodes(getRoot().Val, 2, this);
 
   std::cerr << "\n\n";
 }


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.38 llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.39
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.38	Wed Oct 11 02:09:31 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp	Tue Oct 17 14:33:52 2006
@@ -61,7 +61,8 @@
     static void addCustomGraphFeatures(SelectionDAG *G,
                                        GraphWriter<SelectionDAG*> &GW) {
       GW.emitSimpleNode(0, "plaintext=circle", "GraphRoot");
-      GW.emitEdge(0, -1, G->getRoot().Val, -1, "");
+      if (G->getRoot().Val)
+        GW.emitEdge(0, -1, G->getRoot().Val, -1, "");
     }
   };
 }






More information about the llvm-commits mailing list