<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Thanks Eli for kind comment. I have created the review on
Phabricator. <a class="moz-txt-link-freetext" href="https://reviews.llvm.org/D48066">https://reviews.llvm.org/D48066</a> Please review it.</p>
<p>Kind regards,</p>
<p>JinGu Kang<br>
<span style="color: rgb(0, 0, 0); font-family: "Lucida
Grande", "Lucida Sans Unicode", Geneva, Verdana,
sans-serif; font-size: 14px; font-style: normal;
font-variant-ligatures: normal; font-variant-caps: normal;
font-weight: 400; letter-spacing: normal; orphans: 2;
text-align: left; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
255); text-decoration-style: initial; text-decoration-color:
initial; display: inline !important; float: none;"></span> </p>
<br>
<div class="moz-cite-prefix">On 11/06/18 20:33, Friedman, Eli wrote:<br>
</div>
<blockquote type="cite"
cite="mid:8f419cb7-a57b-d407-6756-16f1acc5800a@codeaurora.org">On
6/11/2018 10:06 AM, <a class="moz-txt-link-abbreviated" href="mailto:jingu@codeplay.com">jingu@codeplay.com</a> via llvm-dev wrote:
<br>
<blockquote type="cite">Hello All,
<br>
<br>
I have met one may-alias case from llvm's alias analysis. The
code snippet is as following:
<br>
<br>
char buf[4];
<br>
<br>
void test (int idx) {
<br>
char *a = &buf[3 - idx];
<br>
char *b = &buf[idx];
<br>
*a = 1;
<br>
*b = 2;
<br>
}
<br>
<br>
I can see below output from alias set tracker for above code
snippet.
<br>
<br>
Alias sets for function 'test':
<br>
Alias Set Tracker: 1 alias sets for 2 pointer values.
<br>
AliasSet[0x53d8070, 2] may alias, Mod Pointers: (i8*
%arrayidx, 1), (i8* %arrayidx2, 1)
<br>
<br>
As you can see on above code snippet, the 'a' and 'b' are not
aliased. I think if we have following offset form, we can say
No-alias between them.
<br>
<br>
offset1 = odd_number - index
<br>
<br>
offset2 = index
<br>
<br>
I have implemented simple code for it and the output is as
following:
<br>
<br>
Alias sets for function 'test':
<br>
Alias Set Tracker: 2 alias sets for 2 pointer values.
<br>
AliasSet[0x541a070, 1] must alias, Mod Pointers: (i8*
%arrayidx, 1)
<br>
AliasSet[0x541cc00, 1] must alias, Mod Pointers: (i8*
%arrayidx2, 1)
<br>
<br>
How do you think about this? Is it legal for current alias
analysis or not? I have attached the diff file as reference. If
I missed something, please let me know. </blockquote>
<br>
The concept works. I'm not sure your patch handles all the edge
cases correctly, at first glance. (If you want a full review,
please post on Phabricator.)
<br>
<br>
-Eli
<br>
<br>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
JINGU KANG
Software Engineer, Compilers
Codeplay Software Ltd
Level C Argyle House, 3 Lady Lawson Street, Edinburgh, United Kingdom, EH3 9DR
Tel: +44 (0)131 466 0503
Website: <a class="moz-txt-link-freetext" href="http://www.codeplay.com">http://www.codeplay.com</a>
Twitter: <a class="moz-txt-link-freetext" href="https://twitter.com/codeplaysoft">https://twitter.com/codeplaysoft</a>
This email and any attachments may contain confidential and /or privileged information and is for use by the addressee only. If you are not the intended recipient, please notify Codeplay Software Ltd immediately and delete the message from your computer. You may not copy or forward it, or use or disclose its contents to any other person. Any views or other information in this message which do not relate to our business are not authorized by Codeplay software Ltd, nor does this message form part of any contract unless so stated.
As internet communications are capable of data corruption Codeplay Software Ltd does not accept any responsibility for any changes made to this message after it was sent. Please note that Codeplay Software Ltd does not accept any liability or responsibility for viruses and it is your responsibility to scan any attachments.
Company registered in England and Wales, number: 04567874
Registered office: Regent House, 316 Beulah Hill, London, United Kingdom, SE19 3HF</pre>
</body>
</html>