[all-commits] [llvm/llvm-project] db6f62: [clang][SME] Ignore flatten/clang::always_inline s...
Benjamin Maxwell via All-commits
all-commits at lists.llvm.org
Tue Nov 26 06:26:55 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: db6f627f3fd4072fe1814805653a352694527a91
https://github.com/llvm/llvm-project/commit/db6f627f3fd4072fe1814805653a352694527a91
Author: Benjamin Maxwell <benjamin.maxwell at arm.com>
Date: 2024-11-26 (Tue, 26 Nov 2024)
Changed paths:
M clang/lib/CodeGen/CGCall.cpp
M clang/lib/CodeGen/TargetInfo.h
M clang/lib/CodeGen/Targets/AArch64.cpp
A clang/test/CodeGen/AArch64/sme-inline-callees-streaming-attrs.c
Log Message:
-----------
[clang][SME] Ignore flatten/clang::always_inline statements for callees with mismatched streaming attributes (#116391)
If `__attribute__((flatten))` is used on a function, or
`[[clang::always_inline]]` on a statement, don't inline any callees with
incompatible streaming attributes. Without this check, clang may produce
incorrect code when these attributes are used in code with streaming
functions.
Note: The docs for flatten say it can be ignored when inlining is
impossible: "causes calls within the attributed function to be inlined
unless it is impossible to do so".
Similarly, the (clang-only) `[[clang::always_inline]]` statement
attribute is more relaxed than the GNU `__attribute__((always_inline))`
(which says it should error it if it can't inline), saying only "If a
statement is marked [[clang::always_inline]] and contains calls, the
compiler attempts to inline those calls.". The docs also go on to show
an example of where `[[clang::always_inline]]` has no effect.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list