summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ProfileData
Commit message (Collapse)AuthorAgeFilesLines
...
* [PGO] Fix bogus warning for merging empty llvm profile fileRong Xu2016-10-192-0/+5
| | | | | | | | | | | | | | | | | Profile runtime can generate an empty raw profile (when there is no function in the shared library). This empty profile is treated as a text format profile. A test format profile without the flag of "#IR" is thought to be a clang generated profile. So in llvm profile merging, we will get a bogus warning of "Merge IR generated profile with Clang generated profile." The fix here is to skip the empty profile (when the buffer size is 0) for profile merge. Reviewers: vsk, davidxl Differential Revision: http://reviews.llvm.org/D25687 llvm-svn: 284659
* [Coverage] Support loading multiple binaries into a CoverageMappingVedant Kumar2016-10-141-16/+40
| | | | | | | | | | Add support for loading multiple coverage readers into a single CoverageMapping instance. This should make it easier to prepare a unified coverage report for multiple binaries. Differential Revision: https://reviews.llvm.org/D25535 llvm-svn: 284251
* [Coverage] Factor out logic to create FunctionRecords (NFC)Vedant Kumar2016-10-121-40/+45
| | | | llvm-svn: 284063
* NFC Add constPiotr Padlewski2016-09-301-3/+3
| | | | llvm-svn: 282952
* [Coverage] Make sorting criteria for CounterMappingRegions local.Igor Kudrin2016-08-311-2/+10
| | | | | | | | | | | | Move the comparison function into the only place there it is used, i.e. the call to std::stable_sort in CoverageMappingWriter::write(). Add sorting by region kinds as it is required to ensure stable order in our tests and to simplify D23987. Differential Revision: https://reviews.llvm.org/D24034 llvm-svn: 280198
* [ThinLTO] Indirect call promotion fixes for promoted local functionsTeresa Johnson2016-08-291-0/+3
| | | | | | | | | | | | | | | | | | | Summary: Fix a couple issues limiting the application of indirect call promotion in ThinLTO mode: - Invoke indirect call promotion before globalopt, since it may eliminate imported functions which appear unreferenced. - Invoke indirect call promotion with InLTO=true so that the PGOFuncName metadata is used to get the name for locals which would have been renamed during promotion. Reviewers: davidxl, mehdi_amini Subscribers: Prazek, llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D24004 llvm-svn: 280024
* Use range algorithms instead of unpacking begin/endDavid Majnemer2016-08-111-2/+1
| | | | | | No functionality change is intended. llvm-svn: 278417
* Fix some Clang-tidy modernize and Include What You Use warnings.Eugene Zelenko2016-08-111-3/+16
| | | | | | Differential revision: https://reviews.llvm.org/D23291 llvm-svn: 278364
* [PGO] Make needsComdatForCounter() available (NFC)Rong Xu2016-07-211-0/+26
| | | | | | | | | | Move needsComdatForCounter() to lib/ProfileData/InstrProf.cpp from lib/Transforms/Instrumentation/InstrProfiling.cpp to make is available for other files. Differential Revision: https://reviews.llvm.org/D22643 llvm-svn: 276330
* Retry: [llvm-profdata] Speed up merging by using a thread poolVedant Kumar2016-07-191-0/+8
| | | | | | | | | | | | | | | | | | | | | Add a "-j" option to llvm-profdata to control the number of threads used. Auto-detect NumThreads when it isn't specified, and avoid spawning threads when they wouldn't be beneficial. I tested this patch using a raw profile produced by clang (147MB). Here is the time taken to merge 4 copies together on my laptop: No thread pool: 112.87s user 5.92s system 97% cpu 2:01.08 total With 2 threads: 134.99s user 26.54s system 164% cpu 1:33.31 total Changes since the initial commit: - When handling odd-length inputs, call ThreadPool::wait() before merging the last profile. Should fix a race/off-by-one (see r275937). Differential Revision: https://reviews.llvm.org/D22438 llvm-svn: 275938
* Revert "[llvm-profdata] Speed up merging by using a thread pool"Vedant Kumar2016-07-191-8/+0
| | | | | | | | | | | This reverts commit r275921. It broke the ppc64be bot: http://lab.llvm.org:8011/builders/clang-ppc64be-linux-multistage/builds/3537 I'm not sure why it broke, but based on the output, it looks like an off-by-one (one profile left un-merged). llvm-svn: 275937
* [llvm-profdata] Speed up merging by using a thread poolVedant Kumar2016-07-181-0/+8
| | | | | | | | | | | | | | | | Add a "-j" option to llvm-profdata to control the number of threads used. Auto-detect NumThreads when it isn't specified, and avoid spawning threads when they wouldn't be beneficial. I tested this patch using a raw profile produced by clang (147MB). Here is the time taken to merge 4 copies together on my laptop: No thread pool: 112.87s user 5.92s system 97% cpu 2:01.08 total With 2 threads: 134.99s user 26.54s system 164% cpu 1:33.31 total Differential Revision: https://reviews.llvm.org/D22438 llvm-svn: 275921
* [Coverage] Mark a few more methods const (NFC)Vedant Kumar2016-07-151-4/+4
| | | | llvm-svn: 275514
* [Coverage] Mark a few methods const (NFC)Vedant Kumar2016-07-131-1/+1
| | | | llvm-svn: 275337
* [PGO] Don't include full file path in static function profile counter namesXinliang David Li2016-07-121-3/+12
| | | | | | | Patch by Jake VanAdrighem Differential Revision: http://reviews.llvm.org/D22028 llvm-svn: 275193
* Revert "[Coverage] Move logic to encode filenames and mappings into llvm (NFC)"Vedant Kumar2016-06-291-49/+8
| | | | | | | | | This reverts commit 520a8298d8ef676b5da617ba3d2c7fa37381e939 (r273055). This is breaking stage2 instrumented builds with "malformed coverage data" errors. llvm-svn: 274106
* Revert "[Coverage] Clarify ownership of a MemoryBuffer in the reader (NFC)"Vedant Kumar2016-06-292-9/+8
| | | | | | This reverts commit 1037ef2574adde2103ad221d63834c3e1df4a776. llvm-svn: 274105
* [Coverage] Clarify ownership of a MemoryBuffer in the reader (NFC)Vedant Kumar2016-06-212-8/+9
| | | | | | | | Pass a `MemoryBuffer &` to BinaryCoverageReader::create() instead of a `std::unique_ptr<MemoryBuffer> &`. This makes it easier to reason about the ownership of the buffer at a glance. llvm-svn: 273326
* [Coverage] Move logic to encode filenames and mappings into llvm (NFC)Vedant Kumar2016-06-171-8/+49
| | | | | | | | | | | | | | | Currently, frontends which emit source-based code coverage have to duplicate logic to encode filenames and raw coverage mappings properly. This violates an abstraction layer and forces frontends to copy tricky code. Introduce llvm::coverage::encodeFilenamesAndRawMappings() to take care of this. This will help us experiment with zlib-compressing coverage mapping data. llvm-svn: 273055
* [Coverage] Get rid of an input/output parameter (NFC)Vedant Kumar2016-06-171-10/+17
| | | | | | | | | | | | readFunctionRecords is used to iterate through the entries of the coverage mapping section. Instead of expecting the function to update the iterator through a `const char *&` parameter, just return the updated iterator. This will help us experiment with zlib-compressing coverage mapping data. llvm-svn: 273052
* Bug fix remove another illegal char from prof symbol nameXinliang David Li2016-06-101-1/+1
| | | | | | | | End-end test with no integrated assembly should be added at some point (not done now because some bots are not properly configured to support -no-integrated-as) llvm-svn: 272376
* Change llvm-objdump, llvm-nm and llvm-size when reporting an object file errorKevin Enderby2016-05-311-2/+2
| | | | | | | | | | | | | | | | | | | when the object is from a slice of a Mach-O Universal Binary use something like "foo.o (for architecture i386)" as part of the error message when expected. Also fixed places in these tools that were ignoring object file errors from MachOUniversalBinary::getAsObjectFile() when the code moved on to see if the slice was an archive. To do this MachOUniversalBinary::getAsObjectFile() and MachOUniversalBinary::getObjectForArch() were changed from returning ErrorOr<...> to Expected<...> then that was threaded up to its users. Converting these interfaces to Expected<> from ErrorOr<> does involve touching a number of places. To contain the changes for now the use of errorToErrorCode() is still used in two places yet to be fully converted. llvm-svn: 271332
* [ProfileData] Clean up string handling a bit.Benjamin Kramer2016-05-293-13/+11
| | | | llvm-svn: 271180
* [ProfData] Remove global constructor from ProfileSummaryBuilder.Benjamin Kramer2016-05-271-5/+7
| | | | | | No functionality change intended. llvm-svn: 271021
* Add FIXMEs to all derived classes of std::error_category.Peter Collingbourne2016-05-243-0/+9
| | | | | | | | This helps make clear that we're moving away from std::error_code. Differential Revision: http://reviews.llvm.org/D20592 llvm-svn: 270604
* [ProfileData] Thread unique_ptr through the summary builder to avoid leaks.Benjamin Kramer2016-05-205-12/+12
| | | | llvm-svn: 270195
* [Coverage] Fix an issue where improper coverage mapping data could be loaded ↵Igor Kudrin2016-05-201-18/+88
| | | | | | | | | | | | | | for an inline function. If an inline function is observed but unused in a translation unit, dummy coverage mapping data with zero hash is stored for this function. If such a coverage mapping section came earlier than real one, the latter was ignored. As a result, llvm-cov was unable to show coverage information for those functions. Differential Revision: http://reviews.llvm.org/D20286 llvm-svn: 270194
* Remove specializations of ProfileSummaryEaswaran Raman2016-05-195-22/+23
| | | | | | | | This removes the subclasses of ProfileSummary, moves the members of the derived classes to the base class. Differential Revision: http://reviews.llvm.org/D20390 llvm-svn: 270143
* Move ProfileSummary to IR.Easwaran Raman2016-05-197-386/+146
| | | | | | | | This splits ProfileSummary into two classes: a ProfileSummary class that has methods to convert from/to metadata and a ProfileSummaryBuilder class that computes the profiles summary which is in ProfileData. Differential Revision: http://reviews.llvm.org/D20314 llvm-svn: 270136
* Retry^3 "[ProfileData] (llvm) Use Error in InstrProf and Coverage, NFC"Vedant Kumar2016-05-195-307/+326
| | | | | | | | | | | | | | | Transition InstrProf and Coverage over to the stricter Error/Expected interface. Changes since the initial commit: - Fix error message printing in llvm-profdata. - Check errors in loadTestingFormat() + annotateAllFunctions(). - Defer error handling in InstrProfIterator to InstrProfReader. - Remove the base ProfError class to work around an MSVC ICE. Differential Revision: http://reviews.llvm.org/D19901 llvm-svn: 270020
* [Coverage] Ensure that coverage mapping data has an expected alignment in ↵Igor Kudrin2016-05-181-0/+7
| | | | | | | | | | | | | 'covmapping' files. Coverage mapping data is organized in a sequence of blocks, each of which is expected to be aligned by 8 bytes. This feature is used when reading those blocks, see VersionedCovMapFuncRecordReader::readFunctionRecords(). If a misaligned covearge mapping data has more than one block, it causes llvm-cov to fail. Differential Revision: http://reviews.llvm.org/D20285 llvm-svn: 269887
* Revert "Retry^2 "[ProfileData] (llvm) Use Error in InstrProf and Coverage, NFC""Vedant Kumar2016-05-165-324/+305
| | | | | | | | This reverts commit r269694. MSVC says: error C2086: 'char llvm::ProfErrorInfoBase<enum llvm::instrprof_error>::ID' : redefinition llvm-svn: 269700
* Retry^2 "[ProfileData] (llvm) Use Error in InstrProf and Coverage, NFC"Vedant Kumar2016-05-165-305/+324
| | | | | | | | | | | | | | | Transition InstrProf and Coverage over to the stricter Error/Expected interface. Changes since the initial commit: - Address undefined-var-template warning. - Fix error message printing in llvm-profdata. - Check errors in loadTestingFormat() + annotateAllFunctions(). - Defer error handling in InstrProfIterator to InstrProfReader. Differential Revision: http://reviews.llvm.org/D19901 llvm-svn: 269694
* Revert "Retry "[ProfileData] (llvm) Use Error in InstrProf and Coverage, NFC""Chandler Carruth2016-05-145-324/+305
| | | | | | | This reverts commit r269491. It triggers warnings with Clang, breaking builds for -Werror users including several build bots. llvm-svn: 269547
* Retry "[ProfileData] (llvm) Use Error in InstrProf and Coverage, NFC"Vedant Kumar2016-05-135-305/+324
| | | | | | | | | | | | | | Transition InstrProf and Coverage over to the stricter Error/Expected interface. Changes since the initial commit: - Fix error message printing in llvm-profdata. - Check errors in loadTestingFormat() + annotateAllFunctions(). - Defer error handling in InstrProfIterator to InstrProfReader. Differential Revision: http://reviews.llvm.org/D19901 llvm-svn: 269491
* Revert "(HEAD -> master, origin/master, origin/HEAD) [ProfileData] (llvm) ↵Vedant Kumar2016-05-135-323/+304
| | | | | | | | Use Error in InstrProf and Coverage, NFC" This reverts commit r269462. It fails two llvm-profdata tests. llvm-svn: 269466
* [ProfileData] (llvm) Use Error in InstrProf and Coverage, NFCVedant Kumar2016-05-135-304/+323
| | | | | | | | | Transition InstrProf and Coverage over to the stricter Error/Expected interface. Differential Revision: http://reviews.llvm.org/D19901 llvm-svn: 269462
* [ProfileData] Use SoftInstrProfErrors to count soft errors, NFCVedant Kumar2016-05-112-44/+56
| | | | | | Differential Revision: http://reviews.llvm.org/D20082 llvm-svn: 269222
* Use an emplace_back for consistency, NFCVedant Kumar2016-05-111-1/+1
| | | | llvm-svn: 269199
* Revert r269131Easwaran Raman2016-05-101-44/+0
| | | | llvm-svn: 269138
* Reapply r266477 and r266488Easwaran Raman2016-05-101-0/+44
| | | | llvm-svn: 269131
* [PGO] Use rsplit to parse value-data line in text profile file.Rong Xu2016-05-061-1/+1
| | | | | | | | | The value-data line is <PGOFuncName>:<Count_Value>. PGOFuncName might contain ':' for the internal linkage functions. We therefore need to use rsplit, rather split, to extract the data from the line. This fixes the error when merging a text profile file to an indexed profile file. llvm-svn: 268818
* Add a note about the "entry count" used the profile summarySean Silva2016-05-051-0/+4
| | | | | | Thanks to David Li for the clarification. llvm-svn: 268669
* [profile] Remove unneeded field in raw profile readerXinliang David Li2016-05-051-8/+6
| | | | | | Differential Revision: http://reviews.llvm.org/D19956 llvm-svn: 268667
* [Coverage] Combine counts of expansion regions if there are no code regions ↵Igor Kudrin2016-05-051-16/+31
| | | | | | | | for the same area. Differential Revision: http://reviews.llvm.org/D18831 llvm-svn: 268620
* [ProfileData] Propagate an error from InstrProfSymtabVedant Kumar2016-05-031-4/+8
| | | | | | | | | CovMapFuncReader::get should propagate up errors from InstrProfSymtab. This is part of a series of patches to transition ProfileData over to the stricter Error/Expected interface. llvm-svn: 268428
* [ProfileData] Add error codes for compression failuresVedant Kumar2016-05-031-9/+16
| | | | | | | | | | Be more specific in describing compression failures. Also, check for this kind of error in emitNameData(). This is part of a series of patches to transition ProfileData over to the stricter Error/Expected interface. llvm-svn: 268400
* Remove redundant return, NFCVedant Kumar2016-05-021-1/+0
| | | | llvm-svn: 268312
* Move coverage related code into a separate library.Easwaran Raman2016-04-297-8/+44
| | | | | | Differential Revision: http://reviews.llvm.org/D19333 llvm-svn: 268089
* [Coverage] Restore the correct count value after processing a nested region ↵Igor Kudrin2016-04-251-37/+58
| | | | | | | | | | | | | in case of combined regions. If several regions cover the same area of code, we have to restore the combined value for that area when return from a nested region. This patch achieves that by combining regions before calling buildSegments. Differential Revision: http://reviews.llvm.org/D18610 llvm-svn: 267390
OpenPOWER on IntegriCloud