[PATCH] D15289: Avoid inlining CallSites leading to unreachable

hfinkel@anl.gov via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 9 10:39:39 PST 2015


hfinkel added inline comments.

================
Comment at: lib/Transforms/IPO/Inliner.cpp:287
@@ +286,3 @@
+// execution path (i.e., unwind edges of InvokeInsts are not considered).
+// FIXME: When inliner is hooked with BPI, we may need to check edge weights to
+// all successors to identify blocks post-dominated by blocks very unlikely to
----------------
To ask a higher-level question: Why do you want to take this intermediate step? Why not just jump straight to the end and use BPI? I'm a bit afraid of introducing yet more heuristics that we intend to rip out because of the resulting performance churn.

It is true, doing this outside the pass manager adds compile-time expense (this will be better with the new pass manager, because we'll be able to properly cache and update these things), but I suspect the compile-time benefit from not inlining will compensate to a large extent.

  DominatorTree DT;
  DT.recalculate(*F);
  LoopInfo LI(DT);
  BranchProbabilityInfo BPI(*F, LI);

and now you have a BPI object, and can do the "right" thing. Plus, we can then concentrate on adding branch probability heuristics in BPI, where we really want them, and not implicitly in the inliner.



http://reviews.llvm.org/D15289





More information about the llvm-commits mailing list