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

Chris Lattner sabre at nondot.org
Fri Oct 13 20:53:00 PDT 2006



Changes in directory llvm/lib/CodeGen/SelectionDAG:

DAGCombiner.cpp updated: 1.222 -> 1.223
---
Log message:

Make sure that the node returned by SimplifySetCC is added to the worklist
so that it can be deleted if unused.


---
Diffs of the changes:  (+5 -0)

 DAGCombiner.cpp |    5 +++++
 1 files changed, 5 insertions(+)


Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.222 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.223
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.222	Fri Oct 13 20:02:29 2006
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp	Fri Oct 13 22:52:46 2006
@@ -1845,6 +1845,7 @@
   
   // Determine if the condition we're dealing with is constant
   SDOperand SCC = SimplifySetCC(TLI.getSetCCResultTy(), N0, N1, CC, false);
+  if (SCC.Val) AddToWorkList(SCC.Val);
 
   if (ConstantSDNode *SCCC = dyn_cast_or_null<ConstantSDNode>(SCC.Val)) {
     if (SCCC->getValue())
@@ -2660,6 +2661,8 @@
   
   // Use SimplifySetCC  to simplify SETCC's.
   SDOperand Simp = SimplifySetCC(MVT::i1, CondLHS, CondRHS, CC->get(), false);
+  if (Simp.Val) AddToWorkList(Simp.Val);
+
   ConstantSDNode *SCCC = dyn_cast_or_null<ConstantSDNode>(Simp.Val);
 
   // fold br_cc true, dest -> br dest (unconditional branch)
@@ -2669,6 +2672,7 @@
   // fold br_cc false, dest -> unconditional fall through
   if (SCCC && SCCC->isNullValue())
     return N->getOperand(0);
+
   // fold to a simpler setcc
   if (Simp.Val && Simp.getOpcode() == ISD::SETCC)
     return DAG.getNode(ISD::BR_CC, MVT::Other, N->getOperand(0), 
@@ -3424,6 +3428,7 @@
 
   // Determine if the condition we're dealing with is constant
   SDOperand SCC = SimplifySetCC(TLI.getSetCCResultTy(), N0, N1, CC, false);
+  if (SCC.Val) AddToWorkList(SCC.Val);
   ConstantSDNode *SCCC = dyn_cast_or_null<ConstantSDNode>(SCC.Val);
 
   // fold select_cc true, x, y -> x






More information about the llvm-commits mailing list