On 03/25/2015 05:09 PM, Sebastian Pop wrote:
Specifically, it seems to me that copy_bbs should be refactored into
copy_bbs and copy_bbs_for_threading or somesuch. Where those
routines call into refactored common subroutines, but obviously
handle wiring up the outgoing edges from the copied blocks
differently.
That would be a good cleanup: I don't like to arbitrarily redirect edges in
copy_bbs just to redirect them back to their initial place in the caller.
Exactly.
The goal would be to eliminate the overly complex block copy/CFG
update scheme in tree-ssa-threadupdate.c as part of a larger project
to convert to a backward threader that can run independently of DOM.
I have a start of a patch for that cleanup, it currently runs wild as it would
replace the existing threadupdate code generator with a call to the new
duplicate_thread_path. I think we should take smaller more manageable steps to
ease the review and to not destabilize the jump-threader. In particular I think
we should have both code generators for a while and turn one on/off with an
option.
I hadn't planned on supporting both with an option, I'd rather make the
switch and not look back :-) An option just adds maintenance burdens
(supporting both approaches) and doesn't actually help the end users
(though it would help us as developers).
Regardless, probably the first step is a common API for the two path
duplication approaches.
Jeff