<div dir="ltr">thanks for your reply,<div>1) what is Im trying to analyze is the 2 memory instructions are using the same "Bank" of memory, Bank is a column in the physical memory rows of a memory block, for that I need to known if 2 instructions are using same block (usually, 2 different arrays are mapped to different blocks, but for [int* a=b+1], 'a' and 'b' will be in the same block, do oyu mean that "unkownSize" will always return "mayAlias"/"noAlias" for same/different blocks? sounds good idea, I will try it.<br><div><div><br></div><div>2) true. because it needs the size and the pointerInfo</div></div></div><div><br></div><div>another use fir this 2 interfaces is for "merging" load instructions registers, as for today, LLVM generates different register names for ld instructions with same base pointer but different offset, this can be optimized using the knowledge of the distance between them.</div><div>*any suggestions for improving this?</div><div><br></div><div>sorry for the late response, </div><div><br></div><div>thanks,</div><div>Atheel</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 20 June 2018 at 22:02, Friedman, Eli <span dir="ltr"><<a href="mailto:efriedma@codeaurora.org" target="_blank">efriedma@codeaurora.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"><span class="">
<div class="m_8844649153061863801moz-cite-prefix">On 6/20/2018 2:31 AM, Atheel Massalha
via llvm-dev wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<pre style="white-space:pre-wrap;color:rgb(0,0,0);text-decoration-style:initial;text-decoration-color:initial">Hi,
RFC
Im adding 2 new functions to the AliasAnalysis interface:
1) ModRefSameBufferCheck:
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>
</div>
</blockquote>
<br></span>
I'm not completely sure what "same buffer" means; is it just that
given MemoryLocations with addresses A and B, an offset N exists
such that gep(A,N) is mustalias with B? What happens if alias can't
prove whether the two locations point to the "same buffer"?<br>
<br>
Is that actually the property you care about? DependenceAnalysis
would probably be more appropriate if you're trying to analyze
cross-iteration dependencies in loops.<br>
<br>
Could you implement this by just calling alias() with the sizes set
to UnknownSize?<span class=""><br>
<br>
<blockquote type="cite">
<div dir="ltr">
<pre style="white-space:pre-wrap;color:rgb(0,0,0);text-decoration-style:initial;text-decoration-color:initial">2) getAddressesDistance:
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>
</div>
</blockquote>
<br></span>
If I'm following correctly, given two values A and B, if a small
constant offset N is known such that A+N==B, N is returned; if the
distance is unknown or not a constant, None is returned. Not sure
why the API takes memoryLocations, instead of just two Value*. Not
sure this really belongs in AliasAnalysis.<span class="HOEnZb"><font color="#888888"><br>
<br>
-Eli<br>
<pre class="m_8844649153061863801moz-signature" cols="72">--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project</pre>
</font></span></div>
</blockquote></div><br></div>