[clang] [llvm] [Clang][SME] Detect always_inline used with mismatched streaming attributes (PR #77936)

Sam Tebbs via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 19 02:29:50 PST 2024


SamTebbs33 wrote:

> clang has never emitted diagnostics for failure to inline an always_inline function. But if gcc is doing it, maybe defaulting to an error isn't such a big deal.

clang does actually emit an error when it finds always_inline on a callee with different target attributes to the caller: https://godbolt.org/z/37Yz4oPjo

> Separately, it's probably worth ensuring that the LLVM inlining passes don't actually perform illegal inlining for functions marked always_inline; looking at the code, it looks like we might end up skipping the relevant checks.

The `TargetTransformInfo::areInlineCompatible` function in llvm makes these checks.



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


More information about the cfe-commits mailing list