This is the mail archive of the gcc@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]
Other format: [Raw text]

postreload-gcse heuristics broken?


Hello,

the heuristics used in eliminate_partially_redundant_load
(postreload-gcse.c) to decide whether or not eliminating
a redundancy appears to be seriously broken.  It tests

  /* Check if it's worth applying the partial redundancy elimination.  */
  if (ok_count < GCSE_AFTER_RELOAD_PARTIAL_FRACTION * not_ok_count)
    goto cleanup;
  if (ok_count < GCSE_AFTER_RELOAD_CRITICAL_FRACTION * critical_count)
    goto cleanup;

where the counts are accumulated edge->count values, e.g.

      if (EDGE_CRITICAL_P (pred))
        critical_count += pred->count;

Unfortunately it would appear that unless profile-directed
feedback is being used, edge->count is always zero!

Thus the check above always reduced to 0 < 0, and therefore
*every possible* redundancy elimination is performed, resulting
in much worse code than before in some cases.

Any suggestions how the heuristics can be fixed in the
absence of profile data?  Otherwise, I'd suggest to make
the pass conditional on profile-directed feedback ...

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  Linux on zSeries Development
  Ulrich.Weigand@de.ibm.com


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