<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
<div class="moz-cite-prefix">On 11/30/18 4:07 AM, Markus Lavin via llvm-dev wrote:<br>
</div>
<blockquote type="cite" cite="mid:HE1PR0701MB245924FD2B2AF7992A8185ADE8D30@HE1PR0701MB2459.eurprd07.prod.outlook.com">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<div>We recently noticed some deficiencies in BasicAA that result in poor scheduling for our downstream VLIW target. It boils down to BasicAA not being able to tell that accesses to %G1 and %G2 below would not alias.</div>
<div><br>
</div>
<div>%1 = mul i16 %X, 6</div>
<div>%2 = shl i16 %X, 3</div>
<div>%G1 = getelementptr i16, i16* %base, i16 %1</div>
<div>%G2 = getelementptr i16, i16* %base, i16 %2</div>
<div><br>
</div>
<div>In general that would be correct but in the special case where it is known that %X != 0 it seems reasonable to conclude that they cannot alias. </div>
<div><br>
</div>
<div>In <a class="moz-txt-link-freetext" href="https://reviews.llvm.org/D55107">https://reviews.llvm.org/D55107</a> (not at all ready, just for discussion) there is an attempt to teach BasicAA about this in the presence of a @llvm.assume on %X.</div>
<div><br>
</div>
<div>Now I am curious if adding such additional analysis to BasicAA would be considered a good idea and if so what would be the proper way to integrate it as right now my implementation feels mostly bolted on top of the existing one.</div>
</div>
</blockquote>
<p><br>
</p>
<p>Logically speaking, BasicAA is the place that should do this kind of algebraic reasoning. We need to be careful about (at least) two things:</p>
<p><br>
</p>
<p> 1. Compile-time impact.</p>
<p> 2. That we don't introduce more problems when we look back through loop backedges (look for PR32314 if you don't know what I mean).</p>
<p><br>
</p>
<p> -Hal<br>
</p>
<p><br>
</p>
<blockquote type="cite" cite="mid:HE1PR0701MB245924FD2B2AF7992A8185ADE8D30@HE1PR0701MB2459.eurprd07.prod.outlook.com">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<div><br>
</div>
<div>-Markus </div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre>
</body>
</html>