<div dir="ltr"><div>Hi,</div><div>RFC</div><div><br></div><div>Im adding 2 new functions to the AliasAnalysis interface:</div><div>

<pre class="gmail-remarkup-code" style="margin:0px;padding:12px;border:0px;background:rgba(71,87,120,0.08);display:block;color:rgb(0,0,0);overflow:auto;border-radius:3px;white-space:pre-wrap;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:12px;line-height:15px;font-family:Menlo,Consolas,Monaco,monospace;letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial">1) ModRefSameBufferCheck:</pre><pre class="gmail-remarkup-code" style="margin:0px;padding:12px;border:0px;background:rgba(71,87,120,0.08);display:block;color:rgb(0,0,0);overflow:auto;border-radius:3px;white-space:pre-wrap;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:12px;line-height:15px;font-family:Menlo,Consolas,Monaco,monospace;letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial">this function will receive 2 memoryLocation as parameters, and returns true if the parameters are modifying or refering the same buffer or same memory block, false otherwise.</pre>



<pre class="gmail-remarkup-code" style="margin:0px;padding:12px;border:0px;background:rgba(71,87,120,0.08);display:block;color:rgb(0,0,0);overflow:auto;border-radius:3px;white-space:pre-wrap;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:12px;line-height:15px;font-family:Menlo,Consolas,Monaco,monospace;letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial">2) getAddressesDistance:</pre><pre class="gmail-remarkup-code" style="margin:0px;padding:12px;border:0px;background:rgba(71,87,120,0.08);display:block;color:rgb(0,0,0);overflow:auto;border-radius:3px;white-space:pre-wrap;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:12px;line-height:15px;font-family:Menlo,Consolas,Monaco,monospace;letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial">the function will recieve 2 memoryLocation, if they are mod/ref-ing the same buffer/memory block, the function will return the distance between those locations at the memory. None otherwise (Optional<int64_t>)</pre>

<br></div>interface change:<div><a href="https://reviews.llvm.org/D46864">https://reviews.llvm.org/D46864</a><br><div><br></div><div><br></div><div>those 2 function can be impelemented easly in AlisAnalysis and can help alot of users, a usage example is for detecting bank conflicts (using the distance between memoryLoc and the number and size of the banks you can know if you have a conflict).<br>

<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">implementation and usage example (with code duplication for a first implementation, lets discuss the idea first):</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><a href="https://reviews.llvm.org/D46928">https://reviews.llvm.org/D46928</a><br></div>

<br>I saw one bad implemntation for detecting bank conflicts in Hexagon open-source, but it wont realy work for most of examples, they only check if the registers are equal.. in my implamentation I check the real distance between locations...<br><br><br>thanks,<br>Atheel Massalha<br>Compiler Engineer</div></div></div>