Changes in directory llvm/lib/CodeGen/SelectionDAG:

DAGCombiner.cpp updated: 1.67 -> 1.68
---
Log message:

When folding loads into ops, immediately replace uses of the op with the
load.  This reduces number of worklist iterations and avoid missing 
optimizations
depending on folding of things into sext_inreg nodes (which aren't supported by
all targets).
Tested by Regression/CodeGen/X86/extend.ll:test2



---
Diffs of the changes:  (+6 -6)

 DAGCombiner.cpp |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.67 
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.68
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.67  Wed Dec 14 13:05:06 2005
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp       Wed Dec 14 13:25:30 2005
@@ -1554,7 +1554,7 @@
     SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, N0.getOperand(0),
                                        N0.getOperand(1), N0.getOperand(2),
                                        N0.getValueType());
-    WorkList.push_back(N);
+    CombineTo(N, ExtLoad);
     CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad),
               ExtLoad.getValue(1));
     return SDOperand();
@@ -1567,7 +1567,7 @@
     SDOperand ExtLoad = DAG.getNode(ISD::SEXTLOAD, VT, N0.getOperand(0),
                                     N0.getOperand(1), N0.getOperand(2),
                                     N0.getOperand(3));
-    WorkList.push_back(N);
+    CombineTo(N, ExtLoad);
     CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad),
               ExtLoad.getValue(1));
     return SDOperand();
@@ -1596,7 +1596,7 @@
     SDOperand ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, VT, N0.getOperand(0),
                                        N0.getOperand(1), N0.getOperand(2),
                                        N0.getValueType());
-    WorkList.push_back(N);
+    CombineTo(N, ExtLoad);
     CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad),
               ExtLoad.getValue(1));
     return SDOperand();
@@ -1609,7 +1609,7 @@
     SDOperand ExtLoad = DAG.getNode(ISD::ZEXTLOAD, VT, N0.getOperand(0),
                                     N0.getOperand(1), N0.getOperand(2),
                                     N0.getOperand(3));
-    WorkList.push_back(N);
+    CombineTo(N, ExtLoad);
     CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad),
               ExtLoad.getValue(1));
     return SDOperand();
@@ -1673,7 +1673,7 @@
     SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, N0.getOperand(0),
                                        N0.getOperand(1), N0.getOperand(2),
                                        EVT);
-    WorkList.push_back(N);
+    CombineTo(N, ExtLoad);
     CombineTo(N0.Val, ExtLoad, ExtLoad.getValue(1));
     return SDOperand();
   }
@@ -1684,7 +1684,7 @@
     SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, N0.getOperand(0),
                                        N0.getOperand(1), N0.getOperand(2),
                                        EVT);
-    WorkList.push_back(N);
+    CombineTo(N, ExtLoad);
     CombineTo(N0.Val, ExtLoad, ExtLoad.getValue(1));
     return SDOperand();
   }



_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to