[PATCH] D23559: [ADCE] Add control dependence computation
Daniel Berlin via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 22 18:20:23 PDT 2016
On Mon, Aug 22, 2016 at 12:46 PM, Mehdi AMINI via llvm-commits <
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
> ----------------
> david2050 wrote:
> > mehdi_amini wrote:
> > > How expensive is this?
> > In email, Daniel Berlin discusses this as well.
> >
> > I measured ~400 cpp source files internally and impact is about ~0.6%
> (that is end to end starting with C++ source)
> Thanks!
>
> 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.
>
FWIW: We should get to the point where PDT/DT usage is basically a
non-issue.
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.
This is entirely because of our CFG structure:
1. Our predecessors are use lists that we walk to find the terminators, and
then return the blocks of those terminators :)
2. Our successors require a virtual call for each successor accessed.
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).
As you can imagine, these are not "fast" behaviors :)
--Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160822/d94770c8/attachment.html>
More information about the llvm-commits
mailing list