[llvm-commits] CVS: llvm/lib/VMCore/Type.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Sep 2 15:07:07 PDT 2003


Changes in directory llvm/lib/VMCore:

Type.cpp updated: 1.53 -> 1.54

---
Log message:

Don't bother doing an exhaustive recursive walk if we are at the limit of what 
we need to know anyway.  This reduces the 2002-07-08-HugePerformanceProblem.llx
down to 3.210u:0.010s, which is back in the acceptable range again



---
Diffs of the changes:

Index: llvm/lib/VMCore/Type.cpp
diff -u llvm/lib/VMCore/Type.cpp:1.53 llvm/lib/VMCore/Type.cpp:1.54
--- llvm/lib/VMCore/Type.cpp:1.53	Tue Sep  2 14:14:12 2003
+++ llvm/lib/VMCore/Type.cpp	Tue Sep  2 15:06:29 2003
@@ -372,7 +372,7 @@
 }
 
 OpaqueType::OpaqueType() : DerivedType(OpaqueTyID) {
-  Recursive = false;
+  setRecursive(false);
   setAbstract(true);
 #ifdef DEBUG_MERGE_TYPES
   std::cerr << "Derived new type: " << getDescription() << "\n";
@@ -413,8 +413,10 @@
   TypeStack.push_back(Ty);    // Add us to the stack..
 
   for (Type::subtype_iterator I = Ty->subtype_begin(), E = Ty->subtype_end();
-       I != E; ++I)
+       I != E; ++I) {
     getTypeProps(*I, TypeStack, isAbstract, isRecursive);
+    if (isAbstract && isRecursive) break;
+  }
       
   TypeStack.pop_back();       // Remove self from stack...
 }





More information about the llvm-commits mailing list