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

Ehsan Amiri via llvm-dev llvm-dev at lists.llvm.org
Wed Jun 8 10:26:28 PDT 2016

> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160608/5a17eb12/attachment.html>

More information about the llvm-dev mailing list