[v3 PATCH] Use single-visitation in variant assignment and swap.

Jonathan Wakely jwakely@redhat.com
Mon Apr 1 11:55:00 GMT 2019


On 01/04/19 12:52 +0300, Ville Voutilainen wrote:
>On Mon, 1 Apr 2019 at 11:45, Ville Voutilainen
><ville.voutilainen@gmail.com> wrote:
>>
>> On Sat, 30 Mar 2019 at 20:00, Ville Voutilainen
>> <ville.voutilainen@gmail.com> wrote:
>> >
>> > This patch makes assignments correct, because they need to
>> > match indices instead of types. In addition, we cut down the
>> > codegen size. The symbols are longer than before, the the amount
>> > of them is roughly the same, so there's no longer an explosion
>> > in their amount.
>> >
>> > Relops are the last bit in these fixes, I'll fix them during the weekend.
>>
>> Here. This does produce 17 symbols instead of 9 for a test with a
>> single operator== comparison.
>> But it's not 47 like it is with the code before this patch.
>
>Jonathan: I consider this good enough to ship; it doesn't explode the
>symbols too much and
>nicely gets rid of half of the runtime ifs for valueless state and
>index. That's really the perf bonus that visitation
>buys, and for swap and relops there is less need to do other
>inquiries, although there is that
>check for same-index, which is now a run-time check between a
>completely-runtime value
>and a compile-time constant as opposed to a run-time check between two
>completely-runtime
>values. Later, as a possible optimization, we can see whether swap and
>relops can be made
>to use a different generated jump table with just maybe twelve
>entries, and if we can dispatch
>into it without other additional branches, which I'm not entirely sure we can.

Yes, this is a very satisfactory improvement in codegen.




More information about the Libstdc++ mailing list