<div dir="ltr"><div dir="ltr">Can someone please clarify me on this?<br><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 13 Nov 2019 at 22:25, Venkataramanan Kumar <<a href="mailto:venkataramanan.kumar.llvm@gmail.com">venkataramanan.kumar.llvm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi, </div><div><br></div>I have the following LLVM IR.<br><br>----Snip---<br>%1 = getelementptr inbounds %struct._X, %struct._X* %0, i64 0, i32 3<br>%2 = load %struct._X*, %struct._X** %1, align 8, !tbaa !10<br>....<div>.....<br>.......<br><br>%3 = bitcast %struct._Y** %1 to i8**<br>store i8* null, i8** %3, align 8, !tbaa !9<br><br>!9 = !{!7, !7, i64 0}<br>!7 = !{!"omnipotent char", !8, i64 0}<br>!8 = !{!"Simple C/C++ TBAA"}<br><br>----Snip----<br><br>Load inst above is trying to access a field of _X which is a self recursive pointer to same struct _X.<br>Store puts a null value for a pointer to struct _Y. It has been bitcasted to i8** and store happens via char pointer. <br><br><br>When I query alias analysis although loads and stores are pointers to different struct types. TBAA says may alias.<br>is it safe to assume the loaded pointer to struct _X do not alias with the store , if we look further at bitcast and see the pointer to different struct? <br></div><div><br></div><div>is my understanding wrong here?</div><div><br></div><div>regards,</div><div>Venkat,</div></div>
</blockquote></div></div>