[PATCH] D23559: [ADCE] Add control dependence computation

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 22 12:55:11 PDT 2016


> On Aug 22, 2016, at 12:20 PM, Daniel Berlin <dberlin at dberlin.org> wrote:
> 
> 
> 
> On Mon, Aug 22, 2016 at 12:07 PM, Mehdi AMINI via llvm-commits <llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>> wrote:
> mehdi_amini added inline comments.
> 
> ================
> Comment at: lib/Transforms/Scalar/ADCE.cpp:459
> @@ -395,2 +458,3 @@
>    void getAnalysisUsage(AnalysisUsage &AU) const override {
> -    AU.setPreservesCFG();
> +    AU.addRequired<PostDominatorTreeWrapperPass>();
> +    AU.setPreservesCFG(); // TODO -- will remove when we start removing branches
> ----------------
> How expensive is this?
> 
> 
> FWIW: On very large testcases that take many many seconds, postdom usually costs <1 second.
> 
> The real cost is if we use it in a lot of places without an update scheme, such that it gets invalidated a lot.
> 
> I mentioned this privately to a few folks, but i actually have such an update scheme -
> There are recent advances in incremental dominator tree algorithms that make it so we can update postdom under random edge addition and deletion very quickly, and in most cases, at least 50-100x faster than we can rebuild it.
> The only thing required is to tell it what CFG edges you added/removed.
> 
> It's based on the algorithms in http://arxiv.org/pdf/1604.02711v1.pdf <http://arxiv.org/pdf/1604.02711v1.pdf> (I have the code from the paper, and hacked it into llvm for testing purposes :P)
> 
> note: the timings here are for complete incremental update after each change. If you batch changes, it is at least an order of magnitude cheaper.
> 
> Insertion is very cheap, it's deletion that can be expensive.

Nice, I’ve been stuck with trying to use the DomTree in (I think) Jump Threading, and being unable to preserve it. I’ll look forward into this if you ever get to commit such facilities (I doubt I’ll find time to study the paper in the near future…).

— 
Mehdi



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160822/cd8b9d78/attachment.html>


More information about the llvm-commits mailing list