Clang 24 now gives a build error if a function is marked with both - #11011
Merged
Conversation
always_inline and noinline at the same time. In XNNPACK, helper functions that perform out-of-bounds reads use XNN_OOB_READS to disable sanitizers (ASAN, MSAN, TSAN, HWASAN). To stop Clang from dropping those sanitizer attributes during inlining, XNN_OOB_READS adds noinline. However, because these functions are declared with XNN_INLINE, they also got always_inline, causing Clang 24 to fail. This change fixes the build: - Added XNN_HAS_OOB_READS_SANITIZER in src/xnnpack/common.h to check if ASAN, MSAN, TSAN, or HWASAN is turned on. - When a sanitizer is running, XNN_INLINE drops always_inline (using plain inline instead). - In normal builds without sanitizers, XNN_INLINE keeps always_inline for fast runtime performance. PiperOrigin-RevId: 966832986
copybara-service
Bot
force-pushed
the
test_966819582
branch
from
August 18, 2026 22:18
a147766 to
fe6fe52
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clang 24 now gives a build error if a function is marked with both
always_inline and noinline at the same time.
In XNNPACK, helper functions that perform out-of-bounds reads use
XNN_OOB_READS to disable sanitizers (ASAN, MSAN, TSAN, HWASAN).
To stop Clang from dropping those sanitizer attributes during inlining,
XNN_OOB_READS adds noinline. However, because these functions are declared
with XNN_INLINE, they also got always_inline, causing Clang 24 to fail.
This change fixes the build:
ASAN, MSAN, TSAN, or HWASAN is turned on.
inline instead).
fast runtime performance.