[PATCH] Hot/cold partitioning fixes

Steven Bosscher stevenb@suse.de
Thu Mar 17 18:56:00 GMT 2005


On Thursday 17 March 2005 19:28, Zack Weinberg wrote:
> Richard Henderson <rth@redhat.com> writes:
> > On Tue, Mar 15, 2005 at 10:27:17AM -0800, Zack Weinberg wrote:
> >> This is an area I don't know enough about.  I'm cc:ing Richard
> >> Henderson in hopes that he can assess what is and is not safe here.
> >
> >   if (flag_var_tracking)
> >     rest_of_handle_variable_tracking ();
> >
> >   /* CFG is no longer maintained up-to-date.  */
> >   free_bb_for_insn ();
> >
> >   if (targetm.machine_dependent_reorg != 0)
> >     rest_of_handle_machine_reorg ();
>
> That would dispose of the possibility of using nothing but CFG flags,
> then.  And it would suggest that creating marker notes at the point
> Caroline's patch does it, is not reliable (since the CFG may have been
> mangled before we get there).


IMHO our not-too-long-term goal should be to preserve the CFG longer.

The number of passes making this not feasible right now is really 
very small: Really just reorg and shorten-branches (?), and some
machine dependent reorgs (but some targets, for example ia64, *need*
the CFG in their machine reorg).

We could make reorg do what the old loop optimizer does: destroy the
CFG and reconstruct it after the pass.  For the machine reorgs we
could do the same, and add a target hook for targets for which you
don't need to destroy/reconstruct the CFG (i.e. have two targets hooks,
say machine_dependent_reorg_noflow and machine_dependent_reorg...)

> However, I don't trust reorg not to 
> move marker notes around.  Ideas?

You'd just disable hot/cold partitioning for targets that need to
destroy and reconstruct the CFG. 

Gr.
Steven



More information about the Gcc-patches mailing list