[clang] [llvm] [IR] Make dead_on_return attribute optionally sized (PR #171712)
Nikita Popov via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 20 03:45:18 PST 2026
================
@@ -1842,11 +1842,15 @@ Currently, only the following parameter attributes are defined:
This attribute cannot be applied to return values.
-``dead_on_return``
+``dead_on_return`` or ``dead_on_return(<n>)``
This attribute indicates that the memory pointed to by the argument is dead
upon function return, both upon normal return and if the calls unwinds, meaning
that the caller will not depend on its contents. Stores that would be observable
- either on the return path or on the unwind path may be elided.
+ either on the return path or on the unwind path may be elided. A number of
+ bytes known to be dead may optionally be provided in parentheses. It is legal
+ for the number of bytes to be less than the size of the pointee type. If a number
----------------
nikic wrote:
No such thing as a pointee type :)
https://github.com/llvm/llvm-project/pull/171712
More information about the cfe-commits
mailing list