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

Evan Cheng evan.cheng at apple.com
Mon Nov 6 00:14:46 PST 2006



Changes in directory llvm/lib/CodeGen/SelectionDAG:

DAGCombiner.cpp updated: 1.237 -> 1.238
---
Log message:

Add comment.

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

 DAGCombiner.cpp |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.237 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.238
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.237	Sun Nov  5 13:31:28 2006
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp	Mon Nov  6 02:14:30 2006
@@ -174,7 +174,13 @@
       return true;
     }
 
-    bool CombineToIndexedLoadStore(SDNode *N) {
+    /// CombineToPreIndexedLoadStore - Try turning a load / store into a
+    /// pre-indexed load store when the base pointer is a add or subtract
+    /// and it has other uses besides the load / store. When the
+    /// transformation is done, the new indexed load / store effectively
+    /// folded the add / subtract in and all of its other uses are redirected
+    /// to the new load / store.
+    bool CombineToPreIndexedLoadStore(SDNode *N) {
       bool isLoad = true;
       SDOperand Ptr;
       if (LoadSDNode *LD  = dyn_cast<LoadSDNode>(N)) {
@@ -811,7 +817,7 @@
         return DAG.getNode(ISD::OR, VT, N0, N1);
     }
   }
-  
+
   return SDOperand();
 }
 
@@ -2871,7 +2877,7 @@
   }
 
   // Try transforming N to an indexed load.
-  if (CombineToIndexedLoadStore(N))
+  if (CombineToPreIndexedLoadStore(N))
     return SDOperand(N, 0);
 
   return SDOperand();
@@ -2917,7 +2923,7 @@
   }
   
   // Try transforming N to an indexed store.
-  if (CombineToIndexedLoadStore(N))
+  if (CombineToPreIndexedLoadStore(N))
     return SDOperand(N, 0);
 
   return SDOperand();






More information about the llvm-commits mailing list