summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/profile/InstrProfilingValue.c
Commit message (Collapse)AuthorAgeFilesLines
* Reland "[CMake] Support installation of InstrProfData.inc"Petr Hosek2019-11-221-1/+1
| | | | | | | | | | | This header fragment is useful on its own for any consumer that wants to use custom instruction profile runtime with the LLVM instrumentation. The concrete use case is in Fuchsia's kernel where we want to use instruction profile instrumentation, but we cannot use the compiler-rt runtime because it's not designed for use in the kernel environment. This change allows installing this header as part of compiler-rt. Differential Revision: https://reviews.llvm.org/D64532
* Revert "[CMake] Support installation of InstrProfData.inc"Petr Hosek2019-11-221-1/+1
| | | | | This reverts commit f11bc1776fd2815b60e0b1ed97be00b517348162 since it's failing to build on some bots.
* [CMake] Support installation of InstrProfData.incPetr Hosek2019-11-221-1/+1
| | | | | | | | | | | This header fragment is useful on its own for any consumer that wants to use custom instruction profile runtime with the LLVM instrumentation. The concrete use case is in Fuchsia's kernel where we want to use instruction profile instrumentation, but we cannot use the compiler-rt runtime because it's not designed for use in the kernel environment. This change allows installing this header as part of compiler-rt. Differential Revision: https://reviews.llvm.org/D64532
* [InstrProf] Implement static profdata registrationReid Kleckner2019-02-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The motivating use case is eliminating duplicate profile data registered for the same inline function in two object files. Before this change, users would observe multiple symbol definition errors with VC link, but links with LLD would succeed. Users (Mozilla) have reported that PGO works well with clang-cl and LLD, but when using LLD without this static registration, we would get into a "relocation against a discarded section" situation. I'm not sure what happens in that situation, but I suspect that duplicate, unused profile information was retained. If so, this change will reduce the size of such binaries with LLD. Now, Windows uses static registration and is in line with all the other platforms. Reviewers: davidxl, wmi, inglorion, void, calixte Subscribers: mgorny, krytarowski, eraman, fedor.sergeev, hiraditya, #sanitizers, dmajor, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D57929 llvm-svn: 353547
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [compiler-rt] Remove unused formal parameters from allocateOneNode. NFC.Matt Davis2018-10-091-3/+2
| | | | | | | | | | | | | | Summary: This is just a minor cleanup to the allocateOneNode interface. The formals are no-longer used, so I just removed them. Reviewers: davidxl, void Reviewed By: davidxl Subscribers: dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D52509 llvm-svn: 344073
* [profile] Fix value profile runtime merging issuesRong Xu2018-04-021-9/+24
| | | | | | | | | | | | | | | | This patch fixes the following issues: (1) The strong definition of the merge hook function was not working which breaks the online value profile merging. This patch removes the weak attribute of VPMergeHook and assigns the value dynamically. (2) Truncate the proifle file so that we don't have garbage data at the end of the file. (3) Add new __llvm_profile_instrument_target_value() interface to do the value profile update in batch. This is needed as the original incremental by 1 in __llvm_profile_instrument_target() is too slow for online merge. Differential Revision: https://reviews.llvm.org/D44847 llvm-svn: 328987
* [profile] Port the runtime to Solaris (retry)Vedant Kumar2017-12-141-3/+5
| | | | | | | | | | | | | This includes a few nice bits of refactoring (e.g splitting out the exclusive locking code into a common utility). Hopefully the Windows support is fixed now. Patch by Rainer Orth! Differential Revision: https://reviews.llvm.org/D40944 llvm-svn: 320731
* Revert "(HEAD -> master, origin/master, origin/HEAD) [profile] Port the ↵Vedant Kumar2017-12-141-5/+3
| | | | | | | | | | | runtime to Solaris" This reverts commit r320726. It looks like flock isn't available on Windows: http://lab.llvm.org:8011/builders/sanitizer-windows/builds/21317/steps/build%20compiler-rt/logs/stdio llvm-svn: 320728
* [profile] Port the runtime to SolarisVedant Kumar2017-12-141-3/+5
| | | | | | | | | | | This includes a few nice bits of refactoring (e.g splitting out the exclusive locking code into a common utility). Patch by Rainer Orth! Differential Revision: https://reviews.llvm.org/D40944 llvm-svn: 320726
* Change INSTR_PROF_DEFAULT_NUM_VAL_PER_SITE from 8 to 16.Dehao Chen2017-07-281-1/+1
| | | | | | | | | | | | | | Summary: In the current implementation, the defaul number of values per site tracked by value profiler is 8, which is too small and could introduce inaccuracies to profile. Changing it to 16 will be able to gain more accurate value profiler. Reviewers: davidxl, tejohnson Reviewed By: tejohnson Subscribers: sanjoy, llvm-commits Differential Revision: https://reviews.llvm.org/D35964 llvm-svn: 309388
* [PGO] Value profile support for value rangesRong Xu2017-03-151-0/+29
| | | | | | | | | This patch adds profile run time support to profile a range of values. This interface will be used in profiling the size of memory intrinsic calls. Differential Revision: http://reviews.llvm.org/D28964 llvm-svn: 297895
* [Profile] Fix value profiler eviction bugXinliang David Li2016-11-291-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D27224 llvm-svn: 288204
* Fix most MSVC warnings in compiler-rt profiling libraryReid Kleckner2016-06-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here's the warnings and how they were fixed: - InstrProfilingUtil.c(110): warning C4013: '_open_osfhandle' undefined; assuming extern returning int Include io.h to get the prototype. - warning C4005: 'FILE_MAP_EXECUTE': macro redefinition Stop trying to support pre-XP versions of Windows, don't attempt to define this macro. - InstrProfilingWriter.c(271): warning C4221: nonstandard extension used: 'Data': cannot be initialized using address of automatic variable 'Header' - InstrProfilingWriter.c(275): warning C4221: nonstandard extension used: 'Data': cannot be initialized using address of automatic variable 'Zeroes' Turn this warning off. This is definitely legal in C++, all compilers accept it, and I only have room for half of one language standard in my brain. - InstrProfilingValue.c(320): warning C4113: 'uint32_t (__cdecl *)()' differs in parameter lists from 'uint32_t (__cdecl *)(void)' Fix this with an explicit (void) in the prototype. - InstrProfilingMerge.c.obj : warning LNK4006: _VPMergeHook already defined in InstrProfilingMergeFile.c.obj; second definition ignored Last remaining warning. This is from linking a selectany definition with a strong definition. We need to sort out weak symbols in compiler-rt in general, though. llvm-svn: 273026
* [profile] Fix PR/27917Xinliang David Li2016-05-311-3/+4
| | | | | | Skip the last (possibly) incomplete node from padding bytes. llvm-svn: 271349
* Local var name change /NFCXinliang David Li2016-05-311-19/+19
| | | | llvm-svn: 271304
* Add portable macro in common headerXinliang David Li2016-05-261-6/+1
| | | | llvm-svn: 270928
* Add segment prefix for darwinXinliang David Li2016-05-261-1/+6
| | | | llvm-svn: 270875
* Fix windows bot failureXinliang David Li2016-05-261-0/+2
| | | | llvm-svn: 270864
* [profile] pre-allocate a small counter set in profile runtimeXinliang David Li2016-05-261-18/+23
| | | | | | | | Tested with relavant benchmarks in SPEC2006 Differential Revision: http://reviews.llvm.org/D20651 llvm-svn: 270862
* [profile] Add early checking to bypass node pointer updateXinliang David Li2016-05-251-3/+8
| | | | llvm-svn: 270766
* [profile] Don't return `Node` when it is null.Sean Silva2016-05-251-5/+7
| | | | | | | | | The max warning check was masking the "return 0" codepath. See the thread "Warnings and compile-time failure on 458.sjeng" for more info. llvm-svn: 270762
* [profile] clean up runtime warnings.Xinliang David Li2016-05-231-3/+7
| | | | | | | | o make warning message more meaningful to users. o add suggestion to fix the problem o limit the max number of output. llvm-svn: 270483
* [profile] initialize static pool properly Xinliang David Li2016-05-221-10/+9
| | | | | | | Remove dependency on runtime initializer to avoid issues related to initialization order. llvm-svn: 270371
* [profile] Static counter allocation for value profiling (part-2)Xinliang David Li2016-05-211-10/+37
| | | | | | Differential Revision: http://reviews.llvm.org/D20460 llvm-svn: 270337
* Use C-style comment.Sean Silva2016-05-201-1/+1
| | | | | | | I think we allow use of C99 for libprofile, but use a C-style comment for consistency. llvm-svn: 270187
* Add #include for PS4 getenv shim.Sean Silva2016-05-201-0/+1
| | | | llvm-svn: 270179
* [profile] entry eviction support in value profilerXinliang David Li2016-05-191-1/+45
| | | | | | Differential revision: http://reviews.llvm.org/D20408 llvm-svn: 270141
* [profile] Allow max vals per site to be controllable at runtimeXinliang David Li2016-05-181-1/+13
| | | | llvm-svn: 269993
* [profile] minor code restructuring /NFCXinliang David Li2016-05-161-5/+6
| | | | | | | This is one of the enabler patch to allow value profiler to allocate counter statically. llvm-svn: 269689
* [profile] Eliminate dynamic memory allocation for vp writingXinliang David Li2016-05-141-105/+78
| | | | | | | | | | This is part-3 of the effort to eliminate dependency on libc allocator in instr profiler runtime. With this change, the profile dumper is completely free of malloc/calloc. Value profile instr API implementation is the only remaining piece with calloc dependency. llvm-svn: 269576
* [profile] Code refactoringXinliang David Li2016-05-121-0/+112
| | | | | | | Move runtime specific code from the common header file to runtime source. llvm-svn: 269357
* cleanup: Enforce caller to set total size to avoid redundant size computeXinliang David Li2016-05-111-0/+1
| | | | llvm-svn: 269237
* Reapply r268840: [profile] Simplify value profile writingXinliang David Li2016-05-101-43/+13
| | | | | | | Revert r268864 that reverted 268840 after underlying problem is fixed for arm bot. llvm-svn: 268992
* Revert "[profile] Simplify value profile writing"Renato Golin2016-05-071-13/+43
| | | | | | | | This reverts commit r268840, as it breaks Thumb2 self-hosting. There is something unstable in the profiling for Thumb2 that needs to be sorted out before we continue implementing these changes to the profiler. See PR27667. llvm-svn: 268864
* [profile] Simplify value profile writingXinliang David Li2016-05-071-43/+13
| | | | | | | | With this patch, value data are longer pre-collected before writing. The code is simplified and requires less heap space for dumping. llvm-svn: 268840
* Minor cleanupXinliang David Li2016-03-061-12/+0
| | | | | | move a function def to InstrProfilingUtil.c llvm-svn: 262785
* [profile] Compute number of data entries correctlyVedant Kumar2016-02-261-2/+2
| | | | | | | | | | | | | | | | Compiler-rt miscalculates the number of entries in the __llvm_prf_data section on i386 Darwin. This results in a number of test failures (which we started catching after r261344). The fix we attempted earlier is insufficient (r261683). It caused some tests to start passing again, but that hid the fact that we drop some data entries. This patch should fix the real problem. It fixes the way we compute DataSize by taking into account the way the Darwin linker lays out __llvm_prf_data. Differential Revision: http://reviews.llvm.org/D17623 llvm-svn: 261957
* [profile] Fix iteration over profile data entriesVedant Kumar2016-02-231-1/+1
| | | | | | | | | | | | | | Fix a crash when gathering value profile data on i386 Darwin. The Darwin linker shrinks sections containing aligned structures when padding is not explicitly added to the end of the structure. When iterating over these structures, be sure to not walk past the end of the section. No tests added, since running `ninja check-profile` on i386 Darwin is enough to reproduce the original crash. llvm-svn: 261683
* [PGO] Use new macro introduced/NFCXinliang David Li2016-01-081-1/+1
| | | | llvm-svn: 257147
* [PGO]: Do not update Data->Value field during profile write.Xinliang David Li2015-12-291-91/+33
| | | | | | | | | | The profile reader no longer depends on this field to be updated and point to owning func's vp data. The VP data also no longer needs to be allocated in a contiguous memory space. Differential Revision: http://reviews.llvm.org/D15258 llvm-svn: 256543
* [PGO] cleanup: unify prefix for portability macrosXinliang David Li2015-12-161-9/+10
| | | | llvm-svn: 255748
* [PGO] Split value profiling runtime into its own fileXinliang David Li2015-12-101-0/+237
Value profile runtime depends on libc which breaks buffer API implemenation with current file organization. Test case is also updated to check more symbols. llvm-svn: 255294
OpenPOWER on IntegriCloud