public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* Review decision to inline mempcpy to memcpy.
@ 2016-03-03 15:23 Carlos O'Donell
  2016-03-03 20:55 ` H.J. Lu
       [not found] ` <AM3PR08MB0088D8CBEE224AA54E620F6983BE0@AM3PR08MB0088.eurprd08.prod.outlook.com>
  0 siblings, 2 replies; 5+ messages in thread
From: Carlos O'Donell @ 2016-03-03 15:23 UTC (permalink / raw)
  To: GNU C Library, Ondrej Bilka, Joseph S. Myers, Wilco Dijkstra,
	Jakub Jelinek, Jeff Law

The upstream gcc PR/70055 requests that glibc revert commit
05a910f7b420c2b831f35ba90e61c80f001c0606 and instead work
with gcc to make the builtin mempcpy better (for various
aspects of performance).

The crux of the argument is that the compiler may be able
to do a better job of optimizing if it knows the call was
a mempcpy as opposed to memcpy + addition.

I understand the need of glibc machine maintainers to produce
a library whose performance is as optimal as they can given
the compilers we have today. This leads to decisions like those
we made to transform mempcpy to memcpy + addition.

I also understand the worries that the compiler developers see
in such a transformation. Information has been lost to the
compiler that might generated better code.

Is there a middle ground here? Should machines with mempcpy.S,
particularly x86_64 define _HAVE_STRING_ARCH_mempcpy in their
string.h? I think this question wasn't clearly answered before
the patch went in. However, the microbenchmarks show this is
a clear gain given modern compilers for x86_64. Is this because
x86_64's mempcpy.S is flawed? Does it need to be fixed as
opposed to transforming mempcpy to memcpy+addition?

Ondrej,

Did you file gcc bugs to revuew the optimization issues
with current mempcpy as suggested in [2] and [3]?

Wilco,

Were the changes in glibc to optimize mempcpy as memcpy
originally motivated by performance for ARM?

Particularly because ARM does not have an optimized
mempcpy implementation in glibc?

Cheers,
Carlos.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70055
[2] https://sourceware.org/ml/libc-alpha/2015-05/msg00778.html
[3] https://sourceware.org/ml/libc-alpha/2015-05/msg00780.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-03-04 20:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-03 15:23 Review decision to inline mempcpy to memcpy Carlos O'Donell
2016-03-03 20:55 ` H.J. Lu
2016-03-03 21:37   ` Carlos O'Donell
     [not found] ` <AM3PR08MB0088D8CBEE224AA54E620F6983BE0@AM3PR08MB0088.eurprd08.prod.outlook.com>
2016-03-04 16:57   ` Jakub Jelinek
2016-03-04 20:20   ` Wilco Dijkstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).