[Mono-devel-list] Removal of critical edges

Ben Maurer bmaurer at ximian.com
Tue Nov 16 21:50:21 EST 2004


Hey!

On Tue, 2004-11-16 at 21:42 +0100, Massimiliano Mantione wrote:
> I especially seek comments on the three commented lines in
> remove_critical_edges, what's the issue if those fields are
> not set?
+//					new_bb->real_offset = bb->real_offset;
It looks like this code is not used after we read the IL code. So, probably not needed.

+//					new_bb->region = bb->region;

region should == 0 in the code that you are doing, because you do not
handle exception clauses.

+//						jump->cil_code = bb->cil_code;
This is probably needed for debugging. But am not sure.

> Also, I know that bb will never end with a CEE_BR (the edge
> could not be critical), but I included it on the switch for
> completeness... maybe that switch could be turned into an
> utility that should complement the existing replace_out_block
> (which does not touch the bb code, and only works on out_bb).
> Does anybody think it would be better to factor that switch
> out in an utility function?

If you can reduce code duplication, it would be great. Maybe the basic
block level optimizations/transformations should be moved into a
separate file? I'd figure that a few more bb level optimizations are
going to be added (I have an old patch that I need to improve that
transforms if code into cmov and I have been wanting to write something
to find very rare bb's [ie, one that say throw new Exception ()] and
mark them as such, so that other optimizations can be smart about them).

> In any case, this code is debugged and seems correct, in the
> sense that it passes a 'make rcheck' with no regressions.

Did you try make bootstrap on a clean tree? I often catch more errors
this way.

-- Ben




More information about the Mono-devel-list mailing list