Files
llvm-project/clang/lib/CodeGen/CGCall.cpp
Grigory Pastukhov 8062e82db8 [Clang] Emit LLVM flatten attribute instead of per-callsite alwaysinline (#188615)
Follow-up to #174899 which added the flatten function attribute to LLVM
IR and implemented recursive inlining in the `AlwaysInliner` pass.

This patch updates Clang to emit the LLVM flatten attribute on functions
with `__attribute__((flatten))`, instead of the previous approach of
marking each call site with `alwaysinline`. This completes the
transition to matching GCC's flatten semantics.

  Changes:
  - Remove the callsite `alwaysinline` annotation logic from CGCall.cpp
  - Emit the flatten function attribute in CodeGenModule.cpp
  - Update clang/test/CodeGen/flatten.c to reflect the new IR output
- Update clang/test/CodeGen/AArch64/sme-inline-callees-streaming-attrs.c
to reflect the new behavior
  - Add release notes documenting the behavior change

RFC:
https://discourse.llvm.org/t/rfc-function-level-flatten-depth-attribute-for-depth-limited-inlining
2026-04-27 13:06:40 -07:00

255 KiB