[llvm-dev] [Proposal][RFC] Cache aware Loop Cost Analysis

Ehsan Amiri via llvm-dev llvm-dev at lists.llvm.org
Sat Oct 15 09:29:06 PDT 2016


On Thu, Jun 9, 2016 at 12:33 PM, Vikram TV <vikram.tarikere at gmail.com>
wrote:

>
>
> On Wed, Jun 8, 2016 at 10:56 PM, Ehsan Amiri <ehsanamiri at gmail.com> wrote:
>
>>
>> a. 1, if the reference is invariant with the innermost loop,
>>> b. TripCount for non-unit stride access,
>>> c. TripCount / CacheLineSize for a unit-stride access.
>>> Loop Cost is then calculated as the sum of the reference penalties times
>>> the product of the loop bounds of the outer loops. This loop cost can then
>>> be used as a profitability measure for cache reuse related optimizations.
>>> This is just a brief description; please refer to [1] for more details.
>>>
>>>
>>> <http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev>
>>>
>> I think you need finer granularity here. At least you need to distinguish
>> between stride-c (for some reasonable constant, say c = 2) access and
>> non-strided access as in indirect indexing (a[b[x]]) or otherwise
>> unpredictable index.
>>
> I think, 'c' should be <= CacheLineSize. I will have this as a to-do as
> only canonical loops are supported for now.
>
>
>
It seems that you are working on this again. So I thought to follow up on
this. I agree that the change that I asked could be done in a follow up
iteration. I don't understand what is the relation to canonical loops
though. IIUC, the patterns that I mentioned here can appear in a canonical
loop too.









>
> --
>
> Good time...
> Vikram TV
> CompilerTree Technologies
> Mysore, Karnataka, INDIA
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161015/92b5113b/attachment.html>


More information about the llvm-dev mailing list