[PATCH] D15139: [IR] Reformulate LLVM's EH funclet IR

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 2 11:27:59 PST 2015


majnemer 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];
----------------
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`


http://reviews.llvm.org/D15139





More information about the llvm-commits mailing list