[llvm-commits] [llvm] r90271 - /llvm/trunk/docs/LangRef.html

Chris Lattner clattner at apple.com
Tue Dec 1 15:04:15 PST 2009


On Dec 1, 2009, at 2:28 PM, Eric Christopher wrote:

> Author: echristo
> Date: Tue Dec  1 16:28:41 2009
> New Revision: 90271
>
> URL: http://llvm.org/viewvc/llvm-project?rev=90271&view=rev
> Log:
> Update per Bill's comments. Work in progress.

Some more thoughts:

"declare i32 @llvm.objectsize.i32( i8* <ptr>, i32 <type> )
declare i64 @llvm.objectsize.i64( i8* <ptr>, i32 <type> )"

These intrinsics allow any integer return type.  You should mention  
this instead of referring to i32/i64.

"If there are any side-effects in evaluating the argument"

This concept doesn't exist in LLVM IR.

"... for type 0 or 1 and i32/i64 0 for type 2 or 3."

Referring to types before you explain what they aren't doesn't make  
sense.  I'd move this down to the 'semantics' section out of  
overview.  Make overview a higher level description talking about how  
the goal and use of the intrinsic.  This section would also be a good  
place to describe what an 'object' is, which is not a term used in the  
rest of langref.

"The first bit corresponds to a return value based on whole objects,  
and the second bit whether or not we return the maximum or minimum  
remaining bytes computed."  This doesn't make a lot of sense to me  
either, please turn this into a table describing what each value is :)

-Chris



> +++ llvm/trunk/docs/LangRef.html Tue Dec  1 16:28:41 2009
> @@ -7263,22 +7263,22 @@
>
> <h5>Overview:</h5>
> <p>The <tt>llvm.objectsize</tt> intrinsic returns the constant  
> number of bytes
> -   from <tt>ptr</tt> to the end of the object <tt>ptr</tt> points  
> to if it
> +   from <tt>ptr</tt> to the end of the object <tt>ptr</tt> points  
> to, if it
>    can deduce this at compile time.  If there are any side-effects  
> in evaluating
>    the argument or it cannot deduce which objects <tt>ptr</tt>  
> points to at compile
> -   time the intrinsic returns <tt>(size_t) -1</tt> for <tt>type</ 
> tt> 0
> -   or 1 and <tt>(size_t) 0</tt> for <tt>type</tt> 2 or 3.</p>
> +   time, the intrinsic returns <tt>i32/i64 -1</tt> for <tt>type</ 
> tt> 0
> +   or 1 and <tt>i32/i64 0</tt> for <tt>type</tt> 2 or 3.</p>
>
> <h5>Arguments:</h5>
> <p>The <tt>llvm.objectsize</tt> intrinsic takes two arguments.  The  
> first
> -   argument is a pointer to the object <tt>ptr</tt> and an integer  
> <tt>type</tt>.
> -   <tt>type</tt> is an integer ranging from 0 to 3. The lsb  
> corresponds to
> -   a return value based on whole objects, the second bit whether or  
> not we
> -   return the maximum or minimum remaining bytes computed.</p>
> +   argument is a pointer to the object <tt>ptr</tt>. The second  
> argument
> +   is an integer <tt>type</tt> which ranges from 0 to 3. The first  
> bit
> +   corresponds to a return value based on whole objects, and the  
> second bit
> +   whether or not we return the maximum or minimum remaining bytes  
> computed.</p>
>
> <h5>Semantics:</h5>
> <p>The <tt>llvm.objectsize</tt> intrinsic is lowered to either a  
> constant
> -   representing the size of the object concerned or <tt>(size_t)  
> -1</tt> if
> +   representing the size of the object concerned or <tt>i32/i64 -1</ 
> tt> if
>    it cannot be determined at compile time.</p>
>
> </div>
>
>
> _______________________________________________
> 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