From 30759542aa820b9fc74c77bfa3c011cb0a106ef9 Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Wed, 9 May 2012 15:52:43 +0000 Subject: change the objectsize intrinsic signature: add a 3rd parameter to denote the maximum runtime performance penalty that the user is willing to accept. This commit only adds the parameter. Code taking advantage of it will follow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156473 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LangRef.html | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'docs/LangRef.html') diff --git a/docs/LangRef.html b/docs/LangRef.html index cdf28078cce..b222b063194 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -8441,8 +8441,8 @@ LLVM.

Syntax:
-  declare i32 @llvm.objectsize.i32(i8* <object>, i1 <type>)
-  declare i64 @llvm.objectsize.i64(i8* <object>, i1 <type>)
+  declare i32 @llvm.objectsize.i32(i8* <object>, i1 <min>, i32 <runtime>)
+  declare i64 @llvm.objectsize.i64(i8* <object>, i1 <min>, i32 <runtime>)
 
Overview:
@@ -8453,17 +8453,21 @@ LLVM.

an allocation of a specific class, structure, array, or other object.

Arguments:
-

The llvm.objectsize intrinsic takes two arguments. The first +

The llvm.objectsize intrinsic takes three arguments. The first argument is a pointer to or into the object. The second argument - is a boolean 0 or 1. This argument determines whether you want the - maximum (0) or minimum (1) bytes remaining. This needs to be a literal 0 or - 1, variables are not allowed.

+ is a boolean and determines whether llvm.objectsize returns 0 (if true) + or -1 (if false) when the object size is unknown. + The third argument, runtime, indicates whether the compiler is allowed + to return a non-constant value. The higher the value, the higher the potential + run-time performance impact. + The second and third arguments only accepts constants.

Semantics:
-

The llvm.objectsize intrinsic is lowered to either a constant - representing the size of the object concerned, or i32/i64 -1 or 0, - depending on the type argument, if the size cannot be determined at - compile time.

+

The llvm.objectsize intrinsic is lowered to a constant representing + the size of the object concerned. If the size cannot be determined at compile + time, llvm.objectsize either returns i32/i64 -1 or 0 + (depending on the min argument) if runtime is 0, or a run-time + value (if runtime > 0 and an expression could be generated).

-- cgit v1.2.3