[llvm-commits] [llvm] r41879 - in /llvm/trunk: docs/GarbageCollection.html lib/Transforms/Scalar/LowerGC.cpp

Gordon Henriksen ghenriksen at carbonite.com
Wed Sep 12 11:14:51 PDT 2007


Hm. Are you sure this is wise? I realize my patch didn't provide root  
initialization, but I have that fixed locally. Without liveness  
analysis, leaving stack roots uninitialized seems unwise, since gc  
points are not entirely predictable from the IR.

On 2007-09-12, at 13:53, Chris Lattner wrote:

> Author: lattner
> Date: Wed Sep 12 12:53:10 2007
> New Revision: 41879
>
> URL: http://llvm.org/viewvc/llvm-project?rev=41879&view=rev
> Log:
> Change llvm.gcroot to not init the root to null at runtime, this  
> prevents
> using it for live-in values etc.
>
> Modified:
>     llvm/trunk/docs/GarbageCollection.html
>     llvm/trunk/lib/Transforms/Scalar/LowerGC.cpp
>
> Modified: llvm/trunk/docs/GarbageCollection.html
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ 
> GarbageCollection.html?rev=41879&r1=41878&r2=41879&view=diff
>
> ====================================================================== 
> ========
> --- llvm/trunk/docs/GarbageCollection.html (original)
> +++ llvm/trunk/docs/GarbageCollection.html Wed Sep 12 12:53:10 2007
> @@ -166,9 +166,7 @@
>  The <tt>llvm.gcroot</tt> intrinsic is used to inform LLVM of a  
> pointer variable
>  on the stack.  The first argument contains the address of the  
> variable on the
>  stack, and the second contains a pointer to metadata that should  
> be associated
> -with the pointer (which <b>must</b> be a constant or global value  
> address).  At
> -runtime, the <tt>llvm.gcroot</tt> intrinsic stores a null pointer  
> into the
> -specified location to initialize the pointer.</p>
> +with the pointer (which <b>must</b> be a constant or global value  
> address).</p>
>
>  <p>
>  Consider the following fragment of Java code:
> @@ -193,6 +191,9 @@
>     %X = alloca %Object*
>     ...
>
> +   ;; Java null-initializes pointers.
> +   store %Object* null, %Object** %X
> +
>     ;; "CodeBlock" is the block corresponding to the start
>     ;;  of the scope above.
>  CodeBlock:
>
> Modified: llvm/trunk/lib/Transforms/Scalar/LowerGC.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/ 
> Scalar/LowerGC.cpp?rev=41879&r1=41878&r2=41879&view=diff
>
> ====================================================================== 
> ========
> --- llvm/trunk/lib/Transforms/Scalar/LowerGC.cpp (original)
> +++ llvm/trunk/lib/Transforms/Scalar/LowerGC.cpp Wed Sep 12  
> 12:53:10 2007
> @@ -284,10 +284,7 @@
>      new StoreInst(Null, RootPtrPtr, IP);
>
>      // Each occurrance of the llvm.gcroot intrinsic now turns into an
> -    // initialization of the slot with the address and a zeroing  
> out of the
> -    // address specified.
> -    new StoreInst(Constant::getNullValue(PtrLocTy->getElementType()),
> -                  GCRoots[i]->getOperand(1), GCRoots[i]);
> +    // initialization of the slot with the address.
>      new StoreInst(GCRoots[i]->getOperand(1), RootPtrPtr, GCRoots[i]);
>    }
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



— Gordon

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20070912/9f105f69/attachment.html>


More information about the llvm-commits mailing list