<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 9, 2016 at 12:33 PM, Vikram TV <span dir="ltr"><<a href="mailto:vikram.tarikere@gmail.com" target="_blank">vikram.tarikere@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Wed, Jun 8, 2016 at 10:56 PM, Ehsan Amiri <span dir="ltr"><<a href="mailto:ehsanamiri@gmail.com" target="_blank">ehsanamiri@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><span><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></span><span>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.</span></div></div></blockquote></div></div><div>I think, 'c' should be <= CacheLineSize. I will have this as a to-do as only canonical loops are supported for now.</div></div><span class=""><br><br clear="all"></span></div></div></blockquote><div><br></div><div>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.<br><br><br></div><div><br><br><br><br><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><span class=""><div><br></div>-- <br><div class="m_-5829660953192637518gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><br></div><div>Good time...</div><div>Vikram TV</div><div>CompilerTree Technologies</div><div>Mysore, Karnataka, INDIA</div></div></div></div></div>
</span></div></div>
</blockquote></div><br></div></div>