On 07/18/2016 06:34 PM, Segher Boessenkool wrote:

+  /* The frequency of executing the prologue for this BB and all BBs
+     dominated by it.  */
+  gcov_type cost;

Is this frequency consideration the only thing that attempts to prevent
placing prologue insns into loops?

Yes.  The algorithm makes sure the prologues are executed as infrequently
as possible.  If a block that would get a prologue has the same frequency
as a predecessor does, and that predecessor always has that first block as
eventual successor, the prologue is moved to the earlier block (this
handles the case where both have a frequency of zero, and other cases
where the range of freq is too limited).

Ugh, that is really scaring me. I'd much prefer a classification of valid blocks based on cfg structure alone - I'll need serious convincing that the frequency data is reliable enough for what you are trying to do.


Bernd

Reply via email to