pr44576 Avoid un-necessary prefetch analysis by distributing the cost models
authorChangpeng Fang <changpeng.fang@amd.com>
Fri, 9 Jul 2010 23:08:55 +0000 (23:08 +0000)
committerSebastian Pop <spop@gcc.gnu.org>
Fri, 9 Jul 2010 23:08:55 +0000 (23:08 +0000)
commit0bbe50f6b473e6857777cf9932773accd3cbb0c5
tree08a6ff064dc82642939db19bcd80abf31bc265a6
parent95da5cf9177a915c6c015468b822e402293dcf5e
pr44576 Avoid un-necessary prefetch analysis by distributing the cost models

2010-07-09  Changpeng Fang  <changpeng.fang@amd.com>

PR tree-optimization/44576
* tree-ssa-loop-prefetch.c (trip_count_to_ahead_ratio_too_small_p):
New.  Pull out from is_loop_prefetching_profitable to implement
the trip count to ahead ratio heuristic.
(mem_ref_count_reasonable_p): New.  Pull out from
is_loop_prefetching_profitable to implement the instruction to
memory reference ratio heuristic.  Also consider not reasonable if
the memory reference count is above a threshold (to avoid
explosive compilation time.
(insn_to_prefetch_ratio_too_small_p): New.  Pull out from
is_loop_prefetching_profitable to implement the instruction to
prefetch ratio heuristic.
(is_loop_prefetching_profitable): Removed.
(loop_prefetch_arrays): Distribute the cost analysis across the
function to allow early exit of the prefetch analysis.
is_loop_prefetching_profitable is splitted into three functions,
with each one called as early as possible.
(PREFETCH_MAX_MEM_REFS_PER_LOOP): New.  Threshold above which the
number of memory references in a loop is considered too many.

From-SVN: r162023
gcc/ChangeLog
gcc/tree-ssa-loop-prefetch.c