<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>a. 1, if the reference is invariant with the innermost loop,</div><div>b. TripCount for non-unit stride access,</div><div>c. TripCount / CacheLineSize for a unit-stride access.</div><div>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.</div><div><br></div><br></div><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank"></a><br></blockquote></div>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.</div></div>