<div dir="ltr">I've checked that I've permission with my current employer to contribute code, so now I just need to find time to resurrect a working repo on a reasonable machine which will probably need to wait until the end of this month. <div><br></div><div></div><div>If you're inclined to look at it deeper in the meanwhile, I did look at the cases to consider and I think the fix should just be on line 22262 where we're removing the dependence between two memory operations if the locations don't alias (which now needs to check they're referring potentially aliasable frames). </div><div><br></div><div><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)">     <span style="color:rgb(224,128,0)">case</span> <a href="https://llvm.org/doxygen/namespacellvm_1_1ISD.html#a22ea9cec080dd5f4f47ba234c2f59110aada0b926e7ebc2bc55d158d4c37bdcca" style="color:rgb(70,101,162);text-decoration-line:none" target="_blank">ISD::LIFETIME_START</a>:</div><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)"><a name="m_-6296051869131400490_l22259" style="color:rgb(61,87,140)"></a><span style="padding-right:4px;text-align:right;border-right:2px solid rgb(0,255,0);background-color:rgb(232,232,232);white-space:pre-wrap">22259</span>     <span style="color:rgb(224,128,0)">case</span> <a href="https://llvm.org/doxygen/namespacellvm_1_1ISD.html#a22ea9cec080dd5f4f47ba234c2f59110ab49301b20458a7f312a0919e3c8abdb2" style="color:rgb(70,101,162);text-decoration-line:none" target="_blank">ISD::LIFETIME_END</a>: {</div><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)"><a name="m_-6296051869131400490_l22260" style="color:rgb(61,87,140)"></a><span style="padding-right:4px;text-align:right;border-right:2px solid rgb(0,255,0);background-color:rgb(232,232,232);white-space:pre-wrap">22260</span>       <span style="color:rgb(128,0,0)">// We can forward past any lifetime start/end that can be proven not to</span></div><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)"><a name="m_-6296051869131400490_l22261" style="color:rgb(61,87,140)"></a><span style="padding-right:4px;text-align:right;border-right:2px solid rgb(0,255,0);background-color:rgb(232,232,232);white-space:pre-wrap">22261</span>       <span style="color:rgb(128,0,0)">// alias the memory access.</span></div><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)"><a name="m_-6296051869131400490_l22262" style="color:rgb(61,87,140)"></a><span style="padding-right:4px;text-align:right;border-right:2px solid rgb(0,255,0);background-color:rgb(232,232,232);white-space:pre-wrap">22262</span>       <span style="color:rgb(224,128,0)">if</span> (!isAlias(N, <a href="https://llvm.org/doxygen/NVVMIntrRange_8cpp.html#a2ae53ee71b2ccbb52b883c0b4f59f8c2" style="color:rgb(70,101,162);text-decoration-line:none" target="_blank">C</a>.getNode())) {</div><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)"><a name="m_-6296051869131400490_l22263" style="color:rgb(61,87,140)"></a><span style="padding-right:4px;text-align:right;border-right:2px solid rgb(0,255,0);background-color:rgb(232,232,232);white-space:pre-wrap">22263</span>         <span style="color:rgb(128,0,0)">// Look further up the chain.</span></div><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)"><a name="m_-6296051869131400490_l22264" style="color:rgb(61,87,140)"></a><span style="padding-right:4px;text-align:right;border-right:2px solid rgb(0,255,0);background-color:rgb(232,232,232);white-space:pre-wrap">22264</span>         <a href="https://llvm.org/doxygen/NVVMIntrRange_8cpp.html#a2ae53ee71b2ccbb52b883c0b4f59f8c2" style="color:rgb(70,101,162);text-decoration-line:none" target="_blank">C</a> = <a href="https://llvm.org/doxygen/NVVMIntrRange_8cpp.html#a2ae53ee71b2ccbb52b883c0b4f59f8c2" style="color:rgb(70,101,162);text-decoration-line:none" target="_blank">C</a>.<a href="https://llvm.org/doxygen/classllvm_1_1User.html#abe1de1520a21f77ac57cc210bf0fb0b4" style="color:rgb(70,101,162);text-decoration-line:none" target="_blank">getOperand</a>(0);</div><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)"><a name="m_-6296051869131400490_l22265" style="color:rgb(61,87,140)"></a><span style="padding-right:4px;text-align:right;border-right:2px solid rgb(0,255,0);background-color:rgb(232,232,232);white-space:pre-wrap">22265</span>         <span style="color:rgb(224,128,0)">return</span> <span style="color:rgb(0,128,0)">true</span>;</div><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)"><a name="m_-6296051869131400490_l22266" style="color:rgb(61,87,140)"></a><span style="padding-right:4px;text-align:right;border-right:2px solid rgb(0,255,0);background-color:rgb(232,232,232);white-space:pre-wrap">22266</span>       }</div></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 1, 2020 at 2:38 AM Yonghong Song via Phabricator <<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.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">yonghong-song added a comment.<br>
<br>
> As an alternative, we could update ImproveChain (and visitLIFETIME_END) to limit the aliasing <br>
> around lifetime_start / end to disallow improving the chain dependence of a mem op node<br>
>  from a different lifetime node that may alias. That should prohibit access from two aliasable <br>
> frame indices from being concurrent while still allowing us to leverage that disjoint allocs should be disjoint.<br>
<br>
@niravd Any update on this?<br>
<br>
<br>
Repository:<br>
  rG LLVM Github Monorepo<br>
<br>
CHANGES SINCE LAST ACTION<br>
  <a href="https://reviews.llvm.org/D89149/new/" rel="noreferrer" target="_blank">https://reviews.llvm.org/D89149/new/</a><br>
<br>
<a href="https://reviews.llvm.org/D89149" rel="noreferrer" target="_blank">https://reviews.llvm.org/D89149</a><br>
<br>
</blockquote></div>