[llvm-commits] [llvm] r108553 - in /llvm/trunk: include/llvm/DerivedTypes.h lib/Transforms/IPO/GlobalOpt.cpp lib/VMCore/Type.cpp lib/VMCore/TypesContext.h

Chris Lattner sabre at nondot.org
Fri Jul 16 13:50:13 PDT 2010


Author: lattner
Date: Fri Jul 16 15:50:13 2010
New Revision: 108553

URL: http://llvm.org/viewvc/llvm-project?rev=108553&view=rev
Log:
eliminate unlockedRefineAbstractTypeTo, types are all per-llvmcontext,
so there is no locking involved in type refinement.

Modified:
    llvm/trunk/include/llvm/DerivedTypes.h
    llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
    llvm/trunk/lib/VMCore/Type.cpp
    llvm/trunk/lib/VMCore/TypesContext.h

Modified: llvm/trunk/include/llvm/DerivedTypes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DerivedTypes.h?rev=108553&r1=108552&r2=108553&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DerivedTypes.h (original)
+++ llvm/trunk/include/llvm/DerivedTypes.h Fri Jul 16 15:50:13 2010
@@ -52,10 +52,6 @@
   ///
   void dropAllTypeUses();
 
-  /// unlockedRefineAbstractTypeTo - Internal version of refineAbstractTypeTo
-  /// that performs no locking.  Only used for internal recursion.
-  void unlockedRefineAbstractTypeTo(const Type *NewType);
-  
 public:
 
   //===--------------------------------------------------------------------===//

Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=108553&r1=108552&r2=108553&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Fri Jul 16 15:50:13 2010
@@ -1467,7 +1467,7 @@
                                                TargetData *TD) {
   if (!TD)
     return false;
-          
+  
   // If this is a malloc of an abstract type, don't touch it.
   if (!AllocTy->isSized())
     return false;

Modified: llvm/trunk/lib/VMCore/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Type.cpp?rev=108553&r1=108552&r2=108553&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Type.cpp (original)
+++ llvm/trunk/lib/VMCore/Type.cpp Fri Jul 16 15:50:13 2010
@@ -1128,13 +1128,13 @@
   
 }
 
-// unlockedRefineAbstractTypeTo - This function is used when it is discovered
+// refineAbstractTypeTo - This function is used when it is discovered
 // that the 'this' abstract type is actually equivalent to the NewType
 // specified. This causes all users of 'this' to switch to reference the more 
 // concrete type NewType and for 'this' to be deleted.  Only used for internal
 // callers.
 //
-void DerivedType::unlockedRefineAbstractTypeTo(const Type *NewType) {
+void DerivedType::refineAbstractTypeTo(const Type *NewType) {
   assert(isAbstract() && "refineAbstractTypeTo: Current type is not abstract!");
   assert(this != NewType && "Can't refine to myself!");
   assert(ForwardType == 0 && "This type has already been refined!");
@@ -1199,15 +1199,6 @@
   // destroyed.
 }
 
-// refineAbstractTypeTo - This function is used by external callers to notify
-// us that this abstract type is equivalent to another type.
-//
-void DerivedType::refineAbstractTypeTo(const Type *NewType) {
-  // All recursive calls will go through unlockedRefineAbstractTypeTo,
-  // to avoid deadlock problems.
-  unlockedRefineAbstractTypeTo(NewType);
-}
-
 // notifyUsesThatTypeBecameConcrete - Notify AbstractTypeUsers of this type that
 // the current type has transitioned from being abstract to being concrete.
 //

Modified: llvm/trunk/lib/VMCore/TypesContext.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/TypesContext.h?rev=108553&r1=108552&r2=108553&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/TypesContext.h (original)
+++ llvm/trunk/lib/VMCore/TypesContext.h Fri Jul 16 15:50:13 2010
@@ -370,7 +370,7 @@
         // We already have this type in the table.  Get rid of the newly refined
         // type.
         TypeClass *NewTy = cast<TypeClass>((Type*)I->second.get());
-        Ty->unlockedRefineAbstractTypeTo(NewTy);
+        Ty->refineAbstractTypeTo(NewTy);
         return;
       }
     } else {
@@ -406,7 +406,7 @@
               }
               TypesByHash.erase(Entry);
             }
-            Ty->unlockedRefineAbstractTypeTo(NewTy);
+            Ty->refineAbstractTypeTo(NewTy);
             return;
           }
         }





More information about the llvm-commits mailing list