[PATCH] D39287: Add a flag to disable inlining calls to cygprofile functions generated by -finstrument-functions

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 25 07:30:56 PDT 2017


hfinkel added a comment.

If you only want these calls post-inlining (and otherwise wish to minimize the effect on the rest of the optimizer), I'd recommend a different approach. What we did for mcount, which has similar requirements, was that we had the frontend add an attribute, and then a late pass actually added the function calls (lib/CodeGen/CountingFunctionInserter.cpp). I recommend extending CountingFunctionInserter to enable it to add these functions (based on some additional attribute), and then just add whatever attribute is necessary in the frontend based on some new flag.


https://reviews.llvm.org/D39287





More information about the llvm-commits mailing list