<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p><br>
</p>
<div class="moz-cite-prefix">On 11/17/2017 02:01 AM, Hongbin Zheng
wrote:<br>
</div>
<blockquote
cite="mid:CAJ0ZJHSYk5FcOkWADO=9D17a2rT4Nm8WKsowgGDqt_mVAvJb5Q@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<div dir="ltr">Do you mean a and b are noalias if:
<div><br>
</div>
<div><span style="font-size:12.8px">static int foo(int *a, int
*b) {</span><br style="font-size:12.8px">
<span style="font-size:12.8px"> return a[0] + b[0];</span><br
style="font-size:12.8px">
<span style="font-size:12.8px">}</span><br
style="font-size:12.8px">
<br style="font-size:12.8px">
<span style="font-size:12.8px">int bar(int *x) {</span><br
style="font-size:12.8px">
<span style="font-size:12.8px"> return foo(x+1, x);</span><br
style="font-size:12.8px">
<span style="font-size:12.8px">}</span><br>
</div>
<div><span style="font-size:12.8px"><br>
</span></div>
<div><span style="font-size:12.8px">?</span></div>
<div><span style="font-size:12.8px"><br>
</span></div>
<div><span style="font-size:12.8px">To me, because
"AA.alias((x+1, MemoryLocation::UnknownSize), </span><span
style="font-size:12.8px">(x, MemoryLocation::UnknownSize))</span><span
style="font-size:12.8px"> != NoAlias", so a and b are not
noalias.</span></div>
</div>
</blockquote>
<br>
Remember that MemoryLocation::UnknownSize is unknown, but positive.
So you need to check both "AA.alias((x+1,
MemoryLocation::UnknownSize), (x, MemoryLocation::UnknownSize)) ==
NoAlias" and "AA.alias((x, MemoryLocation::UnknownSize), (x+1,
MemoryLocation::UnknownSize)) == NoAlias" to partition by underlying
object. One of these should be false.<br>
<br>
-Hal<br>
<br>
<blockquote
cite="mid:CAJ0ZJHSYk5FcOkWADO=9D17a2rT4Nm8WKsowgGDqt_mVAvJb5Q@mail.gmail.com"
type="cite">
<div dir="ltr">
<div><span style="font-size:12.8px">Maybe my version is too
conservative.</span></div>
<div><span style="font-size:12.8px"><br>
</span></div>
<div><span style="font-size:12.8px">Thanks</span></div>
<div><span style="font-size:12.8px">Hongbin</span></div>
<div><span style="font-size:12.8px"><br>
</span></div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Nov 16, 2017 at 11:55 PM, Hal
Finkel <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"><span class="">
<p><br>
</p>
<div class="m_4344742898765767199moz-cite-prefix">On
11/17/2017 01:49 AM, Hongbin Zheng wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Could you elaborate "<span
style="font-size:12.8px">Note that, without
further analysis of the uses of the
potentially-noalias pointers, you can do this only
...</span>"?
<div>Why the uses, instead of the def, of pointer
matter?</div>
</div>
</blockquote>
<br>
</span> Both matter.<br>
<br>
static int foo(int *a, int *b) {<br>
return a[0] + b[1];<br>
}<br>
<br>
int bar(int *x) {<br>
return foo(x+1, x);<br>
}<br>
<br>
You can't mark a and b as noalias here, even though
NoAlias(x+1, x) == true. This is why I was saying that,
unless the pointers come from distinct, identified
underlying objects, you need to look at the uses of the
pointers too.<span class="HOEnZb"><font color="#888888"><br>
<br>
-Hal<br>
</font></span><br>
P.S. As discussed in D4609, we probably want to try adding
CGSCC AA wrappers, to look back through function
arguments, instead of using attribute propagation.
<div>
<div class="h5"><br>
<br>
<blockquote type="cite">
<div dir="ltr">
<div><br>
</div>
<div>Thanks</div>
<div>Hongbin</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Nov 16, 2017 at
11:21 PM, Hal Finkel via llvm-dev <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:llvm-dev@lists.llvm.org"
target="_blank">llvm-dev@lists.llvm.org</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0
0 0 .8ex;border-left:1px #ccc
solid;padding-left:1ex">Hi, Alexandre,<br>
<br>
We don't have anything currently which does
this. Note that, without further analysis of
the uses of the potentially-noalias pointers,
you can do this only for arguments with
distinct (and identified) underlying objects
(i.e., you need something a bit stronger than
just "non-aliasing pointers").<br>
<br>
-Hal
<div class="m_4344742898765767199HOEnZb">
<div class="m_4344742898765767199h5"><br>
<br>
On 11/16/2017 10:11 AM, via llvm-dev
wrote:<br>
<blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px
#ccc solid;padding-left:1ex"> Is this
what you are looking for?<br>
<br>
<a moz-do-not-send="true"
href="https://reviews.llvm.org/D4609"
rel="noreferrer" target="_blank">https://reviews.llvm.org/D4609</a><br>
<br>
Best,<br>
<br>
Haicheng Wu<br>
<br>
On 2017-11-14 20:34, Alexandre Isoard
via llvm-dev wrote:<br>
<blockquote class="gmail_quote"
style="margin:0 0 0
.8ex;border-left:1px #ccc
solid;padding-left:1ex"> Hello,<br>
<br>
Do we have a pass that propagate the
noalias annotation down to the<br>
callee when:<br>
- it is static<br>
- it is always called with non
aliasing pointers<br>
?<br>
<br>
Or maybe that is incorrect?<br>
<br>
-- <br>
<br>
ALEXANDRE ISOARD<br>
</blockquote>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a moz-do-not-send="true"
href="mailto:llvm-dev@lists.llvm.org"
target="_blank">llvm-dev@lists.llvm.org</a><br>
<a moz-do-not-send="true"
href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev"
rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</blockquote>
<br>
</div>
</div>
<span class="m_4344742898765767199HOEnZb"><font
color="#888888"> -- <br>
Hal Finkel<br>
Lead, Compiler Technology and Programming
Languages<br>
Leadership Computing Facility<br>
Argonne National Laboratory</font></span>
<div class="m_4344742898765767199HOEnZb">
<div class="m_4344742898765767199h5"><br>
<br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a moz-do-not-send="true"
href="mailto:llvm-dev@lists.llvm.org"
target="_blank">llvm-dev@lists.llvm.org</a><br>
<a moz-do-not-send="true"
href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev"
rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
<pre class="m_4344742898765767199moz-signature" cols="72">--
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre>
</body>
</html>