<div dir="ltr">The memory effects design is ever so slightly orthogonal to alias analysis. I've been largely following along to the discussion on alias analysis in LLVM to determine how we should model it in MLIR. There are obviously some different things to consider, especially given that MLIR needs to be a bit more general(from an infrastructure standpoint, and not necessarily an algorithmic standpoint). What is in-tree right now for aliasing, i.e. resources, is really more of a placeholder than a long term solution. Would love to chat sometime though. I've just been waiting for the alias redesign discussions in LLVM to get a bit further before jumping in.<div><br></div><div>-- River</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 24, 2020 at 1:47 PM Chris Lattner via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><br></div>Thanks for sharing this Hal.<div><br></div><div>Random thought - with the goal of increasing cross-pollination, it might be useful to invite someone from the MLIR world who has been working on it MemoryEffects design to give a talk or share some thoughts.  It is a more general and quite different approach than LLVM’s alias analysis implementation.<div><br></div><div>It looks like River, Mehdi, Lei, and Jacques have all been involved in it, but I don’t know to what level.</div><div><br></div><div>-Chris<br><div><br><blockquote type="cite"><div>On Jun 24, 2020, at 8:33 AM, Finkel, Hal J. via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br><div><div style="font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">Hi, everyone,</div><div style="font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><div style="font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">We had a great call last month, and progress is definitely being made on several fronts. The notes from our last call are available here:</div><div style="font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">  <a href="https://docs.google.com/document/d/1ybwEKDVtIbhIhK50qYtwKsL50K-NvB6LfuBsfepBZ9Y/edit#heading=h.vpxs8lkuxy79" id="gmail-m_2480859393935719847gmail-m_7488617652282575495LPlnk603524" target="_blank">https://docs.google.com/document/d/1ybwEKDVtIbhIhK50qYtwKsL50K-NvB6LfuBsfepBZ9Y/edit#heading=h.vpxs8lkuxy79</a></div><div style="font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><div style="font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">and, also, pasted below.</div><div style="font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><div style="font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">DOODLE POLL:</div><div style="font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">As we discussed on our last call, I would like to schedule a regular call to discuss alias-analysis issues within LLVM. I've put together an initial Doodle poll to pick a time for this call: <a href="https://doodle.com/poll/9iqfaqttvvic5rfp" id="gmail-m_2480859393935719847gmail-m_7488617652282575495LPlnk462928" target="_blank">https://doodle.com/poll/9iqfaqttvvic5rfp</a></div><div style="font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><div style="font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">Please fill out this poll with the understanding that the meeting will recur every four weeks. If you're interested in participating, but none of the times on the poll would work for you, please let me know.</div><div style="font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><div style="font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">Notes from our last call:</div><div style="font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><div style="font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">****</div><div style="font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><div style="font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><b style="font-weight:normal"><ul style="margin-top:0px;margin-bottom:0px"><li dir="ltr" style="font-size:11pt;font-family:Arial;font-weight:400"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span style="font-size:12pt;font-family:Calibri,sans-serif">Scalability challenges and other issues discovered with the current infrastructure (especially, perhaps, with the noalias metadata).<br></span></div></li><ul style="margin-top:0px;margin-bottom:0px"><li dir="ltr" style="list-style-type:circle;font-size:12pt;font-family:Calibri,sans-serif;font-weight:400"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span>Issue #1: MDNode::intersect uses O(n^2) algorithm. The operation does not scale for large NoAlias sets.</span></div></li><li dir="ltr" style="list-style-type:circle;font-size:12pt;font-family:Calibri,sans-serif;font-weight:400"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span>Issue #2: ScopedNoAliasAAResult::mayAliasInScopes includes overhead (per query) of partitioning the input set based on the domain metadata.</span></div></li><li dir="ltr" style="list-style-type:circle;font-size:12pt;font-family:Calibri,sans-serif;font-weight:400"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span>Issue #3: Memory footprint of the flattened Alias.Scope or NoAlias set can be large.</span></div></li><li dir="ltr" style="list-style-type:circle;font-size:12pt;font-family:Calibri,sans-serif;font-weight:400"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span>Issue #4: correctness: current implementation has problems after inlining in a loop.  </span></div></li></ul></ul><br><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38;margin-left:36pt"><span style="font-size:12pt;font-family:Calibri,sans-serif;font-weight:400">Notes:</span></div><ul style="margin-top:0px;margin-bottom:0px"><li dir="ltr" style="font-size:12pt;font-family:Calibri,sans-serif;font-weight:400;margin-left:72pt"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span>Jeroen notes that he has not observed scalability issues with the<span> </span></span><span><br></span><span>“full restrict” implementation.</span></div></li><li dir="ltr" style="font-size:12pt;font-family:Calibri,sans-serif;font-weight:400;margin-left:72pt"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span>Michael notes that part of the scalability challenge comes from the fact that the noalias scheme marks all those things with which you don’t alias, but for restrict-like pointers, that’s the default for everything in that scope.</span></div></li><li dir="ltr" style="font-size:12pt;font-family:Calibri,sans-serif;font-weight:400;margin-left:72pt"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span>Tarique notes that there may still be a need for AA from the frontend, e.g., for Fortran, above what the C-like restrict provides.</span></div></li><li dir="ltr" style="font-size:12pt;font-family:Calibri,sans-serif;font-weight:400;margin-left:72pt"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span>Eric asks if anyone is considering a ground-up design to support Fortran?</span></div></li><ul style="margin-top:0px;margin-bottom:0px"><li dir="ltr" style="list-style-type:circle;font-size:12pt;font-family:Calibri,sans-serif;font-weight:400;margin-left:72pt"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span>Troy notes that we would prefer one representation to cover Fortran, C, etc. Fortran is, in some sense, simpler than C/C++. Also notes that language-specific AA can be a useful technique as well.</span></div></li><li dir="ltr" style="list-style-type:circle;font-size:12pt;font-family:Calibri,sans-serif;font-weight:400;margin-left:72pt"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span>Johannes notes that other languages, e.g., Rust, can also benefit, and we might need something where we can have universes, negated aliasing edges, etc.</span></div></li><li dir="ltr" style="list-style-type:circle;font-size:12pt;font-family:Calibri,sans-serif;font-weight:400;margin-left:72pt"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span>Michael notes that we can chain AA, and so it’s possible to have something more domain specific.</span></div></li><li dir="ltr" style="list-style-type:circle;font-size:12pt;font-family:Calibri,sans-serif;font-weight:400;margin-left:72pt"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span>Hal notes that if we have language-specific MD, we need to figure out how to maintain it (otherwise, all of the passes will drop it, but maintaining it means that enough of the semantics must be available). Jeroen notes that reusing in-tree passes maximally reuses correct implementation in combination with loop unrolling, etc.</span></div></li></ul></ul><br><ul style="margin-top:0px;margin-bottom:0px"><li dir="ltr" style="font-size:11pt;font-family:Arial;font-weight:400"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span style="font-size:12pt;font-family:Calibri,sans-serif">Proposed solutions: progress, outstanding challenges, how to make progress going forward.<br></span></div></li><ul style="margin-top:0px;margin-bottom:0px"><li dir="ltr" style="list-style-type:circle;font-size:12pt;font-family:Calibri,sans-serif;font-weight:400"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span>Proposal #1: (Related to both Issue #1 and Issue #2) In the MDNode class, pre-partition the set of Metadata operands where each partition is an ordered set of Metadata operands belonging to a specific domain.</span></div></li><li dir="ltr" style="list-style-type:circle;font-size:12pt;font-family:Calibri,sans-serif;font-weight:400"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span>Proposal #2: (Related to Issue #3) Design a hierarchical representation for the metadata operands in Alias.Scope and NoAlias sets.</span></div></li><li dir="ltr" style="list-style-type:circle;font-size:12pt;font-family:Calibri,sans-serif;font-weight:400"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span>Proposal #3:<span> </span></span><a href="https://reviews.llvm.org/D68484" target="_blank"><span style="color:rgb(17,85,204);text-decoration:underline">https://reviews.llvm.org/D68484</span></a><span><span> </span>provides the infrastructure to fix issue #4. It might also help with issue #1 and issue #3 as it makes it possible to share scopes.<br></span></div></li></ul></ul><br><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span style="font-size:12pt;font-family:Calibri,sans-serif;font-weight:400">Notes</span></div><br><ul style="margin-top:0px;margin-bottom:0px"><li dir="ltr" style="font-size:12pt;font-family:Calibri,sans-serif;font-weight:400"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span>Tarique presented challenges with the current prototype, including that there’s currently no way to differentiate noalias MD from other kinds of metadata, so it’s hard to keep a useful cache in the generic MDNode implementation.</span></div></li><li dir="ltr" style="font-size:12pt;font-family:Calibri,sans-serif;font-weight:400"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span>Jeroen presented some slides on the full-restrict implementation, noted how this scheme might solve/mitigate some of the scalability challenges associated with the pure-metadata solution.</span></div></li><li dir="ltr" style="font-size:12pt;font-family:Calibri,sans-serif;font-weight:400"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span>The full-restrict implementation is being used, and Jerone is currently updating this implementation based on feedback from that usage, he also will update the implementation to use provenance instead of sidechannel and repost.</span></div></li><li dir="ltr" style="font-size:12pt;font-family:Calibri,sans-serif;font-weight:400"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span>Johannes notes that we need more reviewers for this patch set.</span></div></li></ul></b><br></div><div style="font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><div style="font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">****</div><div style="font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><div style="font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">Thanks again,</div><div style="font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">Hal</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><div id="gmail-m_2480859393935719847gmail-m_7488617652282575495Signature"><div><div><font size="2"><span style="font-size:10pt"><div>Hal Finkel<br>Lead, Compiler Technology and Programming Languages<br>Leadership Computing Facility<br>Argonne National Laboratory</div></span></font></div></div></div></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div id="gmail-m_2480859393935719847gmail-m_7488617652282575495appendonsend"></div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><hr style="display:inline-block;width:869.25px"><div id="gmail-m_2480859393935719847gmail-m_7488617652282575495divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt"><b>From:</b><span> </span>llvm-dev <<a href="mailto:llvm-dev-bounces@lists.llvm.org" target="_blank">llvm-dev-bounces@lists.llvm.org</a>> on behalf of Finkel, Hal J. via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>><br><b>Sent:</b><span> </span>Thursday, May 28, 2020 7:35 AM<br><b>To:</b><span> </span>Jeroen Dobbelaere <<a href="mailto:Jeroen.Dobbelaere@synopsys.com" target="_blank">Jeroen.Dobbelaere@synopsys.com</a>>; Alina Sbirlea <<a href="mailto:alina.sbirlea@gmail.com" target="_blank">alina.sbirlea@gmail.com</a>><br><b>Cc:</b><span> </span><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><span> </span><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>>; Doerfert, Johannes <<a href="mailto:jdoerfert@anl.gov" target="_blank">jdoerfert@anl.gov</a>><br><b>Subject:</b><span> </span>Re: [llvm-dev] LLVM Alias Analysis Technical Call - Doodle Poll</font><div> </div></div><div dir="ltr"><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">Hi, everyone,</div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">Just a quick reminder, this call starts in approximately 1.5 hours.</div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">At the present time, our agenda has:</div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><b style="font-weight:normal"><ul style="margin-top:0px;margin-bottom:0px"><li dir="ltr" style="font-size:11pt;font-family:Arial;font-weight:400"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span style="font-size:12pt;font-family:Calibri,sans-serif">Scalability challenges and other issues discovered with the current infrastructure (especially, perhaps, with the noalias metadata).</span></div></li><ul style="margin-top:0px;margin-bottom:0px"><li dir="ltr" style="list-style-type:circle;font-size:12pt;font-family:Calibri,sans-serif;font-weight:400"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38">Issue #1: MDNode::intersect uses O(n^2) algorithm. The operation does not scale for large NoAlias sets.<br></div></li><li dir="ltr" style="list-style-type:circle;font-size:12pt;font-family:Calibri,sans-serif;font-weight:400"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span>Issue #2: ScopedNoAliasAAResult::mayAliasInScopes includes overhead (per query) of partitioning the input set based on the domain metadata.</span></div></li><li dir="ltr" style="list-style-type:circle;font-size:12pt;font-family:Calibri,sans-serif;font-weight:400"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span>Issue #3: Memory footprint of the flattened Alias.Scope or NoAlias set can be large.</span></div></li><li dir="ltr" style="list-style-type:circle;font-size:12pt;font-family:Calibri,sans-serif;font-weight:400"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span>Issue #4: correctness: current implementation has problems after inlining in a loop.  </span></div></li></ul><li dir="ltr" style="font-size:11pt;font-family:Arial;font-weight:400"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span style="font-size:12pt;font-family:Calibri,sans-serif">Proposed solutions: progress, outstanding challenges, how to make progress going forward.</span></div></li><ul style="margin-top:0px;margin-bottom:0px"><li dir="ltr" style="list-style-type:circle;font-size:12pt;font-family:Calibri,sans-serif;font-weight:400"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38">Proposal #1: (Related to both Issue #1 and Issue #2) In the MDNode class, pre-partition the set of Metadata operands where each partition is an ordered set of Metadata operands belonging to a specific domain.<br></div></li><li dir="ltr" style="list-style-type:circle;font-size:12pt;font-family:Calibri,sans-serif;font-weight:400"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span>Proposal #2: (Related to Issue #3) Design a hierarchical representation for the metadata operands in Alias.Scope and NoAlias sets.</span></div></li><li dir="ltr" style="list-style-type:circle;font-size:12pt;font-family:Calibri,sans-serif;font-weight:400"><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;font-weight:normal"><span style="font-size:12pt;font-family:Calibri,sans-serif;font-weight:400">Proposal #3:<span> </span></span><a href="https://reviews.llvm.org/D68484" target="_blank"><span style="font-size:12pt;font-family:Calibri,sans-serif;color:rgb(17,85,204);font-weight:400">https://reviews.llvm.org/D68484</span></a><span style="font-size:12pt;font-family:Calibri,sans-serif;font-weight:400"><span> </span>provides the infrastructure to fix issue #4. It might also help with issue #1 and issue #3 as it makes it possible to share scopes.</span></span></div></li></ul></ul><div><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;font-weight:normal"><span style="font-size:12pt;font-family:Calibri,sans-serif;font-weight:400"><br></span></span></div><div style="margin-top:0pt;margin-bottom:0pt;line-height:1.38"><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;font-weight:normal"><span style="font-size:12pt;font-family:Calibri,sans-serif;font-weight:400"> -Hal</span></span></div></div></b></div><div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><div id="gmail-m_2480859393935719847gmail-m_7488617652282575495x_Signature"><div><font size="2"><span style="font-size:10pt"><div>Hal Finkel<br>Lead, Compiler Technology and Programming Languages<br>Leadership Computing Facility<br>Argonne National Laboratory</div></span></font></div></div></div><div><div id="gmail-m_2480859393935719847gmail-m_7488617652282575495x_appendonsend"></div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><hr style="display:inline-block;width:869.25px"><div id="gmail-m_2480859393935719847gmail-m_7488617652282575495x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt"><b>From:</b><span> </span>Finkel, Hal J. <<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>><br><b>Sent:</b><span> </span>Monday, May 18, 2020 11:40 AM<br><b>To:</b><span> </span>Jeroen Dobbelaere <<a href="mailto:Jeroen.Dobbelaere@synopsys.com" target="_blank">Jeroen.Dobbelaere@synopsys.com</a>>; Alina Sbirlea <<a href="mailto:alina.sbirlea@gmail.com" target="_blank">alina.sbirlea@gmail.com</a>><br><b>Cc:</b><span> </span><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><span> </span><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>>; Doerfert, Johannes <<a href="mailto:jdoerfert@anl.gov" target="_blank">jdoerfert@anl.gov</a>><br><b>Subject:</b><span> </span>Re: LLVM Alias Analysis Technical Call - Doodle Poll</font><div> </div></div><div dir="ltr"><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">To join our call on Thursday, May 28th @ <span style="font-family:Calibri,Arial,Helvetica,sans-serif;background-color:rgb(255,255,255);display:inline">9-10 AM central time / 2-3 PM UTC </span>please use this information:</div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><span>Meeting URL<br></span><div><a href="https://bluejeans.com/643493129?src=join_info" target="_blank">https://bluejeans.com/643493129?src=join_info</a><br></div><div><br></div><div>Meeting ID<br></div><div>643 493 129<br></div><div><br></div><div>Want to dial in from a phone?<br></div><div><br></div><div>Dial one of the following numbers:<br></div><div>+1.312.216.0325 (US (Chicago))<br></div><div>+1.408.740.7256 (US (San Jose))<br></div><div>+1.866.226.4650 (US Toll Free)<br></div><div>(see all numbers -<span> </span><a href="https://www.bluejeans.com/premium-numbers" target="_blank">https://www.bluejeans.com/premium-numbers</a>)<br></div><div><br></div><div>Enter the meeting ID and passcode followed by #<br></div><div><br></div><div>Connecting from a room system?<br></div><span>Dial: <a href="http://bjn.vc" target="_blank">bjn.vc</a> or 199.48.152.152 and enter your meeting ID & passcode</span><br></div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><span><br></span></div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><span>On our agenda, we'll have:</span></div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><span><br></span></div><div><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-size:12pt"> 1. Scalability<span> </span></span>challenges<span style="font-size:12pt"> and other issues discovered with the current infrastructure (especially, perhaps, with the noalias metadata).</span></font></div><div><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-size:12pt"> 2. Proposed solutions: progress, outstanding<span> </span></span>challenges, how to make progress going forward.</font></div><div><font face="Calibri, Arial, Helvetica, sans-serif"><br></font></div><div><font face="Calibri, Arial, Helvetica, sans-serif">We'll formulate the detailed agenda and take notes from the call using this Google doc: <a href="https://docs.google.com/document/d/1ybwEKDVtIbhIhK50qYtwKsL50K-NvB6LfuBsfepBZ9Y/edit?usp=sharing" id="gmail-m_2480859393935719847gmail-m_7488617652282575495LPNoLP538393" target="_blank">https://docs.google.com/document/d/1ybwEKDVtIbhIhK50qYtwKsL50K-NvB6LfuBsfepBZ9Y/edit?usp=sharing</a></font></div><div><br></div><div>A summary will then be sent to the mailing list after the call. If you would like to add items to the agenda, please edit the document (or reply to this email).</div><div><br></div><div>Thanks again,</div><div>Hal</div><div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><div id="gmail-m_2480859393935719847gmail-m_7488617652282575495x_x_Signature"><div><font size="2"><span style="font-size:10pt"><div>Hal Finkel<br>Lead, Compiler Technology and Programming Languages<br>Leadership Computing Facility<br>Argonne National Laboratory</div></span></font></div></div></div><div><div id="gmail-m_2480859393935719847gmail-m_7488617652282575495x_x_appendonsend"></div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><hr style="display:inline-block;width:869.25px"><div id="gmail-m_2480859393935719847gmail-m_7488617652282575495x_x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt"><b>From:</b><span> </span>Finkel, Hal J. <<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>><br><b>Sent:</b><span> </span>Monday, May 18, 2020 10:24 AM<br><b>To:</b><span> </span>Jeroen Dobbelaere <<a href="mailto:Jeroen.Dobbelaere@synopsys.com" target="_blank">Jeroen.Dobbelaere@synopsys.com</a>>; Alina Sbirlea <<a href="mailto:alina.sbirlea@gmail.com" target="_blank">alina.sbirlea@gmail.com</a>>; Finkel, Hal J. <<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>><br><b>Cc:</b><span> </span><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><span> </span><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>>; Doerfert, Johannes <<a href="mailto:jdoerfert@anl.gov" target="_blank">jdoerfert@anl.gov</a>><br><b>Subject:</b><span> </span>Re: LLVM Alias Analysis Technical Call - Doodle Poll</font><div> </div></div><div dir="ltr"><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">Thanks to everyone who participated in the poll. The time that maximizes availability is:</div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">  Thursday, May 28th @ 9-10 AM central time / 2-3 PM UTC.</div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">I'll send out meeting information shortly.</div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"> -Hal</div><div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><div id="gmail-m_2480859393935719847gmail-m_7488617652282575495x_x_x_Signature"><div><font size="2"><span style="font-size:10pt"><div>Hal Finkel<br>Lead, Compiler Technology and Programming Languages<br>Leadership Computing Facility<br>Argonne National Laboratory</div></span></font></div></div></div><div><div id="gmail-m_2480859393935719847gmail-m_7488617652282575495x_x_x_appendonsend"></div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><hr style="display:inline-block;width:869.25px"><div id="gmail-m_2480859393935719847gmail-m_7488617652282575495x_x_x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt"><b>From:</b><span> </span>llvm-dev <<a href="mailto:llvm-dev-bounces@lists.llvm.org" target="_blank">llvm-dev-bounces@lists.llvm.org</a>> on behalf of Finkel, Hal J. via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>><br><b>Sent:</b><span> </span>Wednesday, May 13, 2020 11:14 AM<br><b>To:</b><span> </span>Jeroen Dobbelaere <<a href="mailto:Jeroen.Dobbelaere@synopsys.com" target="_blank">Jeroen.Dobbelaere@synopsys.com</a>>; Alina Sbirlea <<a href="mailto:alina.sbirlea@gmail.com" target="_blank">alina.sbirlea@gmail.com</a>><br><b>Cc:</b><span> </span><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><span> </span><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>>; Doerfert, Johannes <<a href="mailto:jdoerfert@anl.gov" target="_blank">jdoerfert@anl.gov</a>><br><b>Subject:</b><span> </span>[llvm-dev] LLVM Alias Analysis Technical Call - Doodle Poll</font><div> </div></div><div dir="ltr"><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">Hi, everyone,</div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">We've had a number of discussions recently, including on the Flang technical call, about potential improvements to LLVM's alias analysis to support handling restrict and restrict-like semantics.</div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">We would like to try having a call to discuss these issues further. Please, if you're interested in joining, indicate your availability (prior to the end of this week):</div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">  <a href="https://doodle.com/poll/evhwr2eyfvcf8ib3" id="gmail-m_2480859393935719847gmail-m_7488617652282575495LPlnk510266" target="_blank">https://doodle.com/poll/evhwr2eyfvcf8ib3</a></div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">Thanks again,</div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">Hal</div><div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><div id="gmail-m_2480859393935719847gmail-m_7488617652282575495x_x_x_x_Signature"><div><font size="2"><span style="font-size:10pt"><div>Hal Finkel<br>Lead, Compiler Technology and Programming Languages<br>Leadership Computing Facility<br>Argonne National Laboratory</div></span></font></div></div></div><div><div id="gmail-m_2480859393935719847gmail-m_7488617652282575495x_x_x_x_appendonsend"></div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br></div><hr style="display:inline-block;width:869.25px"><div id="gmail-m_2480859393935719847gmail-m_7488617652282575495x_x_x_x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt"><b>From:</b><span> </span>llvm-dev <<a href="mailto:llvm-dev-bounces@lists.llvm.org" target="_blank">llvm-dev-bounces@lists.llvm.org</a>> on behalf of Alina Sbirlea via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>><br><b>Sent:</b><span> </span>Monday, May 11, 2020 9:49 AM<br><b>To:</b><span> </span>Jeroen Dobbelaere <<a href="mailto:Jeroen.Dobbelaere@synopsys.com" target="_blank">Jeroen.Dobbelaere@synopsys.com</a>><br><b>Cc:</b><span> </span><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><span> </span><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>>; Doerfert, Johannes <<a href="mailto:jdoerfert@anl.gov" target="_blank">jdoerfert@anl.gov</a>><br><b>Subject:</b><span> </span>Re: [llvm-dev] Full restrict support - status update</font><div> </div></div><div><div dir="ltr">Hi Johannes et al,<br><div><br></div><div>Trying to revive this discussion, as the restrict support is relevant for one of our teams.</div><div><br></div><div>Thank you,</div><div>Alina</div></div><br><div><div dir="ltr">On Tue, Nov 12, 2019 at 1:16 PM Jeroen Dobbelaere via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Johannes et al,<br><br>> -----Original Message-----<br>> From: Doerfert, Johannes <<a href="mailto:jdoerfert@anl.gov" target="_blank">jdoerfert@anl.gov</a>><br>[..]<br>> On 11/06, Jeroen Dobbelaere wrote:<br>> > >From: Alexey Zhikhartsev<br>> > [..]<br>> > > We would love to see your patches merged as soon as possible, so I was<br>> wondering: do you think the lack of bitcode support will prevent that from<br>> happening?<br>> ><br>> > Yes, I think that the lack of bitcode support will prevent it.<br>> ><br>> > During the Developers meeting, I also talked with Hal and Johannes.<br>> > They had some extra remarks:<br>> > - (1) the restrict implementation deserves a separate document. (I am<br>> working on that one)<br>> > - (2) they don't like the naming of 'noalias_sidechannel'.<br>> > - (3) they also have some other mechanisms in mind to add the 'sidechannel'<br>> to the load/store instructions<br>> >        (and maybe to function calls, intrinsics; currently that is handled through<br>> llvm.noalias.arg.guard)<br>> ><br>> > For (2) and (3), I am waiting for a proposal from them ;)<br>><span> </span><br>> I would like to see the restrict support be merged but, as Jeroen<br>> mentions above, I feel there are two design choices we have to<br>> overthink. Here are short descriptions to get some feedback from the<br>> community:<br>><span> </span><br>> (A) Naming and restriction<br>><span> </span><br>> The name "sidechannel" is unfortunate, it has various negative<br>> connotations, e.g., the release notes that read:<br>>  "LLVM 10.0 now has sidechannel support for your restrict pointer"<br>> will raise a lot of follow up questions.<br>><span> </span><br>> What I think we actually do, and what we should call it, is "provenance"<br>> tracking.<br>><span> </span><br>> Now beyond the pure renaming of "sidechannel" into "provenance" (or sth.<br>> similar) I want us to decouple provenance tracking from the noalias<br>> logic. Noalias/restrict is one use case in which (pointer) provenance<br>> information is useful but not the only one. If we add some mechanism to<br>> track provenance, let's make it generic and reusable. Note that the<br>> basic ideas are not much different to what the noalias RFC proposed.<br>> The major difference would be that we have provenance information and if<br>> that originates in an `llvm.restrict.decl` call we can use it for<br>> (no)alias queries.<br><br>"provenance" might indeed be a good name.<br><br>There is a big difference between a restrict declaration, and a restrict usage:<span> </span><br>- the declaration intrinsic (llvm.noalias.decl) is used to track in the cfg the location<br>   where the restrict variable was declared. This is important to handle code motion,<br>   merging, duplication in a correct way (inlining, loop unrolling, ...)<br>- the restrict usage intrinsics (llvm.noalias and llvm.side.noalias) are used to indicate<br>   that from that point on, restrict (noalias) properties are introduced for that pointer.<br>  They can exist without an associated 'llvm.noalias.decl' (when the declaration is outside<br>   the function.)<br>Given that, I assume that you mean 'llvm.provenance.noalias' (~ llvm.side.noalias) instead<br>of 'llvm.restrict.decl'.<br><br>><span> </span><br>><span> </span><br>><span> </span><br>> (B) Using operand bundles<br>><span> </span><br>> Right now, loads and stores are treated differently and given a new<br>> operand. Then there are intrinsics to decode other kinds of information.<br>> As an alternative, we could allow operand bundles on all instructions<br>> and use them to tie information to an instruction. The "sidechannel"<br>> operand of a load would then look something like:<br>>   load i32* %p [ "ptr_provenance"(%p_decl) ]<br>> and for a store we could have<br>>   store i32** %p.addr, i32* %p [ "ptr_provenance"(%p_decl) ]<br>><span> </span><br>> The benefit is that we do not change the operand count (which causes a<br>> lot of noise) but we still have to make sure ptr/value uses are not<br>> confused with operand bundle uses. We can attach the information to more<br>> than load/store instructions, also to remove the need for some of the<br>> intrinsics.<br><br>To me, operand bundles sound to be more or less equivalent to the current<br>solution. It  might also make the 'instruction cloning' easier, if we can omit the<br>'ptr_provenance' there. The change of the number of operands caused some<br>noise, but it is the changes in the amount of 'uses' of a pointer that refer to the<br>same instruction that caused the most problems. Especially when that instruction<br>was going to be erased. Operand bundles will still need those code changes.<br>(like in parts of D68516 and D68518)<br><br>As the 'Call' instruction already supports operand bundles, it could eliminate the need<br>for the 'llvm.noalias.arg.guard' intrinsic, which combines the normal pointer with the<br>side channel (aka provenance). But, after inlining, we still need to put that information<br>somewhere. Or it should be propagated during inlining.<br>Care must be taken not to lose that information when the 'call' is changed by optimizations<br>as, after inlining, that might result in wrong alias analysis conclusions.<br><br>Are you thinking of "operand bundles" support for just LoadInst/StoreInst, or for all<br>instructions ?<br><br>Greetings,<br><br>Jeroen Dobbelaere<br><br><br>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br><a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br></blockquote></div></div></div></div></div></div></div></div></div></div></div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">_______________________________________________</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">LLVM Developers mailing list</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><a href="mailto:llvm-dev@lists.llvm.org" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">llvm-dev@lists.llvm.org</a><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a></div></blockquote></div><br></div></div></div>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>