<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="">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 class=""><div class=""><br class=""></div><div class="">On Jun 9, 2016, at 6:16 PM, Xinliang David Li <<a href="mailto:davidxl@google.com" class="">davidxl@google.com</a>> wrote:<div class=""><div><blockquote type="cite" class=""><br class="Apple-interchange-newline"><div class=""><br class="Apple-interchange-newline"><br style="font-family: Helvetica; font-size: 10px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 10px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Thu, Jun 9, 2016 at 2:37 AM, Adam Nemet<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:anemet@apple.com" target="_blank" class="">anemet@apple.com</a>></span><span class="Apple-converted-space"> </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="HOEnZb"><div class="h5"><br class=""><br class="">Repository:<br class=""> <span class="Apple-converted-space"> </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></body></html>