[PATCH] remove nested function hack_digit
Konstantin Serebryany
konstantin.s.serebryany@gmail.com
Mon Sep 22 23:42:00 GMT 2014
Here is a better formatted and tested patch that uses a single parameter.
The generated code is nearly identical (same instructions, differences
only in constant offsets).
On Mon, Sep 22, 2014 at 3:52 PM, Konstantin Serebryany
<konstantin.s.serebryany@gmail.com> wrote:
> On Mon, Sep 22, 2014 at 3:45 PM, Roland McGrath <roland@hack.frob.com> wrote:
>>> hack_digit becomes longer too due to longer function prologue epilogue:
>>
>> Clearly that cannot be the only difference. Was the function's code itself
>> actually all nearly identical, modulo trivial differences like different
>> register allocation choices? Each access to one of the parent's locals
>> surely looks different, and how different that code looks is probably where
>> the most important differences are.
>
> Another difference is that the compile decided to rearrange the order
> of basic blocks, so the calls go in different orders.
> I've attached the disassembly for both variants.
>
>>
>>> I considered doing such a patch but it turned out a huge textual
>>> change that will make the code much less readable.
>>> Still, let me do it and send it here anyway, unless you tell me no to.
>>
>> Of course readability is very subjective, so there really is no substitute
>> for each interested person just seeing how things look and giving their
>> opinion. The most trivial mechanical change might harm readability in ways
>> that can be improved with a little thought.
>
> Attached is a patch with "trivial mechanical change" (not properly
> formatted yet).
> To me it looks horrible. Does it make sense to invest more time in it?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unnest-hack_digit-single-param.patch
Type: text/x-patch
Size: 28989 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20140922/afe70cc3/attachment.bin>
More information about the Libc-alpha
mailing list