[pretty-ipa] Empty cleanup EH regions removal

Jan Hubicka hubicka@ucw.cz
Fri Mar 27 18:26:00 GMT 2009


> On Fri, Mar 27, 2009 at 5:58 PM, Jan Hubicka <hubicka@ucw.cz> wrote:
> > Hi,
> > implicitly generated cleanup regions for destructors have tendency to be both
> > numberous and often completely optimized out.  This patch adds code to detect
> > empty cleanup block and remove it from Eh tree.  On tramp3d, we remove this way
> > about 1400 blocks that in addition leads to removal of couple hounderd
> > MUST_NOT_THROW terminate() receivers and simplification of CFG.
> >
> > Bootstrapped/regtested x86_64-linux, will commit it to pretty-ipa shortly..
> 
> cleanup_empty_eh needs documenting.  Adding this to cleanup_cfg looks
> expensive.  Can you add some statistics and see whether it triggers more
> often that once per inline?  Thus, I'd rather make it a new pass and call it
> after early and regular inlining.

I am having cleanup_eh pass in my tree, but there are some ordering
issues here.

In most cases removing this EH region leads to redirecting everything to
MUST_NOT_THROW that is handled by runtime, thus previously
can_throw_internal are no longer can_throw_internal and we eliminate
EH edges from everything contained in the removed region.
This allows a lot more cleanups.

So when I was doing this once at the end of early optimization, I got
just 1000 removed blocks, so doing stuff earlier in queue seems better.

Now I get 1000 at ccp1 pass, 400 at copyprop and 4 at dse1...
Tramp3d is not terribly sophisficated testcase as it comes to EH.

I am not that opposed to have it as separate pass, just it will need to
run several times in the queue and in general it is equivalent to jump
forwarding just on EH tree..

Honza



More information about the Gcc-patches mailing list