]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
compiler_types: Add __assume macro
authorHeiko Carstens <hca@linux.ibm.com>
Tue, 16 Sep 2025 13:48:01 +0000 (15:48 +0200)
committerAlexander Gordeev <agordeev@linux.ibm.com>
Thu, 18 Sep 2025 12:06:40 +0000 (14:06 +0200)
commitf72e2cff13aefe305fc8fc6afe4f43626e4ad88c
tree74749428a27a76b5ddd724e66892c4de6e9c2e7e
parenta9f859b516ac98c06b0d24e691fceab32a9665d5
compiler_types: Add __assume macro

Make the statement attribute "assume" with a new __assume macro available.

The assume attribute is used to indicate that a certain condition is
assumed to be true. Compilers may or may not use this indication to
generate optimized code. If this condition is violated at runtime, the
behavior is undefined.

Note that the clang documentation states that optimizers may react
differently to this attribute, and this may even have a negative
performance impact. Therefore this attribute should be used with care.

Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
include/linux/compiler_types.h
init/Kconfig