This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [patch match.pd c c++]: Ignore results of 'shorten_compare' and move missing patterns in match.pd


On 09/17/2015 03:12 AM, Richard Biener wrote:
I wonder if we'd do better to first add new match.pd patterns, one at a
time, with tests, and evaluating them along the way by looking at the
dumps
or .s files across many systems.  Then when we think we've got the right
set, then look at what happens to those dumps/.s files if we make the
changes so that shorten_compare really just emits warnings.


As the shorten_compare function covers those transformations, I don't
see that this is something leading to something useful.  As long as we
call shorten_compare on folding in FEs, we won't see those patterns in
ME that easy.  And even more important is, that patterns getting
resolved if function gets invoked.

It will tell you what will be missed from a code generation standpoint if
you disable shorten_compare.  And that is the best proxy we have for
performance regressions related to disabling shorten_compare.

ie, in a local tree, you disable shorten_compare.  Then compare the code we
generate with and without shorten compare.  Reduce to a simple testcase.
Resolve the issue with a match.pd pattern (most likely) and repeat the
process.  In theory at each step the  number of things to deeply investigate
should be diminishing while at the same time you're building match.pd
patterns and tests we can include in the testsuite. And each step is likely
a new patch in the patch series -- the final patch of which disables
shorten_compare.

It's a lot of work, but IMHO, it's necessary to help ensure we don't have
code generation regressions.

As said in the other reply I successfully used gcc_unreachable ()s in
code in intend to remove and then inspect/fix all fallout from that during
bootstrap & test ...

Yeah, it's a lot of work (sometimes).  But it's way easier than to investigate
code changes (which may also miss cases as followup transforms may end
up causing the same code to be generated).
That'd be a fine approach as well, though it may not work in this case as shorten_compare would get called prior to the transformations in match.pd. Though I would certainly agree in general that your approach is a good one.

jeff


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