summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [PGO] Use template file to define runtime structuresXinliang David Li2015-11-051-26/+24
| | | | | | | | | | | With this change, instrumentation code and reader/write code related to profile data structs are kept strictly in-sync. THis will be extended to cfe and compile-rt references as well. Differential Revision: http://reviews.llvm.org/D13843 llvm-svn: 252113
* [PGO] Do not emit runtime hook user function for LinuxXinliang David Li2015-10-291-0/+5
| | | | | | | | | | Clang driver now injects -u<hook_var> flag in the linker command line, in which case user function is not needed any more. Differential Revision: http://reviews.llvm.org/D14033 llvm-svn: 251612
* Add more intrumentation/runtime helper interfaces (NFC)Xinliang David Li2015-10-231-25/+17
| | | | | | | | | | | This patch converts the remaining references to literal strings for names of profile runtime entites (such as profile runtime hook, runtime hook use function, profile init method, register function etc). Also added documentation for all the new interfaces. llvm-svn: 251093
* Add helper functions and remove hard coded references to instProf related ↵Xinliang David Li2015-10-221-12/+16
| | | | | | | | | | | | name/name-prefixes This is a clean up patch that defines instr prof section and variable name prefixes in a common header with access helper functions. clang FE change will be done as a follow up once this patch is in. Differential Revision: http://reviews.llvm.org/D13919 llvm-svn: 251058
* [PGO] Eliminate prof data register calls on FreeBSD platformXinliang David Li2015-10-191-1/+3
| | | | | | | This is a follow up patch of r250199 after verifying the start/stop section symbols work as spected on FreeBSD. llvm-svn: 250679
* [PGO]: Eliminate calls to __llvm_profile_register_function for Linux.Xinliang David Li2015-10-131-0/+3
| | | | | | | | | On Linux, the profile runtime can use __start_SECTNAME and __stop_SECTNAME symbols defined by the linker to locate the start and end location of a named section (with C name). This eliminates the need for instrumented binary to call __llvm_profile_register_function during start-up time. llvm-svn: 250199
* Instrumentation: Remove ilist iterator implicit conversions, NFCDuncan P. N. Exon Smith2015-10-131-1/+1
| | | | llvm-svn: 250186
* Put profile variables of COMDAT functions to it's own COMDAT group.Wei Mi2015-09-231-6/+10
| | | | | | | | | | | | | | | | | In -fprofile-instr-generate compilation, to remove the redundant profile variables for the COMDAT functions, these variables are placed in the same COMDAT group as its associated function. This way when the COMDAT function is not picked by the linker, those profile variables will also not be output in the final binary. This may cause warning when mix link objects built w and wo -fprofile-instr-generate. This patch puts the profile variables for COMDAT functions to its own COMDAT group to avoid the problem. Patch by xur. Differential Revision: http://reviews.llvm.org/D12248 llvm-svn: 248440
* Tidy comment.Diego Novillo2015-06-291-1/+1
| | | | llvm-svn: 240987
* Tidy code in InstrProfiling.cpp. NFC.Diego Novillo2015-06-041-8/+8
| | | | | | | | | Removed the redundant "llvm::" from class names in InstrProfiling.cpp clang-format is ran on the changes. Patch from Betul Buyukkurt. llvm-svn: 239034
* Final fix for PR 23499 and IR test case.Diego Novillo2015-05-271-5/+5
| | | | | | | | | | | This fixes a bit I forgot in r238335. In addition to the data record and the counter, we can also move the name of the counter to the comdat for the associated function. I'm also adding an IR test case to check that these three elements are placed in the proper comdat. llvm-svn: 238351
* Fix PR 23499 - Avoid multiple profile counters for functions in comdat sections.Diego Novillo2015-05-271-0/+6
| | | | | | | | Counter symbols created for linkonce functions are not discarded by ELF linkers unless the symbols are placed in the same comdat section as its associated function. llvm-svn: 238335
* Simplify IRBuilder::CreateCall* by using ArrayRef+initializer_list/braced ↵David Blaikie2015-05-181-1/+1
| | | | | | init only llvm-svn: 237624
* InstrProf: Update name of compiler-rt routine for setting filenameJustin Bogner2015-05-121-1/+1
| | | | | | Patch by Teresa Johnson. llvm-svn: 237186
* InstrProf: Instrumenter support for setting profile output from command lineJustin Bogner2015-04-301-3/+23
| | | | | | | | | | | | | | | This change is the second of 3 patches to add support for specifying the profile output from the command line via -fprofile-instr-generate=<path>, where the specified output path/file will be overridden by the LLVM_PROFILE_FILE environment variable. This patch adds the necessary support to the llvm instrumenter, specifically a new member of GCOVOptions for clang to save the specified filename, and support for calling the new compiler-rt interface from __llvm_profile_init. Patch by Teresa Johnson. Thanks! llvm-svn: 236288
* InstrProf: Make the __llvm_profile_runtime_user symbol hiddenJustin Bogner2015-02-251-0/+1
| | | | | | | | | This symbol exists only to pull in the required pieces of the runtime, so nothing ever needs to refer to it. Making it hidden avoids the potential for issues with duplicate symbols when linking profiled libraries together. llvm-svn: 230566
* InstrProf: Lower coverage mappings by setting their sections appropriatelyJustin Bogner2015-02-111-0/+41
| | | | | | | | | | | | | | | Add handling for __llvm_coverage_mapping to the InstrProfiling pass. We need to make sure the constant and any profile names it refers to are in the correct sections, which is easier and cleaner to do here where we have to know about profiling sections anyway. This is really tricky to test without a frontend, so I'm committing the test for the fix in clang. If anyone knows a good way to test this within LLVM, please let me know. Fixes PR22531. llvm-svn: 228793
* InstrProf: An intrinsic and lowering for instrumentation based profilingJustin Bogner2014-12-081-0/+309
Introduce the ``llvm.instrprof_increment`` intrinsic and the ``-instrprof`` pass. These provide the infrastructure for writing counters for profiling, as in clang's ``-fprofile-instr-generate``. The implementation of the instrprof pass is ported directly out of the CodeGenPGO classes in clang, and with the followup in clang that rips that code out to use these new intrinsics this ends up being NFC. Doing the instrumentation this way opens some doors in terms of improving the counter performance. For example, this will make it simple to experiment with alternate lowering strategies, and allows us to try handling profiling specially in some optimizations if we want to. Finally, this drastically simplifies the frontend and puts all of the lowering logic in one place. llvm-svn: 223672
OpenPOWER on IntegriCloud