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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2021-11-23 00:00:00         |2022-1-18
             Status|NEW                         |ASSIGNED

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Re-confirmed.(In reply to Jeffrey A. Law from comment #3)
> 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.

So I think at least this should be possible, no?  Also why do we need to
do extra limitation?  We should end up accounting for B's size N times
without the optimization so the costing is still accurate, no?

So IMHO the scaling factors do not make much sense to me, they were introduced
to fix PR68398.

We need --param fsm-scale-path-stmts=1 to get the desired threading done.

Reply via email to