<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><blockquote type="cite" class=""><div class="">On Feb 18, 2019, at 7:02 PM, Chandler Carruth via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><div class=""><div dir="ltr" class=""><div class="">A slight clarification to this and Chris's response just so that it doesn't cause confusion in the future (it isn't relevant to your example):</div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 11, 2019 at 1:15 PM Philip Reames via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF" class=""><p class="">I can see four possible meanings of must alias:<br class="">
</p>
<ol class="">
<li class="">A must alias result indicates that the exact same bits in
memory are accessed by both. (This requires both pointer and
size to be equal at runtime.)<br class="">
</li>
<li class="">A must alias result indicates that *at least one* bit in
memory is accessed by both. (This allows unequal pointers, and
unequal sizes, but not zero sizes.)<br class="">
</li>
<li class="">A must alias result indicates that the two pointers must be
equal when accessed at runtime. (This allows unequal sizes, and
zero sizes, but restricts the pointers to be equal.)<br class="">
</li>
<li class="">A must alias result indicates that *at least one* bit in
memory is accessed by both, unless one of the two accesses has
size 0 at runtime. (This is the weakest.)<br class="">
</li>
</ol><p class="">I'd always thought that (1) was the correct answer, but now I
find myself wondering. From the code, (3) seems to be the closest
match to what we actually implement, but we're not entirely
consistent there either. What do others think?</p></div></blockquote><div class="">I agree that the intent is #3, but there is a gotcha IMO: the pointers need not be the *same*, but merely equivalent for the purpose of loading and storing to memory.</div><div class=""><br class=""></div><div class="">I don't believe that it would be correct to CSE the pointer values as I understand the definition of aliasing. Aliasing is a property of the underlying *memory* and not fundamentally of the pointer itself.</div></div></div></div></blockquote><br class=""></div><div class="">Absolutely right. A “must alias” result isn’t enough to RAUW one pointer with another. They could have different LLVM types, they might not dominate each other, etc.</div><div class=""><br class=""></div><div class="">-Chris</div><div class=""><br class=""></div><br class=""></div></div></body></html>