allow field sensitivity to be a tunable parameter
authorAndrew Lenharth <andrewl@lenharth.org>
Wed, 15 Mar 2006 05:43:41 +0000 (05:43 +0000)
committerAndrew Lenharth <andrewl@lenharth.org>
Wed, 15 Mar 2006 05:43:41 +0000 (05:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26777 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/DataStructure/DataStructure.cpp

index bd1757dcfd9c83e20d25fe796828c3a7aaf3fdc3..7fabdf21238606988a70234a3aa4bb8c7edd89f5 100644 (file)
@@ -39,6 +39,10 @@ namespace {
   Statistic<> NumDNE            ("dsa", "Number of nodes removed by reachability");
   Statistic<> NumTrivialDNE     ("dsa", "Number of nodes trivially removed");
   Statistic<> NumTrivialGlobalDNE("dsa", "Number of globals trivially removed");
+  static cl::opt<unsigned>
+  DSAFieldLimit("dsa-field-limit", cl::Hidden,
+                cl::desc("Number of fields to track before collapsing a node"),
+                cl::init(256));
 };
 
 #if 0
@@ -468,7 +472,7 @@ bool DSNode::mergeTypeInfo(const Type *NewTy, unsigned Offset,
     // collapse it.  This can occur for fortran common blocks, which have stupid
     // things like { [100000000 x double], [1000000 x double] }.
     unsigned NumFields = (NewTySize+DS::PointerSize-1) >> DS::PointerShift;
-    if (NumFields > 256) {
+    if (NumFields > DSAFieldLimit) {
       foldNodeCompletely();
       return true;
     }
@@ -496,7 +500,7 @@ bool DSNode::mergeTypeInfo(const Type *NewTy, unsigned Offset,
     // collapse it.  This can occur for fortran common blocks, which have stupid
     // things like { [100000000 x double], [1000000 x double] }.
     unsigned NumFields = (NewTySize+Offset+DS::PointerSize-1) >> DS::PointerShift;
-    if (NumFields > 256) {
+    if (NumFields > DSAFieldLimit) {
       foldNodeCompletely();
       return true;
     }