[PATCH] D22666: Frontend: Fix mcount inlining bug

Honggyu Kim via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 26 06:39:13 PDT 2016


honggyu.kim added a comment.

In https://reviews.llvm.org/D22666#493708, @rjmccall wrote:

> Note that the presence of the mcount call itself will significantly impact inlining and, really, the entire optimization pipeline.  Having this be a late pass seems more in keeping with what I assume is a goal that this instrumentation doesn't drastically change the generated code.


I agree that the best solution is to move mcount insertion phase in the late pass so `llc` has to insert mcount calls for each function. But I don't have clear idea how much work has to be done for this. I confess that I don't have much experience on current LLVM code base.  That's why I wrote this workaround patch to fix the bug first, then hopefully someone can move mcount insertion phase as you mentioned, or someone give me some guide how to do that.  Writing a new attribute `"drop_when_inlining"` seems to be a bit more comfortable for me as Hal suggested.
Thanks for the comments.


https://reviews.llvm.org/D22666





More information about the cfe-commits mailing list