This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH][6/n] Merge from match-and-simplify, make forwprop fold all stmts
- From: Jeff Law <law at redhat dot com>
- To: Richard Biener <rguenther at suse dot de>, gcc-patches at gcc dot gnu dot org
- Cc: Jakub Jelinek <jakub at redhat dot com>
- Date: Fri, 24 Oct 2014 11:48:18 -0600
- Subject: Re: [PATCH][6/n] Merge from match-and-simplify, make forwprop fold all stmts
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1410241429560 dot 9891 at zhemvz dot fhfr dot qr>
On 10/24/14 07:16, Richard Biener wrote:
This patch makes GIMPLE forwprop fold all statements, following
single-use SSA edges only (as suggested by Jeff and certainly
how this will regress the least until we replace manual
simplification code that does not restrict itself this way).
forwprop is run up to 4 times at the moment (once only for -Og,
not at all for -O0), which still seems reasonable. IMHO the
forwprop pass immediately after inlining is somewhat superfluous,
it was added there just for its ADDR_EXPR propagation. We should
eventually split this pass into two.
Note that just folding what we propagated into (like the SSA
propagators do during substitute-and-fold phase) will miss
cases where we propagate into a stmt feeding the one we could
simplify. Unless we always fold all single-use (and their use)
stmts we have to fold everything from time to time. Changing
how / when we fold stuff is certainly sth to look after with
fold_stmt now being able to follow SSA edges.
Bootstrapped on x86_64-unknown-linux-gnu, testing still in progress.
From earlier testing I remember I need to adjust a few testcases
that don't expect the early folding - notably two strlenopt cases
(previously XFAILed but then PASSed again).
I also expect to massage the single-use heuristic as I get to
merging the patterns I added for the various forwprop manual
pattern matchings to trunk (a lot of them do not restrict themselves
Does this otherwise look ok?
2014-10-24 Richard Biener <firstname.lastname@example.org>
* tree-ssa-forwprop.c: Include tree-cfgcleanup.h and tree-into-ssa.h.
(lattice): New global.
(fwprop_ssa_val): New function.
(pass_forwprop::execute): Finally fold all stmts.
Seems reasonable. After all, we can iterate on the single-use heuristic.