summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ProfileData
Commit message (Collapse)AuthorAgeFilesLines
...
* [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
* [llvm-profdata] Add support for weighted merge of profile dataNathan Slingerland2015-12-041-2/+12
| | | | | | | | | | | | | | | | | | This change adds support for an optional weight when merging profile data with the llvm-profdata tool. Weights are specified by adding an option ':<weight>' suffix to the input file names. 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: dnovillo, bogner, davidxl Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14547 llvm-svn: 254669
* [llvm-profdata] Change instr prof counter overflow to saturate rather than ↵Nathan Slingerland2015-12-021-5/+6
| | | | | | | | | | | | | | discard Summary: This changes overflow handling during instrumentation profile merge. Rathar than throwing away records that would result in counter overflow, merged counts are instead clamped to the maximum representable value. A warning about counter overflow is still surfaced to the user as before. Reviewers: dnovillo, davidxl, silvas Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14893 llvm-svn: 254525
* [PGO] Add support for reading multiple versions of indexed profile format ↵Xinliang David Li2015-12-011-22/+27
| | | | | | | | | | | profile data Profile readers using incompatible on-disk hash table format can now share the same implementation and interfaces. Differential Revision: http://reviews.llvm.org/D15100 llvm-svn: 254458
* 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
* Function name cleanup (NFC)Xinliang David Li2015-11-281-4/+4
| | | | llvm-svn: 254218
* [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
* [PGO] Add mapper callback to interfaces retrieving value data for site (NFC)Xinliang David Li2015-11-241-11/+13
| | | | | | | This allows cleaner implementation and merging retrieving/mapping in one pass. llvm-svn: 254038
* [PGO] Small interface change to be profile rt ready Xinliang David Li2015-11-241-17/+3
| | | | | | | | Convert two C++ static member functions to be C APIs. This is one of the many steps to get ready to share VP writer code with profiler runtime. llvm-svn: 253999
* Minor refactor to make VP writing more efficientXinliang David Li2015-11-241-3/+1
| | | | llvm-svn: 253994
* [PGO] In llvm-profdata text dump, add comment lines as annotationsXinliang David Li2015-11-231-1/+4
| | | | llvm-svn: 253930
* [PGO] Add --text option for llvm-profdata show|merge commandsXinliang David Li2015-11-231-0/+15
| | | | | | | | | | | | | | The new option is similar to the SampleProfile dump option. - dump raw/indexed format into text profile format - merge the profile and output into text profile format. Note that Value Profiling data text format is not yet designed. That functionality will be added later. Differential Revision: http://reviews.llvm.org/D14894 llvm-svn: 253913
* Fix the Windows build, include <tuple> for std::tieReid Kleckner2015-11-201-0/+1
| | | | llvm-svn: 253698
* [llvm-profdata] Add merge() to InstrProfRecordNathan Slingerland2015-11-201-36/+18
| | | | | | | | | | | | | | | | | Summary: This change refactors two aspects of InstrProfRecord: 1) Add a merge() method to InstrProfRecord (previously InstrProfWriter combineInstrProfRecords()) in order to better encapsulate this functionality and to make the InstrProfRecord and SampleRecord APIs more consistent. 2) Make InstrProfRecord mergeValueProfData() a private method since it is only ever called internally by merge(). Reviewers: dnovillo, bogner, davidxl Subscribers: silvas, vsk, llvm-commits Differential Revision: http://reviews.llvm.org/D14786 llvm-svn: 253695
* SamplePGO - Tweak debugging output for function samples. NFC.Diego Novillo2015-11-191-9/+24
| | | | llvm-svn: 253612
* SamplePGO - Sort samples by source location when emitting as text.Diego Novillo2015-11-192-12/+18
| | | | | | | | When dumping function samples or writing them out as text format, it helps if the samples are emitted sorted by source location. The sorting of the maps is a bit slow, so we only do it on demand. llvm-svn: 253568
* Minor cleanups (from review feedback)Xinliang David Li2015-11-181-2/+4
| | | | | | | | 1. remove uneeded header inclusion 2. use reinterpret_cast instead of c ctyle 3. other format change llvm-svn: 253515
* [PGO] Value profiling supportBetul Buyukkurt2015-11-181-7/+76
| | | | | | | | | This change introduces an instrumentation intrinsic instruction for value profiling purposes, the lowering of the instrumentation intrinsic and raw reader updates. The raw profile data files for llvm-profdata testing are updated. llvm-svn: 253484
* [PGO] Move value profile data definitions out of IndexedInstrProfXinliang David Li2015-11-173-11/+7
| | | | | | | Move the data structure defintions out of the namespace. The defs will be shared by raw format. [NFC] llvm-svn: 253394
* [llvm-profdata] Improve error messaging when merging mismatched profile dataNathan Slingerland2015-11-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change tries to make the root cause of instrumented profile data merge failures clearer. Previous: $ llvm-profdata merge test_0.profraw test_1.profraw -o test_merged.profdata test_1.profraw: foo: Function count mismatch test_1.profraw: bar: Function count mismatch test_1.profraw: baz: Function count mismatch ... Changed: $ llvm-profdata merge test_0.profraw test_1.profraw -o test_merged.profdata test_1.profraw: foo: Function basic block count change detected (counter mismatch) Make sure that all profile data to be merged is generated from the same binary. test_1.profraw: bar: Function basic block count change detected (counter mismatch) test_1.profraw: baz: Function basic block count change detected (counter mismatch) ... Reviewers: dnovillo, davidxl, bogner Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14739 llvm-svn: 253384
* SamplePGO - Move debug/dump function bodies out of header files. NFC.Diego Novillo2015-11-171-0/+43
| | | | | | No point polluting the header declarations with debugging code. llvm-svn: 253361
* Fix unaligned memory read issue exposed by ubsanXinliang David Li2015-11-171-10/+10
| | | | | | | | | | Indexed profile data as designed today does not guarantee counter data to be well aligned, so reading needs to use the slower form (with memcpy). This is less than ideal and should be improved in the future (i.e., with fixed length function key instead of variable length name key). llvm-svn: 253309
* SamplePGO - Add dump routines for LineLocation, SampleRecord and FunctionSamplesDiego Novillo2015-11-133-21/+24
| | | | llvm-svn: 253071
* [llvm-profdata] Add check for text profile formats and improve error ↵Nathan Slingerland2015-11-134-11/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reporting (2nd try) Summary: This change addresses two possible instances of user error / confusion when merging sampled profile data. Previously any input that didn't match the raw or processed instrumented format would automatically be interpreted as instrumented profile text format data. No error would be reported during the merge. Example: If foo-sampled.profdata and bar-sampled.profdata are binary sampled profiles: Old behavior: $ llvm-profdata merge foo-sampled.profdata bar-sampled.profdata -output foobar-sampled.profdata $ llvm-profdata show -sample foobar-sampled.profdata error: foobar-sampled.profdata:1: Expected 'mangled_name:NUM:NUM', found lprofi This change adds basic checks for valid input data when assuming text input. It also makes error messages related to file format validity more specific about the assumbed profile data type. New behavior: $ llvm-profdata merge foo-sampled.profdata bar-sampled.profdata -o foobar-sampled.profdata error: foo.profdata: Unrecognized instrumentation profile encoding format Perhaps you forgot to use the -sample option? Reviewers: bogner, davidxl, dnovillo Subscribers: davidxl, llvm-commits Differential Revision: http://reviews.llvm.org/D14558 llvm-svn: 253009
* reverting r252916 to investigate test failureNathan Slingerland2015-11-124-42/+11
| | | | llvm-svn: 252921
* [llvm-profdata] Add check for text profile formats and improve error reportingNathan Slingerland2015-11-124-11/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change addresses two possible instances of user error / confusion when merging sampled profile data. Previously any input that didn't match the raw or processed instrumented format would automatically be interpreted as instrumented profile text format data. No error would be reported during the merge. Example: If foo-sampled.profdata and bar-sampled.profdata are binary sampled profiles: Old behavior: $ llvm-profdata merge foo-sampled.profdata bar-sampled.profdata -output foobar-sampled.profdata $ llvm-profdata show -sample foobar-sampled.profdata error: foobar-sampled.profdata:1: Expected 'mangled_name:NUM:NUM', found lprofi This change adds basic checks for valid input data when assuming text input. It also makes error messages related to file format validity more specific about the assumbed profile data type. New behavior: $ llvm-profdata merge foo-sampled.profdata bar-sampled.profdata -o foobar-sampled.profdata error: foo.profdata: Unrecognized instrumentation profile encoding format Perhaps you forgot to use the -sample option? Reviewers: bogner, davidxl, dnovillo Subscribers: davidxl, llvm-commits Differential Revision: http://reviews.llvm.org/D14558 llvm-svn: 252916
OpenPOWER on IntegriCloud