[all-commits] [llvm/llvm-project] 5430f7: [Clang] Demote always_inline error to warning for ...
Sander de Smalen via All-commits
all-commits at lists.llvm.org
Mon Jul 29 01:29:52 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 5430f73b501f9fc0a38c3768592f5f31bcbdf2f0
https://github.com/llvm/llvm-project/commit/5430f73b501f9fc0a38c3768592f5f31bcbdf2f0
Author: Sander de Smalen <sander.desmalen at arm.com>
Date: 2024-07-29 (Mon, 29 Jul 2024)
Changed paths:
M clang/include/clang/Basic/DiagnosticFrontendKinds.td
M clang/lib/CodeGen/Targets/AArch64.cpp
M clang/test/CodeGen/aarch64-sme-inline-streaming-attrs.c
Log Message:
-----------
[Clang] Demote always_inline error to warning for mismatching SME attrs (#100740)
PR #77936 introduced a diagnostic to avoid calls being inlined into
functions with a different streaming mode, because inlining those
functions may result in different runtime behaviour. This was necessary
because LLVM doesn't check whether inlining is possible and thus blindly
inlines the function without checking feasibility.
In practice however, this introduces an artificial restriction that the
user may not be able to work around. Calling an `always_inline` function
from some header file that is out of the control of the user would
result in an error that the user cannot remedy.
Therefore, this patch demotes the error into a warning (for calls from
streaming[-compatible] -> non-streaming), but the proper fix would be to
fix the AlwaysInliner in LLVM to avoid inlining when it has analyzed the
callee and has determined that inlining is not possible.
Calling an always_inline function for calls from non-streaming ->
streaming will remain an error, because there is little pre-existing
code for SME, so it is expected that the header file can be modified by
the user (e.g. by using `__arm_streaming_compatible` if the code is
claimed to be compatible).
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