This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] bb-reorder: Improve the simple algorithm for -Os (PR67864)
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 9 Oct 2015 11:08:20 -0500
- Subject: Re: [PATCH] bb-reorder: Improve the simple algorithm for -Os (PR67864)
- Authentication-results: sourceware.org; auth=none
- References: <c792164a9e6f8c4ba4db346c2df0e2341c73a3df dot 1444322573 dot git dot segher at kernel dot crashing dot org> <CAFiYyc3pioW-Xe0A1JXW2JPkcVbVecV784fHy7OP2yVRR0T5OQ at mail dot gmail dot com>
On Fri, Oct 09, 2015 at 11:29:16AM +0200, Richard Biener wrote:
> I think the patch makes sense but it also raises a question for me - how
> did we decide what edge gets EDGE_FALLTHRU when going out-of-cfglayout?
Good question. I think it just tries to make "natural" control flow; I'll
investigate.
> And isn't _that_ mechanism then not part of basic-block reordering that
> needs to be tweaked for choosing the EDGE_FALLTHRU as better?
Yes.
This patch uses the existing fallthrough for conditional branches, which
seems to work best; but it still can significantly improve on unconditional
branches. I'm sure there are better heuristics possible but I don't know
them (and actually *solving* the problem isn't even polynomial of course).
Segher