This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Simple recompute_reg_usage cleanup


> It can be nice to have ability to calculate "expected number of executions"
> for each basic block and each edge and use it as base for register allocation
> and other optimizations.

Yes.
...
> To implement such more general scheme in future we ought to switch from current LOOP scheme
> anyway.

I don't see why the current loop notes cannot play a part in a future scheme
that can detect natural loops and knows more about execution / branch
probabilities.

> Maybe it can be safer to let frontends emit EXPECTED_EXECUTIONS note to each basic blocks.

I can't see what makes you think that these numbers would be easier to
maintain than information about flow graph egdes.  And edges give more details
than basic blocks - and these details can be relevant to optimizations.

> Issue is, htat it would be probably much better to maitain such info
> for edges of flowgraph.. I don't see clean way how to do it with our current
> scheme of disturbing flowgraph in early passes.

Why can't you just propagate the probabilities as you make the transformations?
Of course when you copy code - like the loop exit test code - you have to
somehow derive several new numbers from one old one, but that should not
really be more difficult than to arrive at the initial numbers.
E.g. when you handle a loop exit test copy and and the only information is
that it was originaly a loop, you use some heuristics.
If you have profiling information, the profile will probably apply to the
code with the exit test already copied.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]