summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ProfileData
Commit message (Collapse)AuthorAgeFilesLines
...
* [Coverage] move a local var to be BinaryCoverageReader's memberXinliang David Li2016-01-181-8/+11
| | | | | | | | The symtab is logically referenced beyond the call to the create method. This changes makes sure its lifetime matches that of the reader. llvm-svn: 258036
* Fix -Wmismatched-tags warning/errorXinliang David Li2016-01-151-1/+2
| | | | llvm-svn: 257924
* [PGO] Commonize (more) index profile file and buffer writer.Xinliang David Li2016-01-151-33/+70
| | | | | | | | | | | | | | | | The file and buffer writer code are mostly shared except for the stream back-patching. This is because raw_string_ostream does not support seek like interface. The result is that the data patching code needs to be pushed to the caller which is not quite readable (passing around offset, value etc). This also makes future enhancement (which needs more patching) more difficult (and can make impl messy). In this patch, two types of streams needed by the writer are now unified with same set of interfaces under ProfOStream class. The patch method is added so that common implementation becomes cleaner. It also enables future enhancement. Should be NFC. llvm-svn: 257921
* [PGO] Move profile summary interface/impl into InstrProf.[*] /NFCXinliang David Li2016-01-141-0/+35
| | | | llvm-svn: 257819
* Rename local variable to avoid conflictXinliang David Li2016-01-141-5/+5
| | | | llvm-svn: 257748
* Cleanup: shorten prefix to consistent with other decls /NFCXinliang David Li2016-01-141-10/+8
| | | | llvm-svn: 257744
* [PGO] clean up and documentationXinliang David Li2016-01-142-4/+5
| | | | | | | Introduce enum for indexed format versions and document indexed format change history. llvm-svn: 257737
* Add virtual dtorXinliang David Li2016-01-141-0/+2
| | | | llvm-svn: 257734
* [Coverage] introduce class hierarchy (funcRecordReader) to support multiple ↵Xinliang David Li2016-01-131-22/+82
| | | | | | | | | | | | | versions of coverage data [resubmit after fixing build bot failures: qualify make_unique and eliminate -Wcovered-switch-default warning. With the planned size reduction change, the coverage format version is expected to be bumped up. This patch adds necessary support such that backward compatibility can be kept with maximal code sharing. Reading different versions of coverage data just requires instantiating the reader according to the version. No functional change is intended. Differiential Revision: http://reviews.llvm.org/D16133 llvm-svn: 257708
* Revert r257699 -- windows buildbot failure TBIXinliang David Li2016-01-131-85/+22
| | | | llvm-svn: 257703
* [Coverage] introduce class hierarchy (funcRecordReader) to support multiple ↵Xinliang David Li2016-01-131-22/+85
| | | | | | | | | | | | versions of coverage data With the planned size reduction change, the coverage format version is expected to be bumped up. This patch adds necessary support such that backward compatibility can be kept with maximal code sharing. Reading different versions of coverage data just requires instantiating the reader according to the version. No functional change is intended. Differiential Revision: http://reviews.llvm.org/D16133 llvm-svn: 257699
* [Coverage] Refactor coverage mapping reader code Xinliang David Li2016-01-131-17/+13
| | | | | | | | | | | | | | (Resubmit after fixing a typo that breaks test on big endian machines) In this refactoring, member functions are introduced to access CovMap header/func record members and hide layout details. This will enable further code restructuring to support reading multiple versions of coverage mapping data with shared/templatized code. (When coveremap format version changes, backward compatibtility should be preserved). llvm-svn: 257571
* Rollback r257551 -- unexpected test failures TBIXinliang David Li2016-01-131-13/+17
| | | | llvm-svn: 257564
* [Coverage] Refactor coverage mapping reader code /NFCXinliang David Li2016-01-131-17/+13
| | | | | | | | | | | | | (Resubmit after fixing build bot failures) In this refactoring, member functions are introduced to access CovMap header/func record members and hide layout details. This will enable further code restructuring to support reading multiple versions of coverage mapping data with shared/templatized code. (When coveremap format version changes, backward compatibtility should be preserved). llvm-svn: 257551
* Rollback r257547 -- buildbot failure TBIXinliang David Li2016-01-131-13/+17
| | | | llvm-svn: 257549
* [Coverage] Refactor coverage mapping reader code /NFCXinliang David Li2016-01-131-17/+13
| | | | | | | | | | | In this refactoring, member functions are introduced to access CovMap header/func record members and hide layout details. This will enable further code restructuring to support reading multiple versions of coverage mapping data with shared/templatized code. (When coveremap format version changes, backward compatibtility should be preserved). llvm-svn: 257547
* [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
* Move coveragemap_error enum into coverage namespace and InstrProf.h /NFCXinliang David Li2016-01-101-1/+1
| | | | llvm-svn: 257295
* [PGO] Ensure vp data in indexed profile always sortedXinliang David Li2016-01-081-0/+2
| | | | | | | | | Done in InstrProfWriter to eliminate the need for client code to do the sorting. The operation is done once and reused many times so it is more efficient. Update unit test to remove sorting. Also update expected output of affected tests. llvm-svn: 257145
* [PGO] Fix a bug in InstProfWriter addRecordXinliang David Li2016-01-082-16/+43
| | | | | | | | | | 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] Minor refactoring /NFCXinliang David Li2016-01-071-5/+1
| | | | | | Move common defs into common header files. llvm-svn: 257108
* [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] Code refactoring to use header struct def /NFCXinliang David Li2016-01-031-5/+10
| | | | llvm-svn: 256712
* [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
* [ProfileData] Make helper function static.Benjamin Kramer2015-12-241-1/+1
| | | | | | No functional change. llvm-svn: 256375
* Fix a latent UAF bug in profwriterXinliang David Li2015-12-201-0/+2
| | | | llvm-svn: 256116
* [PGO] Improve Indexed Profile Reader efficiency Xinliang David Li2015-12-203-73/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-182-3/+2
| | | | llvm-svn: 256047
* [PGO] InstrPGO and coverage code refactoring (NFC)Xinliang David Li2015-12-171-46/+33
| | | | | | | | | | Introduce a new class InstrProfSymtab to abstract the PGO symbol table for prof and coverage reader. The symtab is is to lookup function's PGO name using function keys. The first user of the class is CoverageMapping Reader. More will follow. llvm-svn: 255862
* [PGO] Handle and report overflow during profile merge for all types of dataNathan Slingerland2015-12-162-7/+12
| | | | | | | | | | | | Summary: Surface counter overflow when merging profile data. Merging still occurs on overflow but counts saturate to the maximum representable value. Overflow is reported to the user. Reviewers: davidxl, dnovillo, silvas Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D15547 llvm-svn: 255825
* 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-152-13/+14
| | | | llvm-svn: 255670
* [llvm-profdata] Add support for weighted merge of profile data (2nd try)Nathan Slingerland2015-12-151-2/+12
| | | | | | | | | | | | | | | | | | | | Summary: This change adds support for specifying a weight when merging profile data with the llvm-profdata tool. Weights are specified by using the --weighted-input=<weight>,<filename> option. Input files not specified with this option (normal positional list after options) are given a default weight of 1. Adding support for arbitrary weighting of input profile data allows for relative importance to be placed on the input data from multiple training runs. Both sampled and instrumented profiles are supported. Reviewers: davidxl, dnovillo, bogner, silvas Subscribers: silvas, davidxl, llvm-commits Differential Revision: http://reviews.llvm.org/D15306 llvm-svn: 255659
* [PGO] Value profiling text format reader/writer supportXinliang David Li2015-12-142-1/+99
| | | | | | | | | This patch adds the missing functionality in parsable text format support for value profiling. Differential Revision: http://reviews.llvm.org/D15212 llvm-svn: 255523
* [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] Read VP raw data without depending on the Value fieldXinliang David Li2015-12-111-3/+9
| | | | | | | | | | | | | | | | Before this patch, each function's on-disk VP data is 'pointed' to by the Value field of per-function ProfileData structue, and read relies on this field (relocated with ValueDataDelta field) to read the value data. However this means the Value field needs to be updated during runtime before dumping, which creates undesirable data races. With this patch, the reading of VP data no longer depends on Value field. There is no format change. ValueDataDelta header field becomes obsolute but will be kept for compatibility reason (will be removed next time the raw format change is needed). llvm-svn: 255329
* [ProfileData] clang-format TextInstrProfReader::hasFormat. NFC.Vedant Kumar2015-12-111-2/+3
| | | | llvm-svn: 255317
* Format fix (NFC)Xinliang David Li2015-12-101-2/+4
| | | | llvm-svn: 255313
* [ProfileData] Add unit test infrastructure for sample profile reader/writerNathan Slingerland2015-12-102-12/+54
| | | | | | | | | | | | | | | Summary: Adds support for in-memory round-trip of sample profile data along with basic round trip unit tests. This will also make it easier to include unit tests for future changes to sample profiling. Reviewers: davidxl, dnovillo, silvas Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D15211 llvm-svn: 255264
* [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
* Revert "[llvm-profdata] Add support for weighted merge of profile data"Nathan Slingerland2015-12-041-12/+2
| | | | | | | | This reverts commit b7250858d96b8ce567681214273ac0e62713c661. Reverting in order to investigate Windows test failure. llvm-svn: 254687
* [PGO] Unify VP data format between raw and indexed profile (Reader)Xinliang David Li2015-12-041-38/+11
| | | | | | | | | | | With the latest refactoring and code sharing patches landed, it is possible to unify the value profile implementation between raw and indexed profile. This is the patch in raw profile reader that uses the common interface. Differential Revision: http://reviews.llvm.org/D15056 llvm-svn: 254677
OpenPOWER on IntegriCloud