[Patch PR44576]: Don't do further analysis if we could know prefetching is not benefitial

Sebastian Pop sebpop@gmail.com
Fri Jul 9 23:12:00 GMT 2010


On Fri, Jul 9, 2010 at 02:53, Zdenek Dvorak <rakdver@kam.mff.cuni.cz> wrote:
> Hi,
>
>> Some prefetch analysis (e.g.  miss rate and dependence computations for reuse analysis) has
>> been known to be expansive. We should avoid un-necessary analysis whenever possible.
>>
>> In this patch, we split the cost model implementing function (is_loop_prefetching_profitable) into
>> three small functions (trip_count_to_ahead_ratio_too_small_p, mem_ref_count_reasonable_p and
>> insn_to_prefetch_ratio_too_small_p), with each one called at the earliest possible time.  In
>> this way, we can reduce the compilation time.
>>
>> In this patch, we also introduce a new parameter, PREFETCH_MAX_MEM_REFS_PER_LOOP.
>> We give up prefetching if the number of memory references in a loop is above this threshold.
>> This is based on both compilation time and memory consumption considerations. We found
>> that the memory allocation and freeing of data dependence relation (for reuse analysis) will become
>> the bottleneck if there is too many memory references in the loop.
>>
>> This patch passed bootstrapping and completely fixed bug 44576.
>>
>> Is it OK for the trunk?
>
> OK.
>

Committed r162023: a slightly modified version of the approved patch,
correcting minor style problems, and Changpeng also added a check for
"time == 0", see the attached patch.

Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-pr44576-Avoid-un-necessary-prefetch-analysis-by-dist.patch
Type: text/x-patch
Size: 12137 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100709/4d60f1a1/attachment.bin>


More information about the Gcc-patches mailing list