summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/CountingFunctionInserter/mcount.ll
Commit message (Collapse)AuthorAgeFilesLines
* Rename test/Transforms/CountingFunctionInserter -> EntryExitInstrumenterHans Wennborg2017-11-211-91/+0
| | | | | | The pass was renamed in r318195. llvm-svn: 318784
* EntryExitInstrumenter: support __cyg_profile_func_enter_bareHans Wennborg2017-11-211-0/+5
| | | | | | It works just like __cyg_profile_func_enter but takes no arguments. llvm-svn: 318783
* Rename CountingFunctionInserter and use for both mcount and cygprofile ↵Hans Wennborg2017-11-141-10/+69
| | | | | | | | | | | | | | | | | | | | | | calls, before and after inlining Clang implements the -finstrument-functions flag inherited from GCC, which inserts calls to __cyg_profile_func_{enter,exit} on function entry and exit. This is useful for getting a trace of how the functions in a program are executed. Normally, the calls remain even if a function is inlined into another function, but it is useful to be able to turn this off for users who are interested in a lower-level trace, i.e. one that reflects what functions are called post-inlining. (We use this to generate link order files for Chromium.) LLVM already has a pass for inserting similar instrumentation calls to mcount(), which it does after inlining. This patch renames and extends that pass to handle calls both to mcount and the cygprofile functions, before and/or after inlining as controlled by function attributes. Differential Revision: https://reviews.llvm.org/D39287 llvm-svn: 318195
* Add a counter-function insertion passHal Finkel2016-09-011-0/+27
As discussed in https://reviews.llvm.org/D22666, our current mechanism to support -pg profiling, where we insert calls to mcount(), or some similar function, is fundamentally broken. We insert these calls in the frontend, which means they get duplicated when inlining, and so the accumulated execution counts for the inlined-into functions are wrong. Because we don't want the presence of these functions to affect optimizaton, they should be inserted in the backend. Here's a pass which would do just that. The knowledge of the name of the counting function lives in the frontend, so we're passing it here as a function attribute. Clang will be updated to use this mechanism. Differential Revision: https://reviews.llvm.org/D22825 llvm-svn: 280347
OpenPOWER on IntegriCloud