This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix PR rtl-optimization/34035
> With cleanup_cfg(0) you add another delete_trivially_dead_insns()
> pass, and three iterations over all basic blocks. This does seem, at
> first, to be quite cheap. The problem is that we do it all over the
> place when it actually doesn't buy you anything: The "good" rtl passes
> look through the dead code that d_t_d_i can remove, and even the
> semi-good passes don't care about an extra forwarder block or a
> single_succ block here and there.
cleanup_cfg (0) is the canonical invocation to minimally clean up the CFG at
the end of the RTL passes. It is already run at the end of every CSE and
GCSE pass if a single jump is modified. We now also invoke it on demand in,
I believe, relatively rare cases.
> IMO much of gcc's abysmal compile time performance can be blamed on
> doing redundant work all over the place, trying hard for little gain.
> Sorry to jump on your patch like this, but it just looks like
> "obvious" redundant cfg cleanup work (bikeshed, bikeshed! ;-)
I don't think cleanup_cfg (0) is "trying hard"; otherwise tree optimization
passes shouldn't be allowed to set TODO_cleanup_cfg. That being said, if you
can come up with a testcase, I'll revise my position. Of course don't try
with C, C++ or Fortran, the change only affects those languages for which
-fnon-call-exceptions is set, e.g. Ada that I specially care about.
--
Eric Botcazou