<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 9, 2016, at 10:28 PM, Xinliang David Li <<a href="mailto:davidxl@google.com" class="">davidxl@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Thu, Jun 9, 2016 at 1:01 PM, Adam Nemet <span dir="ltr" class=""><<a href="mailto:anemet@apple.com" target="_blank" class="">anemet@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">David, FYI, this didn’t make it to Phab due to replying inline.<div class=""><br class=""></div><div class="">Anyhow, we could move the map of stride collection to LAA.  I didn’t do that initially as a shortcut but I can look into doing that, just LMK.</div></div></blockquote><div class=""><br class=""></div><div class=""><br class=""></div><div class="">I have not looked in detail, but looks like client code have different ways to collect strides: see LoopVectorizor and LoopVersioningLICM.    How do you plan to handle this?</div></div></div></div></div></blockquote><div><br class=""></div><div>The two functions look identical except that LV also exposes the strides as a set.</div><div><br class=""></div><div>To further clarify the plan should be to have LAA collect the symbolic strides and then have LoopVersioning emit the run-time checks and rewrite the versioned loop (instead of LoopVersioningLICM).</div><div><br class=""></div><div>LV would have to continue to emit the run-time checks itself because it does not yet use LoopVersioning.</div><div><br class=""></div><div>Adam</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class=""></div><div class="">David</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class="h5"><div class=""></div><div class="">On Jun 9, 2016, at 6:16 PM, Xinliang David Li <<a href="mailto:davidxl@google.com" target="_blank" class="">davidxl@google.com</a>> wrote:<div class=""><div class=""><blockquote type="cite" class=""><br class=""><div class=""><br class=""><br style="font-family:Helvetica;font-size:10px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><div class="gmail_quote" style="font-family:Helvetica;font-size:10px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">On Thu, Jun 9, 2016 at 2:37 AM, Adam Nemet<span class=""> </span><span dir="ltr" class=""><<a href="mailto:anemet@apple.com" target="_blank" class="">anemet@apple.com</a>></span><span class=""> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">anemet added inline comments.<br class=""><span class=""><br class="">================<br class="">Comment at: llvm/trunk/include/llvm/Analysis/LoopAccessAnalysis.h:704-706<br class="">@@ +703,5 @@<br class="">+private:<br class="">+  /// \brief LoopAccessInfo is created on demand. This map caches<br class="">+  /// the computed results.<br class="">+  DenseMap<Loop *, std::unique_ptr<LoopAccessInfo>> LoopAccessInfoMap;<br class="">+<br class="">----------------<br class=""></span><span class="">chandlerc wrote:<br class="">> This doesn't seem like the right design. It leads to the `getInfo().getInfo()` awkward pattern that IMO is only marginally less awkward spelled as `getResult().getInfo()`.<br class="">><br class="">> Instead, I think this pretty clearly wants to be a Loop analysis in the new pass manager. I think that the caching and map should be the new pass manager's caching and map, rather than rolling our own in a function analysis manager.<br class="">><br class="">> As a consequence, I don't think you need this result type at all. I think the LoopAccessInfo is already the correct result type. I think you'll need the DenseMap and logic around it in the legacy pass manager's function analysis, and you'll want a different query path to use the LoopAnalysisManager directly in the new pass manager.<br class="">><br class="">> Does that make sense?<br class=""></span>Just for the record, this had to be a function pass because the loop vectorizer is a function pass with the legacy PM.<br class=""></blockquote><div class=""><br class=""></div><div class=""><br class=""></div><div class="">This problem is solvable by providing a function level wrapper for loop access info.</div><div class=""><br class=""></div><div class="">The bigger problem is that the current getter interface not only takes a  LoopInfo, but also a map of strides which is computed outside.  IIUC, current analysis manager in new PM can not handle that.  Chandler, any thought? Should we make LoopAccess Analysis a function analysis for now and handle it later when Loop analysis is more mature?</div><div class=""><br class=""></div><div class="">David</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br class="">It would be great to turn this into a loop pass with the new PM.<br class=""><div class=""><div class=""><br class=""><br class="">Repository:<br class=""> <span class=""> </span>rL LLVM<br class=""><br class=""><a href="http://reviews.llvm.org/D20560" rel="noreferrer" target="_blank" class="">http://reviews.llvm.org/D20560</a></div></div></blockquote></div></div></blockquote></div><br class=""></div></div></div></div></blockquote></div><br class=""></div></div>
</div></blockquote></div><br class=""></body></html>