llvm-project
626eeb8e - [libc] Fix LIBC_LIKELY/LIBC_UNLIKELY and add LIBC_NOINLINE. (#230505)

Commit
1 day ago
[libc] Fix LIBC_LIKELY/LIBC_UNLIKELY and add LIBC_NOINLINE. (#230505) `__builtin_expect(value, expected)` requires the second argument to be a constant expression. Previously, `LIBC_LIKELY` and `LIBC_UNLIKELY` wrapped `__builtin_expect(value, expected)` inside `details::expects_bool_condition(T value, T expected)`, where `expected` was a function parameter rather than a constant expression. So the hints were silently dropped by the compilers. Also add LIBC_NOINLINE macro to `attributes.h` to outlining slow paths.
Author
Parents
Loading