This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Allow FSM to thread single block cases too
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: Jeff Law <law at redhat dot com>, Jan Hubicka <hubicka at ucw dot cz>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 14 Oct 2015 17:43:41 +0200
- Subject: Re: [PATCH] Allow FSM to thread single block cases too
- Authentication-results: sourceware.org; auth=none
- References: <561CF734 dot 7090802 at redhat dot com> <CAFiYyc05ZbhMHAfaP1u39L_c8jWQA6rchoqD2z2Sm8Z0ObwmjQ at mail dot gmail dot com> <CAFiYyc368RDUDebLVff0C1PhyvPiOnvxHwcj_j0Z8XFZOwzUTw at mail dot gmail dot com> <561E4DAD dot 9060702 at redhat dot com> <CAFiYyc37QvGeKJGc_LQNYXOs=vQh4qZXGAns+W+E+jcc3=Zvpw at mail dot gmail dot com>
> >>> I think he asked for trivial forward threads though due to repeated
> >>> tests.
> >>> I hacked FRE to do this (I think), but maybe some trivial cleanup
> >>> opportunities
> >>> are still left here. Honza?
Well, unthreaded jumps quite confuse profile prediction and create profiles
that we can't fix later. An of course they count in time (and size sometimes)
estimates.
>From cases I commonly see it is the usual lazyness of repeated tests comming
from early inlining/macro expansion and also C++ love to introduce
if (ptr != NULL)
ptr2 = &ptr->foo;
else
ptr2 = NULL
for instances of multiple inheritance. usually ptr is known to be non-NULL.
And also cases where if is uses to check individual cases without having proper
esles.
Honza
> >>
> >>
> >> This or other related patches in the range r228731:228774 has caused a
> >> quite
> >> big jump in SPEC CPU 2000 binary sizes (notably 176.gcc - so maybe
> >> affecting
> >> bootstrap as well, at -O3). Are you sure this doesn't re-introduce DOM
> >> effectively peeling all loops once?
> >
> > It's possible. I've actually got a patch in overnight testing that
> > introduces some of the heuristics to avoid mucking up loops to the FSM bits.
>
> Like never threading a loop exit test to the loop header (but only to the exit).
> At least if it is the only exit in the loop (but maybe better for all exits).
>
> Richard.
>
> > jeff
> >