[llvm-commits] [llvm] r114046 - /llvm/trunk/lib/VMCore/Attributes.cpp

Chris Lattner clattner at apple.com
Wed Sep 15 18:13:15 PDT 2010


On Sep 15, 2010, at 5:27 PM, Owen Anderson wrote:

> Author: resistor
> Date: Wed Sep 15 19:27:35 2010
> New Revision: 114046
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=114046&view=rev
> Log:
> Fix a threaded LLVM bug due the need for operator= on reference counted AttrListImpl's.  It might
> be possible to implement this very carefully to allow a lock-free implementation while still
> avoiding illegal interleavings, but I haven't been able to figure one out.

What is the compile-time performance impact of this for the non-threaded case?

-Chris

> 
> Modified:
>    llvm/trunk/lib/VMCore/Attributes.cpp
> 
> Modified: llvm/trunk/lib/VMCore/Attributes.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Attributes.cpp?rev=114046&r1=114045&r2=114046&view=diff
> ==============================================================================
> --- llvm/trunk/lib/VMCore/Attributes.cpp (original)
> +++ llvm/trunk/lib/VMCore/Attributes.cpp Wed Sep 15 19:27:35 2010
> @@ -195,6 +195,7 @@
> }
> 
> const AttrListPtr &AttrListPtr::operator=(const AttrListPtr &RHS) {
> +  sys::SmartScopedLock<true> Lock(*ALMutex);
>   if (AttrList == RHS.AttrList) return *this;
>   if (AttrList) AttrList->DropRef();
>   AttrList = RHS.AttrList;
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list