[llvm] [LangRef] Clarify semantics of objectsize min parameter (PR #156309)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 1 03:42:55 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-ir
Author: Nikita Popov (nikic)
<details>
<summary>Changes</summary>
LangRef currently only says that this determines the return value if the object size if unknown. What it actually does is determine whether the minimum or maximum size is reported, which degenerates to 0 or -1 if unknown.
Fixes https://github.com/llvm/llvm-project/issues/156192.
---
Full diff: https://github.com/llvm/llvm-project/pull/156309.diff
1 Files Affected:
- (modified) llvm/docs/LangRef.rst (+9-3)
``````````diff
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index b122fd352eaf5..941a7bea6cffe 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -29557,9 +29557,15 @@ Arguments:
""""""""""
The ``llvm.objectsize`` intrinsic takes four arguments. The first argument is a
-pointer to or into the ``object``. The second argument determines whether
-``llvm.objectsize`` returns 0 (if true) or -1 (if false) when the object size is
-unknown. The third argument controls how ``llvm.objectsize`` acts when ``null``
+pointer to or into the ``object``.
+
+The second argument determines whether ``llvm.objectsize`` returns the minimum
+(if true) or maximum (if false) object size. The minimum size may be any size
+smaller than or equal to the actual object size (including 0 if unknown). The
+maximum size may be any size greater than or equal to the actual object size
+(including -1 if unknown).
+
+The third argument controls how ``llvm.objectsize`` acts when ``null``
in address space 0 is used as its pointer argument. If it's ``false``,
``llvm.objectsize`` reports 0 bytes available when given ``null``. Otherwise, if
the ``null`` is in a non-zero address space or if ``true`` is given for the
``````````
</details>
https://github.com/llvm/llvm-project/pull/156309
More information about the llvm-commits
mailing list