https://github.com/guyfischman created 
https://github.com/llvm/llvm-project/pull/244001

Both LangRef and the clang attribute docs still say preserve_all "like the 
PreserveMost calling convention, will be used by a future version of the 
Objective-C runtime and should be considered experimental at this time." Since 
#214205 the comparison no longer holds, and the convention is in use, including 
in shipped ABIs:

- clang's -fsanitize-handler-preserve-all-regs (#168644, #168645) calls the 
UBSan minimal runtime handlers with preserve_all on X86-64 and AArch64, so the 
caller does not spill registers around a check.
- Apple's BrowserEngineCore framework declares its JIT memory functions 
(be_memory_inline_jit_restrict_*, macOS 14.3 / iOS 17.4) with 
__attribute__((preserve_all)) in the public SDK headers.
- Apple's clang uses it for the -fbounds-safety soft trap runtime calls, 
Google's gwpsan for its use-after-return detector, and FEX-Emu for the helpers 
its JIT calls on AArch64 hosts.

On #214205 I said preserve_all's adoption story was much thinner. I now have a 
use for preserve_all, so I did a more thorough search and found the Apple SDK 
declares functions with it.

>From eb2f75d3b7d895d9e0ddf76751f94bc19657bcd6 Mon Sep 17 00:00:00 2001
From: Guy Fischman <[email protected]>
Date: Sat, 14 Nov 2026 23:27:35 +0100
Subject: [PATCH] [docs] Drop stale "experimental" note for preserve_all

---
 clang/include/clang/Basic/AttrDocs.td | 8 +++++---
 llvm/docs/LangRef.md                  | 8 +++++---
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/clang/include/clang/Basic/AttrDocs.td 
b/clang/include/clang/Basic/AttrDocs.td
index 9828968c9d0f41..943f60109ece64 100644
--- a/clang/include/clang/Basic/AttrDocs.td
+++ b/clang/include/clang/Basic/AttrDocs.td
@@ -7071,9 +7071,11 @@ returned in callee-saved registers.
 The idea behind this convention is to support calls to runtime functions
 that don't need to call out to any other functions.
 
-This calling convention, like the `preserve_most` calling convention, will be
-used by a future version of the Objective-C runtime and should be considered
-experimental at this time.
+This convention was created to optimize certain runtime calls to the
+Objective-C runtime, but it is not limited to that runtime; it is also used by
+other runtimes and libraries, such as the UBSan minimal runtime and Apple's
+BrowserEngineCore framework. The current implementation supports X86-64 and
+AArch64.
   }];
 }
 
diff --git a/llvm/docs/LangRef.md b/llvm/docs/LangRef.md
index cfb4d965dc1487..8010107566fd03 100644
--- a/llvm/docs/LangRef.md
+++ b/llvm/docs/LangRef.md
@@ -459,9 +459,11 @@ added in the future:
     The idea behind this convention is to support calls to runtime functions
     that don't need to call out to any other functions.
 
-    This calling convention, like the `PreserveMost` calling convention, will 
be
-    used by a future version of the Objective-C runtime and should be 
considered
-    experimental at this time.
+    This convention was created to optimize certain runtime calls to the
+    Objective-C runtime, but it is not limited to that runtime; it is also used
+    by other runtimes and libraries, such as the UBSan minimal runtime and
+    Apple's BrowserEngineCore framework. The current implementation supports
+    X86-64 and AArch64.
 
 "`preserve_nonecc`" - The `PreserveNone` calling convention
 :   This calling convention doesn't preserve any general registers. So all

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to