[clang] [llvm] [clang/LLVM] Add flatten_deep attribute for depth-limited inlining (1/2) (PR #165777)

Erich Keane via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 17 06:21:49 PST 2025


================
@@ -349,6 +347,18 @@ Attribute Changes in Clang
 - New format attributes ``gnu_printf``, ``gnu_scanf``, ``gnu_strftime`` and ``gnu_strfmon`` are added
   as aliases for ``printf``, ``scanf``, ``strftime`` and ``strfmon``. (#GH16219)
 
+- Added the ``flatten_depth`` attribute, which provides a hint to the inliner to aggressively
+  inline calls within the attributed function up to a specified depth. This attribute takes
+  a single unsigned integer argument representing the requested depth of inlining. Unlike
+  a strict limit, the requested depth is a hint that works cooperatively with other inlining
+  mechanisms:
----------------
erichkeane wrote:

```suggestion
  mechanisms, including:
```

I don't think we want to imply the below list is comprehensive :) 

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


More information about the llvm-commits mailing list