[PATCH] D15139: [IR] Reformulate LLVM's EH funclet IR
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 2 11:35:59 PST 2015
rnk added inline comments.
================
Comment at: lib/Transforms/Utils/InlineFunction.cpp:1105-1106
@@ +1104,4 @@
+ if (isFuncletEHPersonality(Personality)) {
+ DenseMap<BasicBlock *, ColorVector> CallerBlockColors =
+ colorEHFunclets(*Caller);
+ ColorVector &CallSiteColors = CallerBlockColors[OrigBB];
----------------
majnemer wrote:
> rnk wrote:
> > Hm, it seems pretty crummy that we have to recalculate this whole-function analysis for every call site that we want to consider inlining. This is definitely quadratic in basic blocks.
> >
> > I think this hunk would actually be a good change to split out and do later. We can leave behind the noinline hack in clang for now.
> It is not quadratic in basic blocks. It is `#blocks` for each inline call site candidate. This does not make the inliner asymptotically worse: we already do that much work for `fixupLineNumbers`, `CloneAliasScopeMetadata`. I'm pretty sure `AddAliasScopeMetadata` is significantly more expensive than the little DFS we are performing in `colorEHFunclets`
Sure, but those operations happen long after we've committed to inlining. You can imagine a situation where there are many candidate callsites for inlining, but they all have ambiguous funclet membership, so they will all fail slowly.
http://reviews.llvm.org/D15139
More information about the llvm-commits
mailing list