Optimization of landing pads


I am seeing that LLVM optimizer often inlines functions called from landing pads.

  • Is this expected? I thought that landing pads were always considered to be on the “cold” path…

  • Is there any way to discourage inlining in landing pads and optimize them for size?


We already have a heuristic that unwind edges are infrequently taken, but it sounds like the inliner isn’t taking this into account. Maybe the new pass manager can fix this, given that it’s supposed to enable access to branch profiles.