<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Mon, Apr 18, 2016 at 4:30 PM Xinliang David Li <<a href="mailto:davidxl@google.com">davidxl@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000"><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"><span><div class="gmail_quote"><div><br></div><div>This is not the case as of today.  BPI is a dedicated analysis pass to manage branch probability profile information, but this pass is only used in limited situations (e.g, for BFI, profile update in jump-threading etc) -- using it it requires more memory as well as incremental update interfaces.  Many transformation passes simply skip it and directly access the meta data in IR.</div><div><br></div></div></span></div></div></blockquote>Really? Which ones? I see a number of passes that know about profiling metadata so they can preserve it, or transfer it across restructuring, but nothing that really interprets it on its own in a non-trivial way.<br></div></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>In a lot of cases, the client code simply set the metadata, but the user clients include:</div></div></div></div></blockquote><div><br></div><div>I want to reiterate that if this is the case, I believe these are bugs that we need to fix. As a consequence I quickly did an audit of the places you mentioned...</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>SimplifyCFG.cpp,</div></div></div></div></blockquote><div><br></div><div>Where? I skimmed the uses, and I only found code that uses to update metadata, not to reason about it. If you know of something that its it would be really nice to point out</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> Locals.cpp,</div></div></div></div></blockquote><div><br></div><div>I assume you mean lib/Transforms/Utils/Local.cpp? Same as above, all the uses look like update only.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> CodeGenPrepare.cpp, etc.</div></div></div></div></blockquote><div><br></div><div>Same story here -- extracted and re-applied but not analyzed.</div><div><br></div><div>Anyways, if you do spot clients actually using metadata directly rather than using the analysis pass to reason about it, we should fix them to use the analysis passes instead.</div><div><br></div><div>The scaling issues with the analysis pass were fixed really nicely BTW. I forget whose patch that was, but I think it was Cong?</div><div><br></div><div>-Chandler</div></div></div>