aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/ProfileData
AgeCommit message (Collapse)AuthorFilesLines
2016-08-12Use the range variant of find_if instead of unpacking begin/endDavid Majnemer2-12/+8
No functionality change is intended. llvm-svn: 278443
2016-07-21Rename StringMap::emplace_second to try_emplace.Benjamin Kramer1-1/+1
Coincidentally this function maps to the C++17 try_emplace. Rename it for consistentcy with C++17 std::map. NFC. llvm-svn: 276276
2016-07-19Retry: [llvm-profdata] Speed up merging by using a thread poolVedant Kumar1-0/+25
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
2016-07-19Revert "[llvm-profdata] Speed up merging by using a thread pool"Vedant Kumar1-25/+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
2016-07-18[llvm-profdata] Speed up merging by using a thread poolVedant Kumar1-0/+25
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
2016-05-19Remove specializations of ProfileSummaryEaswaran Raman2-25/+19
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
2016-05-19Retry^3 "[ProfileData] (llvm) Use Error in InstrProf and Coverage, NFC"Vedant Kumar2-48/+58
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
2016-05-16Revert "Retry^2 "[ProfileData] (llvm) Use Error in InstrProf and Coverage, NFC""Vedant Kumar2-58/+48
This reverts commit r269694. MSVC says: error C2086: 'char llvm::ProfErrorInfoBase<enum llvm::instrprof_error>::ID' : redefinition llvm-svn: 269700
2016-05-16Retry^2 "[ProfileData] (llvm) Use Error in InstrProf and Coverage, NFC"Vedant Kumar2-48/+58
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
2016-05-14Revert "Retry "[ProfileData] (llvm) Use Error in InstrProf and Coverage, NFC""Chandler Carruth2-58/+48
This reverts commit r269491. It triggers warnings with Clang, breaking builds for -Werror users including several build bots. llvm-svn: 269547
2016-05-13Retry "[ProfileData] (llvm) Use Error in InstrProf and Coverage, NFC"Vedant Kumar2-48/+58
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
2016-05-13Revert "(HEAD -> master, origin/master, origin/HEAD) [ProfileData] (llvm) ↵Vedant Kumar2-58/+48
Use Error in InstrProf and Coverage, NFC" This reverts commit r269462. It fails two llvm-profdata tests. llvm-svn: 269466
2016-05-13[ProfileData] (llvm) Use Error in InstrProf and Coverage, NFCVedant Kumar2-48/+58
Transition InstrProf and Coverage over to the stricter Error/Expected interface. Differential Revision: http://reviews.llvm.org/D19901 llvm-svn: 269462
2016-05-13Remove runtime specific code from common headerXinliang David Li1-42/+33
llvm-svn: 269384
2016-05-12[unittests] Use coveragemap_error in CoverageMappingReaderMock (NFC)Vedant Kumar1-2/+2
llvm-svn: 269324
2016-05-10Revert r269131Easwaran Raman2-67/+0
llvm-svn: 269138
2016-05-10Reapply r266477 and r266488Easwaran Raman2-0/+67
llvm-svn: 269131
2016-05-05[Coverage] Combine counts of expansion regions if there are no code regions ↵Igor Kudrin1-0/+25
for the same area. Differential Revision: http://reviews.llvm.org/D18831 llvm-svn: 268620
2016-05-03[ProfileData] Assert NoError in CoverageMappingTestVedant Kumar1-13/+13
Check for success values in the CoverageMappingTest unit test file. This is part of a series of patches to transition ProfileData over to the stricter Error/Expected interface. llvm-svn: 268420
2016-05-03[ProfileData] Assert NoError in InstrProfTestVedant Kumar1-44/+44
Check for success values in the InstrProfTest unit test file. This is part of a series of patches to transition ProfileData over to the stricter Error/Expected interface. llvm-svn: 268402
2016-04-29Move coverage related code into a separate library.Easwaran Raman2-3/+4
Differential Revision: http://reviews.llvm.org/D19333 llvm-svn: 268089
2016-04-28Fix some Clang-tidy modernize and Include What You Use warnings.Eugene Zelenko1-4/+18
Differential revision: http://reviews.llvm.org/D19673 llvm-svn: 267910
2016-04-25[Coverage] Restore the correct count value after processing a nested region ↵Igor Kudrin1-0/+20
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
2016-04-22Fix some spelling mistakesDavid Majnemer1-1/+1
llvm-svn: 267112
2016-04-18Reapply "[Coverage] Prevent detection of false instantiations in case of ↵Igor Kudrin1-0/+38
macro expansion." The root of the problem was that findMainViewFileID(File, Function) could return some ID for any given file, even though that file was not the main file for that function. This patch ensures that the result of this function is conformed with the result of findMainViewFileID(Function). This commit reapplies r266436, which was reverted by r266458, with the .covmapping file serialized in v1 format. Differential Revision: http://reviews.llvm.org/D18787 llvm-svn: 266620
2016-04-18Revert "Replace the use of MaxFunctionCount module flag"Eric Liu2-67/+0
This reverts commit r266477. This commit introduces cyclic dependency. This commit has "Analysis" depend on "ProfileData", while "ProfileData" depends on "Object", which depends on "BitCode", which depends on "Analysis". llvm-svn: 266619
2016-04-18[NFC] Header cleanupMehdi Amini1-1/+1
Removed some unused headers, replaced some headers with forward class declarations. Found using simple scripts like this one: clear && ack --cpp -l '#include "llvm/ADT/IndexedMap.h"' | xargs grep -L 'IndexedMap[<]' | xargs grep -n --color=auto 'IndexedMap' Patch by Eugene Kosov <claprix@yandex.ru> Differential Revision: http://reviews.llvm.org/D19219 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266595
2016-04-15Replace the use of MaxFunctionCount module flagEaswaran Raman2-0/+67
Adds an interface to get ProfileSummary for a module and makes InlineCost use ProfileSummary to get max function count. Differential Revision: http://reviews.llvm.org/D18622 llvm-svn: 266477
2016-04-15Revert "[Coverage] Prevent detection of false instantiations in case of ↵Igor Kudrin1-38/+0
macro expansion." This reverts commit r266436 as it broke buildbot. llvm-svn: 266458
2016-04-15[Coverage] Prevent detection of false instantiations in case of macro expansion.Igor Kudrin1-0/+38
The root of the problem was that findMainViewFileID(File, Function) could return some ID for any given file, even though that file was not the main file for that function. This patch ensures that the result of this function is conformed with the result of findMainViewFileID(Function). Differential Revision: http://reviews.llvm.org/D18787 llvm-svn: 266436
2016-04-15[Coverage] Add support for making test data for more than one function.Igor Kudrin1-83/+169
Differential Revision: http://reviews.llvm.org/D18758 llvm-svn: 266434
2016-04-14Remove every uses of getGlobalContext() in LLVM (but the C API)Mehdi Amini2-5/+7
At the same time, fixes InstructionsTest::CastInst unittest: yes you can leave the IR in an invalid state and exit when you don't destroy the context (like the global one), no longer now. This is the first part of http://reviews.llvm.org/D19094 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266379
2016-04-14[Coverage] Update testing methods to support more than two filesIgor Kudrin1-11/+58
Differential Revision: http://reviews.llvm.org/D18757 llvm-svn: 266289
2016-04-10Fix asan test failureXinliang David Li1-0/+2
llvm-svn: 265891
2016-04-10[PGO] Fix deserialize bug Xinliang David Li1-0/+40
Raw function pointer collected by value profile data may be from external functions that are not instrumented. They won't have mapping data to be used by the deserializer. Force the value to be 0 in this case. llvm-svn: 265890
2016-04-10Clean up test caseXinliang David Li1-40/+36
llvm-svn: 265887
2016-03-30[PGO] Use ArrayRef in annotateValueSite()Rong Xu1-1/+2
Using ArrayRef in annotateValueSite's parameter instead of using an array and it's size. Differential Revision: http://reviews.llvm.org/D18568 llvm-svn: 264879
2016-03-28Sample profile summary cleanupEaswaran Raman1-1/+1
Replace references to MaxHeadSamples with MaxFunctionCount Differential Revision: http://reviews.llvm.org/D18522 llvm-svn: 264686
2016-03-28Reapply (2x) "[PGO] Fix name encoding for ObjC-like functions"Vedant Kumar1-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). What's changed since the original commit? - I fixed up the covmap-V2 binary format tests using a linux VM. - I weakened the CHECK lines in instrprof-comdat.h to account for the fact that there have been bugfixes to clang coverage. These will be fixed up in a follow-up. - I added an assert to make sure we don't get bitten by this again. - I constructed the c-general.profraw file without name compression enabled to appease some bots. Differential Revision: http://reviews.llvm.org/D18516 llvm-svn: 264658
2016-03-28Revert "Reapply "[PGO] Fix name encoding for ObjC-like functions""Vedant Kumar1-2/+2
This reverts commit r264641 to investigate why c-general.test is failing on the bots. llvm-svn: 264643
2016-03-28Reapply "[PGO] Fix name encoding for ObjC-like functions"Vedant Kumar1-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). 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
2016-03-28Revert "[PGO] Fix name encoding for ObjC-like functions"Vedant Kumar1-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
2016-03-28[PGO] Fix name encoding for ObjC-like functionsVedant Kumar1-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
2016-03-28[Coverage] Strip <unknown> from PGO names if no filenames are availableVedant Kumar1-4/+6
Patch suggested by David Li! llvm-svn: 264586
2016-03-28[Coverage] Fix the way we load "<unknown>:func" recordsVedant Kumar1-0/+15
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
2016-03-22[unittests] clang-format a line, NFCVedant Kumar1-3/+1
llvm-svn: 264059
2016-03-18Interface to get/set profile summary metadata to moduleEaswaran Raman2-0/+27
Differential Revision: http://reviews.llvm.org/D17894 llvm-svn: 263835
2016-03-14Remove code added for debugging purposes. NFC.Easwaran Raman1-3/+3
llvm-svn: 263500
2016-03-03Fix memory leak in tests.Easwaran Raman2-0/+2
llvm-svn: 262674
2016-03-03Use LineLocation instead of CallsiteLocation to index callsite profile.Dehao Chen1-0/+2
Summary: With discriminator, LineLocation can uniquely identify a callsite without the need to specifying callee name. Remove Callee function name from the key, and put it in the value (FunctionSamples). Reviewers: davidxl, dnovillo Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D17827 llvm-svn: 262634