summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ProfileData/InstrProfTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [PGO] fix prof symbol lookup bugXinliang David Li2016-02-101-0/+6
| | | | | | | | | | | | Patch by Rong Xu The problem is exposed by intra-module indirect call promotion where prof symtab is created from module which does not contain all symbols from the program. With partial symtab, the result needs to be checked more strictly. llvm-svn: 260361
* Add comments to some testsXinliang David Li2016-02-091-0/+4
| | | | llvm-svn: 260200
* Further reduce test overheadXinliang David Li2016-02-091-8/+4
| | | | llvm-svn: 260198
* Simplify some expressions involving unique_ptr and ErrorOrDavid Blaikie2016-02-091-42/+42
| | | | llvm-svn: 260179
* [PGO] Add interfaces to annotate instr with VP dataXinliang David Li2016-02-041-0/+55
| | | | | | | 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-2/+6
| | | | | | | - Remove unused valuemapper parameter - add totalcount optional parameter llvm-svn: 259756
* [PGO] Profile summary reader/writer supportXinliang David Li2016-02-031-0/+39
| | | | | | | | | | 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
* Further reduce test timeXinliang David Li2016-01-301-6/+2
| | | | llvm-svn: 259285
* [Profiling] Add a -sparse mode to llvm-profdata mergeVedant Kumar2016-01-291-16/+47
| | | | | | | | | | Add an option to llvm-profdata merge for writing out sparse indexed profiles. These profiles omit InstrProfRecords for functions which are never executed. Differential Revision: http://reviews.llvm.org/D16727 llvm-svn: 259258
* Improve test speed/trial 2Xinliang David Li2016-01-291-14/+12
| | | | llvm-svn: 259253
* Revert 259242, 259243 -- irrelvante changes pulled inXinliang David Li2016-01-291-51/+13
| | | | llvm-svn: 259244
* Use range for loopXinliang David Li2016-01-291-7/+5
| | | | llvm-svn: 259243
* Improve test speed (interchange loop, reducing padding)Xinliang David Li2016-01-291-13/+53
| | | | llvm-svn: 259242
* Fix Clang-tidy modernize-use-nullptr and modernize-use-override warnings; ↵Eugene Zelenko2016-01-261-8/+9
| | | | | | | | other minor fixes. Differential revision: reviews.llvm.org/D16568 llvm-svn: 258831
* Revert 258486 -- for a better fix coming soonXinliang David Li2016-01-221-60/+55
| | | | llvm-svn: 258538
* [PGO] add an interface needed by icall promotionXinliang David Li2016-01-221-1/+3
| | | | llvm-svn: 258509
* [PGO] eliminate use of static variableXinliang David Li2016-01-221-55/+60
| | | | llvm-svn: 258486
* Fix a bug in testXinliang David Li2016-01-201-2/+2
| | | | llvm-svn: 258276
* [PGO] Add a new interface to be used by Indirect Call PromotionXinliang David Li2016-01-201-0/+36
| | | | llvm-svn: 258271
* InstrProfTest.cpp: Fix a warning. [-Wsign-compare]NAKAMURA Takumi2016-01-081-1/+1
| | | | llvm-svn: 257157
* Add value site truncation unit testXinliang David Li2016-01-081-10/+56
| | | | llvm-svn: 257153
* [PGO] Ensure vp data in indexed profile always sortedXinliang David Li2016-01-081-28/+0
| | | | | | | | | 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-081-0/+56
| | | | | | | | | | 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
* Add explicit string checks in testXinliang David Li2016-01-041-2/+15
| | | | llvm-svn: 256796
* [PGO]: Implement Func PGO name string compressionXinliang David Li2015-12-311-0/+61
| | | | | | | | | | 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
* InstrProfTest.cpp: Don't assume string literals are always merged.NAKAMURA Takumi2015-12-271-29/+37
| | | | | | | MSC18 Debug didn't merge them. FIXME: I tweaked just to appease a builder. Almost string literals should be addressed identically there. llvm-svn: 256459
* Improve InstrProfSymtab test coverageXinliang David Li2015-12-191-0/+27
| | | | llvm-svn: 256099
* [PGO] Add hash to name mapping in InstrProfSymtabXinliang David Li2015-12-191-0/+24
| | | | | | | | | Creator and lookup interfaces are added to this symtab class. The new interfaces will be used by InstrProf Readers and writer. A unit test is also added for the new APIs. llvm-svn: 256092
* [PGO] Handle and report overflow during profile merge for all types of dataNathan Slingerland2015-12-161-29/+38
| | | | | | | | | | | | 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
* [llvm-profdata] Add support for weighted merge of profile data (2nd try)Nathan Slingerland2015-12-151-2/+27
| | | | | | | | | | | | | | | | | | | | 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
* Revert "[llvm-profdata] Add support for weighted merge of profile data"Nathan Slingerland2015-12-041-20/+0
| | | | | | | | This reverts commit b7250858d96b8ce567681214273ac0e62713c661. Reverting in order to investigate Windows test failure. llvm-svn: 254687
* [llvm-profdata] Add support for weighted merge of profile dataNathan Slingerland2015-12-041-0/+20
| | | | | | | | | | | | | | | | | | 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-1/+4
| | | | | | | | | | | | | | 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
* Use nullptr (NFC)Xinliang David Li2015-12-011-1/+1
| | | | llvm-svn: 254447
* [PGO] Allow value profile writer interface to allocated target buffer Xinliang David Li2015-11-281-1/+1
| | | | | | | | | 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] Implement ValueProfiling Closure interfaces for runtime value profile dataXinliang David Li2015-11-251-0/+92
| | | | | | | | | | | | | | | | 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
* Revert the revert 253497 and 253539 - These commits aren't the cause of the ↵Daniel Sanders2015-11-201-0/+32
| | | | | | | | clang-cmake-mips failures. Sorry for the noise. llvm-svn: 253662
* Revert 253497 and 253539 to try to fix clang-cmake-mips buildbot.Daniel Sanders2015-11-201-32/+0
| | | | | | | | | | It caused link errors of the form: InstrProfiling.c:(.text.__llvm_profile_instrument_target+0x1c0): undefined reference to `__sync_fetch_and_add_8' We had a network outage at the time of the commit so the first build to show a problem is http://lab.llvm.org:8011/builders/clang-cmake-mips/builds/10827 llvm-svn: 253656
* [llvm-profdata] Add SaturatingAdd/SaturatingMultiply Helper Functions (2nd try)Nathan Slingerland2015-11-181-0/+32
| | | | | | | | | | | | | Summary: This change adds MathExtras helper functions for handling unsigned, saturating addition and multiplication. It also updates the instrumentation and sample profile merge implementations to use them. Reviewers: dnovillo, bogner, davidxl Subscribers: davidxl, llvm-commits Differential Revision: http://reviews.llvm.org/D14720 llvm-svn: 253497
* [PGO] Make indexed value profile data more compactXinliang David Li2015-11-101-1/+58
| | | | | | | | | | | | | | | | - Make indexed value profile data more compact by peeling out the per-site value count field into its own smaller sized array. - Introduced formal data structure definitions to specify value profile data layout in indexed format. Previously the layout of the data is only assumed in the client code (scattered in three different places : size computation, EmitData, and ReadData - The new data structure serves as a central place for layout documentation. - Add interfaces to force BE output for value profile data (testing purpose) - Add byte swap unit tests Differential Revision: http://reviews.llvm.org/D14401 llvm-svn: 252563
* Fix some Clang-tidy modernize warnings, other minor fixes.Eugene Zelenko2015-11-041-15/+15
| | | | | | | | Fixed warnings are: modernize-use-override, modernize-use-nullptr and modernize-redundant-void-arg. Differential revision: http://reviews.llvm.org/D14312 llvm-svn: 252087
* [PGO] Value profiling (index format) code cleanup and testingXinliang David Li2015-11-021-0/+199
| | | | | | | | | | | | | | | | | 1. Added a set of public interfaces in InstrProfRecord class to access (read/write) value profile data. 2. Changed IndexedProfile reader and writer code to use the newly defined interfaces and hide implementation details. 3. Added a couple of unittests for value profiling: - Test new interfaces to get and set value profile data - Test value profile data merging with various scenarios. No functional change is expected. The new interfaces will also make it possible to change on-disk format of value prof data to be more compact (to be submitted). llvm-svn: 251771
* InstrProf: Support for value profiling in the indexed profile formatJustin Bogner2015-09-291-6/+12
| | | | | | | | | Add support to the indexed instrprof reader and writer for the format that will be used for value profiling. Patch by Betul Buyukkurt, with minor modifications. llvm-svn: 248833
* InstrProf: Add a test for multiple copies of the same with different hashesJustin Bogner2015-06-221-0/+6
| | | | | | | | This functionality wasn't being tested. Patch by Betul Buyukkurt. llvm-svn: 240359
* Re-apply "InstrProf: Add unit tests for the profile reader and writer"Justin Bogner2015-02-181-0/+98
| | | | | | | | | | | | | | Have the InstrProfWriter return a MemoryBuffer instead of a std::string. This fixes the alignment issues the reader would hit, and it's a more appropriate type for this anyway. I've also removed an ugly helper function that's not needed since we're allowing initializer lists now, and updated some error code checks based on MSVC's issues with r229473. This reverts r229483, reapplying r229478. llvm-svn: 229602
* Revert "InstrProf: Add unit tests for the profile reader and writer"Justin Bogner2015-02-171-97/+0
| | | | | | | | | | This added API to the InstrProfWriter to write to a string so I could write unittests without using temp files. This doesn't really work, since the format has tighter alignment requirements than a char. This reverts r229478 and its follow-up, r229481. llvm-svn: 229483
* InstrProf: Add missing header from r229478Justin Bogner2015-02-171-0/+2
| | | | llvm-svn: 229481
* Re-apply "InstrProf: Add unit tests for the profile reader and writer"Justin Bogner2015-02-171-0/+95
| | | | | | | | Add these tests again, but use va_list instead of initializer lists. This reverts r229456, reapplying r229455. llvm-svn: 229478
* Revert "InstrProf: Add unit tests for the profile reader and writer"Justin Bogner2015-02-161-88/+0
| | | | | | | | Looks like the bots don't like my initializer lists. This reverts r229455 llvm-svn: 229456
* InstrProf: Add unit tests for the profile reader and writerJustin Bogner2015-02-161-0/+88
This required some minor API to be added to these types to avoid needing temp files. Also, I've used initializer lists in the tests, as MSVC 2013 claims to support them. I'll redo this without them if the bots complain. llvm-svn: 229455
OpenPOWER on IntegriCloud