<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000'><br><hr id="zwchr"><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>From: </b>"Daniel Berlin" <dberlin@dberlin.org><br><b>To: </b>"Hal Finkel" <hfinkel@anl.gov><br><b>Cc: </b>"Geoff Berry" <gberry@codeaurora.org>, "Chandler Carruth" <chandlerc@gmail.com>, "Philip Reames" <listmail@philipreames.com>, "Sanjoy Das" <sanjoy@playingwithpointers.com>, mcrosier@codeaurora.org, "llvm-commits" <llvm-commits@lists.llvm.org>, "Junbum Lim" <junbuml@codeaurora.org>, reviews+D19730+public+66d50dddcf8372b8@reviews.llvm.org<br><b>Sent: </b>Friday, April 29, 2016 12:31:28 PM<br><b>Subject: </b>Re: [PATCH] D19730: [BasicAA] Treat llvm.assume as not accessing memory in getModRefBehavior(Function)<br><br><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><br>
<br>
I'm not sure this is a good idea. As the comment says, they "never aliases any particular memory location". This, however, is not comparing against any particular location.</blockquote><div><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> It is asking for general behavior. </blockquote><div>Yes, and it neither mod nor refs anything :)</div><div> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">AA should probably be constant with the function attributes here. <br></blockquote><div><br></div><div id="DWT7657">BasicAA already was working around this. </div></div></div></div></blockquote>I know, I'm responsible for the workarounds.<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> This just puts this knowledge in one place instead of two (basicaa and memoryssa).</div><div><br></div><div>In any case, if we are going to do that, we'd have to actually fix things properly.  Saying assume has side-effects and writes things was wrong in the first place compared to actually modeling control dependencies for things like assume properly.</div><div><br></div><div>It simply does not have side-effects or write anything. Period.  Claiming otherwise is a lie to try to avoid fixing other infrastructure to handle this kind of intrinsic properly.</div><div><br></div><div id="DWT7658">Until we go and have the wherewithal to fix that infrastructure, we are going to have to accept that we are going to have things like this, where we are making up for it.</div></div></div></div></blockquote>I'm well aware of the state of things, and I agree that we should have a better way of modeling control dependencies than via memory.<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><div><br></div><div>The alternative, which was currently done, where basicaa and memoryssa and whoever else has to know that assume is magic and special, seems much worse.</div><div><br></div></div></div></div>
</blockquote>I understand. However, without our current system, this still obviously needs to be correct. What is to prevent a pass from (correctly) seeing the call to assume, using AA to conclude it does not actually alter memory, seeing it has no return values, intrinsics don't throw, and so removing it as dead? It might have control-dependent UB, but not if it is removed.<br><br> -Hal<br><br>-- <br><div><span name="x"></span>Hal Finkel<br>Assistant Computational Scientist<br>Leadership Computing Facility<br>Argonne National Laboratory<span name="x"></span><br></div></div></body></html>