[llvm-commits] [poolalloc] r119752 - /poolalloc/trunk/lib/DSA/Local.cpp

Arushi Aggarwal aggarwa4 at illinois.edu
Thu Nov 18 15:02:49 PST 2010


Author: aggarwa4
Date: Thu Nov 18 17:02:49 2010
New Revision: 119752

URL: http://llvm.org/viewvc/llvm-project?rev=119752&view=rev
Log:
We now use GEPs to infer if a node is an array node.
Do not ignore GEP even if all indexes are zero.

Modified:
    poolalloc/trunk/lib/DSA/Local.cpp

Modified: poolalloc/trunk/lib/DSA/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Local.cpp?rev=119752&r1=119751&r2=119752&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/Local.cpp (original)
+++ poolalloc/trunk/lib/DSA/Local.cpp Thu Nov 18 17:02:49 2010
@@ -486,23 +486,14 @@
     Value = createNode();
 
   //
-  // There are a few quick and easy cases to handle.  If the index operands of
-  // the GEP are all zero, or if the DSNode of the indexed pointer is already
-  // folded, then we know that the result of the GEP will have the same offset
-  // into the same DSNode as the indexed pointer.
-  //
-  bool AllZeros = true;
-  for (unsigned i = 1, e = GEP.getNumOperands(); i != e; ++i) {
-    if (ConstantInt * CI = dyn_cast<ConstantInt>(GEP.getOperand(i)))
-      if (CI->isZero()) {
-        continue;
-      }
-    AllZeros = false;
-    break;
-  }
+  // There are a few quick and easy cases to handle.  If  the DSNode of the 
+  // indexed pointer is already folded, then we know that the result of the 
+  // GEP will have the same offset into the same DSNode 
+  // as the indexed pointer.
+  //
 
-  if (AllZeros || (!Value.isNull() &&
-                   Value.getNode()->isNodeCompletelyFolded())) {
+  if (!Value.isNull() &&
+                   Value.getNode()->isNodeCompletelyFolded()) {
     setDestTo(GEP, Value);
     return;
   }





More information about the llvm-commits mailing list