https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103388

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |law at gcc dot gnu.org

--- Comment #3 from Jeffrey A. Law <law at gcc dot gnu.org> ---
So to fix this right we'd need to duplicate some of the logic in
tree-ssa-threadupdate.c.  Conceptually for block B where one or more
predecessors thread to target T, you make a single copy B', and redirect *all*
the relevant predecessors to B'.

In addition to allowing more aggressive threading, it would also reduce
codesize since currently we'll end up with multiple copies of B'.  We have
optimizers that are supposed to clean that up, but I've never seen them do a
particularly good job.

This isn't likely to land in gcc-12.

An interim approach might be to go ahead and register the thread and only
reject it for size later if we're going to end up with multiple copies.  After
all this is a cost analysis question and we don't know until all the paths are
registered if it's profitable or not.

Anyway, it should probably be assigned to me.  Not sure if I'll get to the
interim approach or not for gcc-12.  I'll have to poke around a bit.

Reply via email to