[PATCH] D13304: Avoid inlining in throw statement

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 7 13:18:24 PDT 2015


rsmith added a subscriber: rsmith.
rsmith added a comment.

This seems like something that's much better handled by the inliner. We should presumably treat all the code that leads up to the throw as being cold, not just the invocation of the throw-expression itself, and it seems like it should be straightforward for the inliner to check whether a call invariably leads to an `unreachable` or an unwind.

Also, blindly marking the calls as noinline doesn't seem like a good idea at all. This should just factor into the inline cost heuristics, and shouldn't stop us inlining in cases where doing so is obviously going to cause a code size reduction.


http://reviews.llvm.org/D13304





More information about the cfe-commits mailing list