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]
Other format: [Raw text]

Re: [PATCH GCC][09/13]Simply cost model merges partitions with the same references


On Wed, Jun 14, 2017 at 2:54 PM, Richard Biener
<richard.guenther@gmail.com> wrote:
> On Mon, Jun 12, 2017 at 7:03 PM, Bin Cheng <Bin.Cheng@arm.com> wrote:
>> Hi,
>> Current primitive cost model merges partitions with data references sharing the same
>> base address.  I believe it's designed to maximize data reuse in distribution, but
>> that should be done by dedicated data reusing algorithm.  At this stage of merging,
>> we should be conservative and only merge partitions with the same references.
>> Bootstrap and test on x86_64 and AArch64.  Is it OK?
>
> Well, I'd say "conservative" is merging more, not less.  For example
> splitting a[i+1] from a[i]
> would be bad(?), so I'd see to allow unequal DR_INIT as "equal" for
Yes, cost model is missing here.  Given below loop:
{
  a[i] = x;
  a[i+1] = y;
}
It can't be vectorized of this form.  Simply merging with-cache-line
DR_INIT would partially corrupt distribution in hmmer, which makes the
whole work not that useful.  We need to estimate benefit of vectorizer
and cost of data locality somehow.  One idea is to pass cost (for
runtime alias check and data locality) in IFN_LOOP_DIST_ALIAS and let
vectorizer check the cost in unified way.
As for a[i]/a[i+1] case, it would be great if we can reorder
statements in fusion.  The net effect would be switching the two data
references.

> merging.  Maybe
> DR_INIT within a cacheline or so.
>
> How many extra distributions in say SPEC do you get from this change alone?
I will try to collect data.

>
> It shows also that having partition->reads_and_writes would be nice
> ...  the code duplication
> really looks awkward.  Eventually a EXECUTE_IF_IOR_IN_BITMAP would help as well.
>
> Well.  Can you at least factor out the core DR comparison into a function?
Will try to make simplification.

Thanks,
bin
>
> Otherwise ok.
>
> Thanks,
> Richard.
>
>> Thanks,
>> bin
>> 2017-06-07  Bin Cheng  <bin.cheng@arm.com>
>>
>>         * tree-loop-distribution.c (ref_base_address): Delete.
>>         (similar_memory_accesses): Rename ...
>>         (share_memory_accesses): ... to this.  Check if partitions access
>>         the same memory reference.
>>         (distribute_loop): Call share_memory_accesses.


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