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

Grigory Pastukhov via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 31 11:30:22 PDT 2025


grigorypas wrote:

> I'm not sure this design is really practical for users. Trying to make the user count out the depth seems like it'll be difficult to use effectively: it's hard to count, and the user has no direct control over which calls are affected. And code refactoring is likely to break the intent.
> 
> Could you describe a bit more what led you to this particular solution?

Thank you for your feedback and for raising these concerns.
To clarify, our primary use case at Meta is to completely flatten functions by inlining the entire call tree. The max depth parameter is not intended as a core part of the user workflow, but rather as a safeguard to prevent issues if the call tree happens to be extremely deep.

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


More information about the cfe-commits mailing list