aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/ProfileData/InstrProfTest.cpp
AgeCommit message (Collapse)AuthorFilesLines
2017-07-06Simplify InstrProfRecord tests, eliminating named temporaries in favor of ↵David Blaikie1-75/+40
braced init args This will also simplify an API transition and class renaming coming soon. llvm-svn: 307236
2017-06-20[ProfileData] PR33517: Check for failure of symtab creationVedant Kumar1-5/+11
With PR33517, it became apparent that symbol table creation can fail when presented with malformed inputs. This patch makes that sort of error detectable, so llvm-cov etc. can fail more gracefully. Specifically, we now check that function names within the symbol table aren't empty. Testing: check-{llvm,clang,profile}, some unit test updates. llvm-svn: 305765
2017-06-04Fixed warning: must specify at least one argument for '...' parameter.Galina Kistanova1-1/+1
llvm-svn: 304676
2016-08-12Use the range variant of find_if instead of unpacking begin/endDavid Majnemer1-6/+4
No functionality change is intended. llvm-svn: 278443
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 Raman1-12/+9
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 Kumar1-39/+49
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 Kumar1-49/+39
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 Kumar1-39/+49
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 Carruth1-49/+39
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 Kumar1-39/+49
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 Kumar1-49/+39
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 Kumar1-39/+49
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-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-22Fix some spelling mistakesDavid Majnemer1-1/+1
llvm-svn: 267112
2016-04-14Remove every uses of getGlobalContext() in LLVM (but the C API)Mehdi Amini1-2/+3
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-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-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-22[unittests] clang-format a line, NFCVedant Kumar1-3/+1
llvm-svn: 264059
2016-03-18Interface to get/set profile summary metadata to moduleEaswaran Raman1-0/+14
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 Raman1-0/+1
llvm-svn: 262674
2016-03-01Metadata support for profile summary.Easwaran Raman1-20/+32
This adds support to convert ProfileSummary object to Metadata and create a ProfileSummary object from metadata. This would allow attaching profile summary information to Module allowing optimization passes to use it. llvm-svn: 262360
2016-02-17Add a profile summary class specific to instrumentation profiles.Easwaran Raman1-5/+5
Modify ProfileSummary class to make it not instrumented profile specific. Add a new InstrumentedProfileSummary class that inherits from ProfileSummary. Differential Revision: http://reviews.llvm.org/D17310 llvm-svn: 261119
2016-02-12[PGO] Add another interface for annotateValueSiteRong Xu1-0/+20
Add another interface to function annotateValueSite() which directly uses the VauleData array. Differential Revision: http://reviews.llvm.org/D17108 llvm-svn: 260741
2016-02-10[PGO] Make the number of records for each value site metada adjustableRong Xu1-10/+31
The patch adds a parameter in annotateValueSite() to control the max number of records written to the value profile meta data for each value site. The default is kept as the current value of 3. Differential Revision: http://reviews.llvm.org/D17084 llvm-svn: 260450
2016-02-10[PGO] fix prof symbol lookup bugXinliang David Li1-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
2016-02-09Add comments to some testsXinliang David Li1-0/+4
llvm-svn: 260200
2016-02-09Further reduce test overheadXinliang David Li1-8/+4
llvm-svn: 260198
2016-02-09Simplify some expressions involving unique_ptr and ErrorOrDavid Blaikie1-42/+42
llvm-svn: 260179
2016-02-04[PGO] Add interfaces to annotate instr with VP dataXinliang David Li1-0/+55
Add interfaces to do value profile data IR annnotation and read. Needed by both FE and IR based PGO. llvm-svn: 259813
2016-02-04[PGO] Profile interface cleanupXinliang David Li1-2/+6
- Remove unused valuemapper parameter - add totalcount optional parameter llvm-svn: 259756
2016-02-03[PGO] Profile summary reader/writer supportXinliang David Li1-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
2016-01-30Further reduce test timeXinliang David Li1-6/+2
llvm-svn: 259285
2016-01-29[Profiling] Add a -sparse mode to llvm-profdata mergeVedant Kumar1-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
2016-01-29Improve test speed/trial 2Xinliang David Li1-14/+12
llvm-svn: 259253
2016-01-29Revert 259242, 259243 -- irrelvante changes pulled inXinliang David Li1-51/+13
llvm-svn: 259244
2016-01-29Use range for loopXinliang David Li1-7/+5
llvm-svn: 259243
2016-01-29Improve test speed (interchange loop, reducing padding)Xinliang David Li1-13/+53
llvm-svn: 259242
2016-01-26Fix Clang-tidy modernize-use-nullptr and modernize-use-override warnings; ↵Eugene Zelenko1-8/+9
other minor fixes. Differential revision: reviews.llvm.org/D16568 llvm-svn: 258831