summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ProfileData/InstrProf.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Reapply "[PGO] Fix name encoding for ObjC-like functions"Vedant Kumar2016-03-281-2/+8
| | | | | | | | | | | | | | | | | | | | | Function names in ObjC can have spaces in them. This interacts poorly with name compression, which uses spaces to separate PGO names. Fix the issue by using a different separator and update a test. I chose "\01" as the separator because 1) it's non-printable, 2) we strip it from PGO names, and 3) it's the next natural choice once "\00" is discarded (that one's overloaded). This reverts the revert commit beaf3d18. What's changed? - I fixed up the covmap-V2 binary format tests using a linux VM. - I updated the expected counts in instrprof-comdat.h to account for the fact that there have been bugfixes to clang coverage. - I added an assert to make sure we don't get bitten by this again. Differential Revision: http://reviews.llvm.org/D18516 llvm-svn: 264641
* Revert "[PGO] Fix name encoding for ObjC-like functions"Vedant Kumar2016-03-281-2/+2
| | | | | | | | | This reverts commit r264587. Reverting to investigate 6 unexpected failures on the ppc bot: http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/2822 llvm-svn: 264590
* [PGO] Fix name encoding for ObjC-like functionsVedant Kumar2016-03-281-2/+2
| | | | | | | | | | | | | | Function names in ObjC can have spaces in them. This interacts poorly with name compression, which uses spaces to separate PGO names. Fix the issue by using a different separator and update a test. I chose "\01" as the separator because 1) it's non-printable, 2) we strip it from PGO names, and 3) it's the next natural choice once "\00" is discarded (that one's overloaded). Differential Revision: http://reviews.llvm.org/D18516 llvm-svn: 264587
* [Coverage] Strip <unknown> from PGO names if no filenames are availableVedant Kumar2016-03-281-1/+1
| | | | | | Patch suggested by David Li! llvm-svn: 264586
* [Coverage] Fix the way we load "<unknown>:func" recordsVedant Kumar2016-03-281-1/+1
| | | | | | | | | When emitting coverage mappings for functions with local linkage and an unknown filename, we use "<unknown>:func" for the PGO function name. The problem is that we don't strip "<unknown>" from the name when loading coverage data, like we do for other file names. Fix that and add a test. llvm-svn: 264559
* Variable name cleanup /NFCXinliang David Li2016-03-161-5/+6
| | | | llvm-svn: 263666
* [ProfileData] Make a utility method public, NFCVedant Kumar2016-03-161-2/+2
| | | | | | | | | | | The swift frontend needs to be able to look up PGO function name variables based on the original raw function name. That's because it's not possible to create PGO function name variables while emitting swift IR. Instead, we have to create the name variables while lowering swift IR to llvm IR, at which point we fix up all calls to the increment intrinsic to point to the right name variable. llvm-svn: 263662
* Move global ID computation from Function to GlobalValue (NFC)Teresa Johnson2016-03-151-1/+1
| | | | | | | | Since the static getGlobalIdentifier and getGUID methods are now called for global values other than functions, reflect that by moving these methods to the GlobalValue class. llvm-svn: 263524
* [PGO] Add another interface for annotateValueSiteRong Xu2016-02-121-0/+7
| | | | | | | | | Add another interface to function annotateValueSite() which directly uses the VauleData array. Differential Revision: http://reviews.llvm.org/D17108 llvm-svn: 260741
* [PGO] Make the number of records for each value site metada adjustableRong Xu2016-02-101-2/+3
| | | | | | | | | | The patch adds a parameter in annotateValueSite() to control the max number of records written to the value profile meta data for each value site. The default is kept as the current value of 3. Differential Revision: http://reviews.llvm.org/D17084 llvm-svn: 260450
* Refactor PGO function naming and MD5 hashing support out of ProfileDataTeresa Johnson2016-02-091-19/+1
| | | | | | | | | | | | | | | | | | | | Summary: Move the function renaming logic into the Function class, and the MD5Hash routine into the MD5 header. This will enable these routines to be shared with ThinLTO, which will be changed to store the MD5 hash instead of full function name in the combined index for significant size reductions. And using the same function naming for locals in the function index facilitates future integration with indirect call value profiles. Reviewers: davidxl Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D17006 llvm-svn: 260197
* Function name change /NFCXinliang David Li2016-02-041-2/+2
| | | | llvm-svn: 259851
* Refactor profile summary support code. NFC.Easwaran Raman2016-02-041-50/+0
| | | | | | | | | | Summary computation is not just for instrumented profiling and so I have moved the ProfileSummary class to ProfileCommon.h (named so to allow code unrelated to summary but common to instrumented and sampled profiling to be placed there) Differential Revision: http://reviews.llvm.org/D16661 llvm-svn: 259846
* [PGO] Add interfaces to annotate instr with VP dataXinliang David Li2016-02-041-0/+87
| | | | | | | Add interfaces to do value profile data IR annnotation and read. Needed by both FE and IR based PGO. llvm-svn: 259813
* [PGO] Profile interface cleanupXinliang David Li2016-02-041-4/+3
| | | | | | | - Remove unused valuemapper parameter - add totalcount optional parameter llvm-svn: 259756
* Fix uninitiazed variable use problemXinliang David Li2016-02-031-1/+1
| | | | llvm-svn: 259630
* [PGO] Profile summary reader/writer supportXinliang David Li2016-02-031-0/+15
| | | | | | | | | | With this patch, the profile summary data will be available in indexed profile data file so that profiler reader/compiler optimizer can start to make use of. Differential Revision: http://reviews.llvm.org/D16258 llvm-svn: 259626
* [PGO] allow pgo name collector to disable compression (for testing)/NFCXinliang David Li2016-01-261-2/+3
| | | | llvm-svn: 258876
* Fix Clang-tidy modernize-use-nullptr and modernize-use-override warnings; ↵Eugene Zelenko2016-01-261-5/+4
| | | | | | | | other minor fixes. Differential revision: reviews.llvm.org/D16568 llvm-svn: 258831
* [PGO] Add a new interface to be used by Indirect Call PromotionXinliang David Li2016-01-201-0/+7
| | | | llvm-svn: 258271
* [PGO] Move profile summary interface/impl into InstrProf.[*] /NFCXinliang David Li2016-01-141-0/+35
| | | | llvm-svn: 257819
* [Support] Add saturating multiply-add support functionNathan Slingerland2016-01-121-14/+3
| | | | | | | | | | | | Summary: Add SaturatingMultiplyAdd convenience function template since A + (X * Y) comes up frequently when doing weighted arithmetic. Reviewers: davidxl, silvas Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D15385 llvm-svn: 257532
* [PGO] Fix a bug in InstProfWriter addRecordXinliang David Li2016-01-081-5/+40
| | | | | | | | | | For a new record with weight != 1, only edge profiling counters are scaled, VP data is not properly scaled. This patch refactors the code and fixes the problem. Also added sort by count interface (for follow up patch). llvm-svn: 257143
* [PGO] Simplify string parsingXinliang David Li2016-01-041-13/+3
| | | | | | Patch Suggested by Vedant. llvm-svn: 256785
* [PGO] Refactor string writer codeXinliang David Li2016-01-041-12/+18
| | | | | | | For readability and code sharing. (Adapted from Suggestions by Vedant). llvm-svn: 256784
* [PGO]: Use efficient 'join' API for uncompressed stringXinliang David Li2016-01-041-13/+5
| | | | llvm-svn: 256781
* [PGO]: reserve space for string to avoid excessive memory realloc/copy (non ↵Xinliang David Li2016-01-041-0/+6
| | | | | | linear) llvm-svn: 256776
* [PGO] simple refactoring (NFC)Xinliang David Li2016-01-031-4/+8
| | | | llvm-svn: 256695
* [PGO]: Implement Func PGO name string compressionXinliang David Li2015-12-311-2/+99
| | | | | | | | | | This is part of the effort/prepration to reduce the size instr-pgo (object, binary, memory footprint, and raw data). The functionality is currently off by default and not yet used by any clients. llvm-svn: 256667
* [PGO] Improve Indexed Profile Reader efficiency Xinliang David Li2015-12-201-31/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | With the support of value profiling added, the Indexed prof reader gets less efficient. The prof reader initialization used to be just reading the file header, but with VP support added, initialization needs to walk through all profile keys of ondisk hash table resulting in very poor locality and large memory increase (keys are stored together with the profile data in the mapped profile buffer). Even worse, when the reader is used by the compiler (not llvm-profdata too), the penalty becomes very high as compilation of each single module requires touching profile data buffer for the whole program. In this patch, the icall target values (MD5hash) are no longer eargerly converted back to name strings when the data is read into memory. New interface is added to to profile reader so that InstrProfSymtab can be lazily created for Indexed profile reader on-demand. Creating of the symtab is intended to be used by llvm-profdata tool for symbolic dumping of VP data. It can be used with compiler (for legacy out of tree uses) too but not recommended due to compile time and memory reasons mentioned above. Some other cleanups are also included: Function Addr to md5 map is now consolated into InstrProfSymtab. InstrProfStringtab is no longer used and eliminated. llvm-svn: 256114
* Minor clean up -- move large single use method out of header(NFC)Xinliang David Li2015-12-201-0/+31
| | | | llvm-svn: 256113
* [PGO] Cleanup: Move large member functions out of line (NFC)Xinliang David Li2015-12-181-2/+91
| | | | llvm-svn: 256058
* [PGO] Simplify computehash interface (NFC)Xinliang David Li2015-12-181-2/+1
| | | | llvm-svn: 256047
* Initialize all bytes in vp data (msan error)Xinliang David Li2015-12-151-4/+5
| | | | llvm-svn: 255680
* Coverage code refactoring /NFCXinliang David Li2015-12-151-0/+9
| | | | llvm-svn: 255670
* [PGO] Stop using invalid char in instr variable names.Xinliang David Li2015-12-121-1/+21
| | | | | | | | | | | | | Before the patch, -fprofile-instr-generate compile will fail if no integrated-as is specified when the file contains any static functions (the -S output is also invalid). This is the second try. The fix in this patch is very localized. Only profile symbol names of profile symbols with internal linkage are fixed up while initializer of name syms are not changes. This means there is no format change nor version bump. llvm-svn: 255434
* [PGO] Revert r255365: solution incomplete, not handling lambda yetXinliang David Li2015-12-111-5/+4
| | | | llvm-svn: 255369
* [PGO] Stop using invalid char in instr variable names.Xinliang David Li2015-12-111-4/+5
| | | | | | | | | | | | | | Before the patch, -fprofile-instr-generate compile will fail if no integrated-as is specified when the file contains any static functions (the -S output is also invalid). This patch fixed the issue. With the change, the index format version will be bumped up by 1. Backward compatibility is preserved with this change. Differential Revision: http://reviews.llvm.org/D15243 llvm-svn: 255365
* [PGO] Add version to getPGOFuncName methodXinliang David Li2015-12-051-3/+5
| | | | | | | | | Different version of indexed format may use different name uniquing schemes for static functions. Pass the version info to the name interface so that different schmes can be picked (for profile lookup). llvm-svn: 254838
* Use nullptr (NFC)Xinliang David Li2015-12-011-1/+1
| | | | llvm-svn: 254447
* [PGO] Move value profile format related structures and APIs to common fileXinliang David Li2015-11-281-177/+4
| | | | | | | | | | This is the last step to enable profile runtime to share the same value prof data format and reader/writer code with llvm host tools. The VP related data structures are moved to a section in InstrProfData.inc enabled with macro INSTR_PROF_VALUE_PROF_DATA, and common API implementations are enabled with INSTR_PROF_COMMON_API_IMPL. There should be no functional change. llvm-svn: 254235
* [PGO] Add return code for vp rt record init routine to indicate error conditionXinliang David Li2015-11-281-3/+6
| | | | llvm-svn: 254220
* [PGO] Allow value profile writer interface to allocated target buffer Xinliang David Li2015-11-281-9/+13
| | | | | | | | | Raw profile writer needs to write all data of one kind in one continuous block, so the buffer needs to be pre-allocated and passed to the writer method in pieces for function profile data. The change adds the support for raw value data writing. llvm-svn: 254219
* [PGO] Extract VP data integrity check code into a helper function (NFC)Xinliang David Li2015-11-281-17/+21
| | | | llvm-svn: 254217
* [PGO] Implement ValueProfiling Closure interfaces for runtime value profile dataXinliang David Li2015-11-251-3/+119
| | | | | | | | | | | | | | | | This is one of the many steps to commonize value profiling support between profile runtime and compiler/llvm tools. After this change, profiler runtime now can share the same C APIs to do VP serialization/deseriazation with LLVM host tools (and produces value data in identical format between indexed and raw profile). It is not yet enabled in profiler runtime yet. Also added a unit test case to test runtime profile data serialization/deserialization interfaces implemented using common closure code. llvm-svn: 254110
* [PGO] Regroup functions in better order (NFC)Xinliang David Li2015-11-251-93/+96
| | | | llvm-svn: 254080
* [PGO] Convert InstrProfRecord based serialization methods to use common C ↵Xinliang David Li2015-11-251-35/+97
| | | | | | | | | | | | | | | | methods 1. Convert serialization methods using InstrProfRecord as source into C (impl) interfaces using Closure. 2. Reimplement InstrProfRecord serialization method to use new C interface as dummy wrapper. Now it is ready to implement wrapper for runtime value profile data. (The new code need better source location -- but not changed in this patch to minimize diffs. ) llvm-svn: 254057
* [PGO] convert a subset of C++ interfaces into C (for sharing) (NFC)Xinliang David Li2015-11-251-28/+10
| | | | llvm-svn: 254056
* Move member functions closer to others of the same class (NFC)Xinliang David Li2015-11-251-14/+16
| | | | llvm-svn: 254055
* Fix function naming (NFC)Xinliang David Li2015-11-251-2/+2
| | | | llvm-svn: 254045
OpenPOWER on IntegriCloud