This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]