<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 19, 2017 at 2:55 PM, Steven Perron <span dir="ltr"><<a href="mailto:perrons@ca.ibm.com" target="_blank">perrons@ca.ibm.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_-7906532988173239157socmaildefaultfont" dir="ltr" style="font-family:Arial,Helvetica,sans-serif;font-size:10.5pt"><div dir="ltr">Hello all,</div>
<div dir="ltr"> </div>
<div dir="ltr">I started implementing Daniel's idea, and I noticed a couple things that should be addressed.</div>
<div dir="ltr"> </div>
<div dir="ltr">1) The root node:  Clang currently generates a root node named "Simple C++ TBAA" (or something similar).  From the comments it looks like this is used to determine whether or not two TBAA DAGs from different translation units can be merged into a single on during LTO.  I plan on keeping that node, but making it the universal "sink" node as before.  This means that, in the new interpretation of the graph, it will be a child of everything instead of a parent of everything.  However, since it is still the sink, it can still work in LTO as before.  This is just a guess, because I have not looked at the code that uses this.</div>
<div dir="ltr"> </div>
<div dir="ltr">2) char: Daniel suggested omitting the aliasing for because we know it aliases everything. </div></div></blockquote><div><br></div><div>Not quite. I suggested not explicitly representing it as a node.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_-7906532988173239157socmaildefaultfont" dir="ltr" style="font-family:Arial,Helvetica,sans-serif;font-size:10.5pt"><div dir="ltr"> The problem with this is that llvm does not alias the current "omnipotent char" to everything.  As is pointed out in the comments:</div>
<div dir="ltr"> </div>
<div dir="ltr">  // Define the root of the tree for user-accessible memory. C and C++                           <wbr>     <br>  // give special powers to char and certain similar types. However,                      <wbr>            <br>  // these special powers only cover user-accessible memory, and doesn't                       <wbr>       <br>  // include things like vtables.              </div></div></blockquote><div><br></div><div>Sure.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_-7906532988173239157socmaildefaultfont" dir="ltr" style="font-family:Arial,Helvetica,sans-serif;font-size:10.5pt">
<div dir="ltr"> </div>
<div dir="ltr">Is there another option on how to handle vtables?  If not, we may need to add a node for "omnipotent char", which will have lots of children.  This will make precomputing the transitive closure particularly important.</div></div></blockquote><div><br></div><div>You don't need an actual node, just a single bit saying whether it is has "aliases anything" as a child.</div><div>If so, it is equivalent to aliases anything, and you do not need to store any more children.</div><div><br></div><div>See, e.g., what gcc does for "has_zero_child"</div></div></div></div>