<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 22, 2016 at 12:46 PM, Mehdi AMINI via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">mehdi_amini added inline comments.<br>
<span class=""><br>
================<br>
Comment at: lib/Transforms/Scalar/ADCE.<wbr>cpp:459<br>
@@ -395,2 +458,3 @@<br>
   void getAnalysisUsage(AnalysisUsage &AU) const override {<br>
-    AU.setPreservesCFG();<br>
+    AU.addRequired<<wbr>PostDominatorTreeWrapperPass>(<wbr>);<br>
+    AU.setPreservesCFG(); // TODO -- will remove when we start removing branches<br>
----------------<br>
</span><span class="">david2050 wrote:<br>
> mehdi_amini wrote:<br>
> > How expensive is this?<br>
> In email, Daniel Berlin discusses this as well.<br>
><br>
> I measured ~400 cpp source files internally and impact is about ~0.6% (that is end to end starting with C++ source)<br>
</span>Thanks!<br>
<br>
0.6% is not negligible: some LLVM users are starting from bitcode (i.e. they don't pay the frontend cost) so the % could be considerably higher, and have low-latency requirements.<br></blockquote><div><br></div><div>FWIW: We should get to the point where PDT/DT usage is basically a non-issue.</div><div>As a slight side-rant,  GCC rebuilds the dominator and post-dominator tree for almost every pass, and it's rarely, if ever, a measurable part of compile time.</div><div><br></div><div>This is entirely because of our CFG structure:<br>1. Our predecessors are use lists that we walk to find the terminators, and then return the blocks of those terminators :)</div><div><br></div><div>2. Our successors require a virtual call for each successor accessed. </div><div>Fun fact: None of these virtual calls do anything remotely interesting that we couldn't make this non-virtual and standardize what is going on here (grep for getSuccessorV in lib/IR/Instructions.cpp).</div><div><br></div><div><br></div><div>As you can imagine, these are not "fast" behaviors :)</div><div><br></div><div>--Dan</div><div><br></div><div><br></div></div></div></div>