This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fixes tree-loop-distribute-patterns issues
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>, "GNU C. Library" <libc-alpha at sourceware dot org>, Siddhesh Poyarekar <siddhesh at redhat dot com>
- Date: Wed, 19 Jun 2013 22:58:52 -0400
- Subject: Re: [PATCH] Fixes tree-loop-distribute-patterns issues
- References: <51C0AFB7 dot 1060009 at linux dot vnet dot ibm dot com> <20130618205608 dot 9CCE22C0AC at topped-with-meat dot com> <51C1BFE9 dot 4070805 at linux dot vnet dot ibm dot com> <51C1CEFC dot 9000100 at redhat dot com> <51C1FE4C dot 3020400 at linux dot vnet dot ibm dot com> <20130619221130 dot 7B91A2C10E at topped-with-meat dot com> <51C2338B dot 4040304 at redhat dot com> <20130619225134 dot B7FBB2C111 at topped-with-meat dot com> <51C23836 dot 806 at redhat dot com> <20130619232240 dot 536F02C112 at topped-with-meat dot com>
On 06/19/2013 07:22 PM, Roland McGrath wrote:
>>> For this case, I really don't think it makes any kind of sense to
>>> "dynamically test for what is actually wrong"--or perhaps even to think
>>> that you ever could. The real "what is actually wrong" is not a dynamic
>>> thing. It's statically true that it's wrong for the compiler to think it
>>> has the option to emit a library call in these cases.
>>
>> That truth isn't strictly tied to the option itself, it is tied to a
>> compiler behaviour. We can't know the compiler behaviour unless we test
>> that behaviour.
>
> We don't need to know it. We need to constrain it.
Thanks, that clarifies your position better than anything else you've said.
>> Say in 5 years gcc grows the ability to optimize memset into a set of
>> optimal vector libcalls? The test as it was proposed would detect that
>> memset was no longer called, avoid the workaround, and we'd get a faster
>> memset (albeit tied to whatever compiler runtime has the libcalls, think
>> libgcc, think ARM compiler helper routines).
>
> Burn that bridge when we come to it? ;-)
Heh. OK, agreed :-)
> I am far more concerned about today's libc becoming unbuildable with a
> future compiler than I am about today's libc being optimized by a future
> compiler no better than it is by today's compilers.
>
> The conservative assumption is that those hypothetical future other
> outcalls will themselves be implemented using standard libc functions and
> create an indirect circularity.
That's something I hadn't considered, and it's a good point.
>> The turning point though would be if we had enough framework in place
>> for me to invoke a compilation of memset from the actual glibc source
>> as part of the configure and test if the failure was present?
>
> Perhaps something like that. At that point I think we would not do it in
> configure at all. It could be in the build process itself. For example,
> compile each function without optimization, collect the list of external
> references it generates that way, then compile with optimization and see if
> it started calling things the unoptimized version didn't call; if it did,
> annotate it to inhibit the optimizations suspected of producing them (it
> could even be iterative for a set of possible annotations). Not to get
> into the details of the hypothetical right now, just an example. The short
> version is to say a dynamic approach is acceptable if it's completely
> robust (in a maintainable way).
Thank you for indulging this line of thinking. It certainly gives me idea
for future enhancements.
Cheers,
Carlos.