[llvm] [LangRef] Mention allocation elision (PR #177592)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 11 03:59:16 PST 2026


================
@@ -2077,6 +2077,19 @@ For example:
     The first three options are mutually exclusive, and the remaining options
     describe more details of how the function behaves. The remaining options
     are invalid for "free"-type functions.
+
+    Calls to functions annotated with ``allockind`` are subject to allocation
+    elision: Calls to allocator functions can be removed, and the allocation
+    served from a virtual allocator instead. Notably, this is allowed even if
+    the allocator calls have side-effects. In other words, for each allocation
+    there there is a non-deterministic choice between calling the allocator as
+    usual, or using a virtual, side-effect-free allocator instead.
----------------
antoniofrighetto wrote:

Sorry, possibly missing some context, just wondering, am I understanding correctly that this, slightly rephrased, may imply that we substantially do not care whether there are side-effects or not for the purposes of above? That either a side-effect and a side-effect-free allocation call is fine?

https://github.com/llvm/llvm-project/pull/177592


More information about the llvm-commits mailing list