[libc-commits] [libc] [libc] Remove unnecessary call in memfunction dispatchers (PR #75800)

Dmitry Vyukov via libc-commits libc-commits at lists.llvm.org
Mon Dec 18 22:34:15 PST 2023


================
@@ -32,7 +32,8 @@
 
 namespace LIBC_NAMESPACE {
 
-LIBC_INLINE int inline_bcmp(const void *p1, const void *p2, size_t count) {
+__attribute__((flatten)) LIBC_INLINE int
----------------
dvyukov wrote:

I see. Interesting, so this is not due to code size, but due to I guess compiler wanting to give different functions different addresses (or is inline_memcmp_x86 called from multiple places and compiler decides to reduce code size?).

The question is: can compiler tomorrow inline inline_memcmp_x86 into inline_memcmp (as we asked with flatten), but make memcmp jmp to inline_memcmp?
Another good question is how to test this. These things regress due to compiler bugs, or seemingly unrelated refactorings. Quality bugs are more frequent than crashing bugs because they are silent and go unnoticed.


https://github.com/llvm/llvm-project/pull/75800


More information about the libc-commits mailing list