summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-profdata
Commit message (Collapse)AuthorAgeFilesLines
...
* [llvm-profdata] Bring back reading profile data from STDIN.Benjamin Kramer2016-07-221-0/+7
| | | | | | This feature was lost in r276197. llvm-svn: 276407
* [profdata] Remove constructor that MSVC 2013 pretends to not understand.Benjamin Kramer2016-07-211-6/+2
| | | | | | No functionality change intended. llvm-svn: 276284
* Reapply r276185Xinliang David Li2016-07-201-10/+33
| | | | | | Fix the test case that should not depend on dir iteration order. llvm-svn: 276197
* Revert r276185 -- build bot failure Xinliang David Li2016-07-201-33/+10
| | | | llvm-svn: 276194
* [Profile] support directory reading in profile mergingXinliang David Li2016-07-201-10/+33
| | | | | | Differential Revision: http://reviews.llvm.org/D22560 llvm-svn: 276185
* Retry: [llvm-profdata] Speed up merging by using a thread poolVedant Kumar2016-07-191-23/+117
| | | | | | | | | | | | | | | | | | | | | 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-115/+23
| | | | | | | | | | | 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-23/+115
| | | | | | | | | | | | | | | | 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
* Apply another batch of fixes from clang-tidy's ↵Benjamin Kramer2016-06-171-8/+10
| | | | | | | | performance-unnecessary-value-param. Contains some manual fixes. No functionality change intended. llvm-svn: 273047
* Search for llvm-symbolizer binary in the same directory as argv[0], beforeRichard Smith2016-06-091-1/+1
| | | | | | | looking for it along $PATH. This allows installs of LLVM tools outside of $PATH to find the symbolizer and produce pretty backtraces if they crash. llvm-svn: 272232
* Retry^4 "[llvm-profdata] Add option to ingest filepaths from a file"Vedant Kumar2016-06-071-6/+59
| | | | | | | | | | Changes since the initial commit: - Use echo instead of printf. This should side-step the character escaping issues on Windows. Differential Revision: http://reviews.llvm.org/D20980 llvm-svn: 272068
* Revert "Retry^2 "[llvm-profdata] Add option to ingest filepaths from a file""Vedant Kumar2016-06-061-63/+13
| | | | | | | | | This reverts commit r271953. It's still breaking on Windows, though the list initialization issue is fixed: http://bb.pgr.jp/builders/ninja-clang-i686-msc19-R/builds/3751 llvm-svn: 271963
* Retry^2 "[llvm-profdata] Add option to ingest filepaths from a file"Vedant Kumar2016-06-061-13/+63
| | | | | | | | | | | | | Changes since the initial commit: - Normalize file paths read from the file to prevent Windows path separators from escaping parts of the path. - Since we need to store the normalized file paths in WeightedFile, don't do tricky things to keep the source MemoryBuffer alive. - Don't use list-initialization for a std::string in WeightedFile. Differential Revision: http://reviews.llvm.org/D20980 llvm-svn: 271953
* Revert "Retry "[llvm-profdata] Add option to ingest filepaths from a file"Vedant Kumar2016-06-061-58/+13
| | | | | | | | This reverts commit r271949. It breaks the Windows build: http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/12796 llvm-svn: 271952
* Retry "[llvm-profdata] Add option to ingest filepaths from a file"Vedant Kumar2016-06-061-13/+58
| | | | | | | | | | | | Changes since the initial commit: - Normalize file paths read from the file to prevent Windows path separators from escaping parts of the path. - Since we need to store the normalized file paths in WeightedFile, don't do tricky things to keep the source MemoryBuffer alive. Differential Revision: http://reviews.llvm.org/D20980 llvm-svn: 271949
* [llvm-profdata] Revert r271709 and the 3 subsequent commits - the codeChandler Carruth2016-06-041-57/+4
| | | | | | | | | | | | | | | | | | | | and/or tests aren't working on Windows currently. There seems to be some problem with quoting the file paths. I don't understand the test structure here or the code well enough to try to come up with a way to correctly handle paths with back slashes in them, and this has caused the Windows builds to be failing for 7 hours now, so I'm reverting the whole thing to bring them back to life. Sorry for the disruption, but a couple of these were bug fixes anyways that can be folded into a fresh commit. Reverts the following patches: r271756: Clean up the way we create the input filenames buffer (NFC) r271748: Fix use-after-free from discarded MemoryBuffer (NFC) r271710: Fix option description (NFC) r271709: Add option to ingest filepaths from a file llvm-svn: 271760
* [llvm-profdata] Clean up the way we create the input filenames buffer (NFC)Vedant Kumar2016-06-041-7/+14
| | | | | | | | | Create the buffer before calling parseInputFilenamesFile(), and add a comment explaining why this is done. Thanks to David Li for the suggestion! llvm-svn: 271756
* [llvm-profdata] Fix use-after-free from discarded MemoryBuffer (NFC)Vedant Kumar2016-06-031-8/+13
| | | | | | | | Thanks to Justin Bogner for pointing this out! Caught by ASAN. llvm-svn: 271748
* [llvm-profdata] Fix option description (NFC)Vedant Kumar2016-06-031-1/+1
| | | | llvm-svn: 271710
* [llvm-profdata] Add option to ingest filepaths from a fileVedant Kumar2016-06-031-4/+45
| | | | | | Differential Revision: http://reviews.llvm.org/D20980 llvm-svn: 271709
* Trim some spaces (NFC)Vedant Kumar2016-06-031-2/+0
| | | | llvm-svn: 271681
* [profile] show more statisticsXinliang David Li2016-05-231-1/+14
| | | | | | Add value profile statistics with the 'show' command. llvm-svn: 270450
* Remove specializations of ProfileSummaryEaswaran Raman2016-05-191-4/+3
| | | | | | | | 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-191-9/+10
| | | | | | | | 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-191-27/+41
| | | | | | | | | | | | | | | 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
* Revert "Retry^2 "[ProfileData] (llvm) Use Error in InstrProf and Coverage, NFC""Vedant Kumar2016-05-161-41/+27
| | | | | | | | 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-161-27/+41
| | | | | | | | | | | | | | | 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-141-41/+27
| | | | | | | 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-131-27/+41
| | | | | | | | | | | | | | 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-131-40/+27
| | | | | | | | 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-131-27/+40
| | | | | | | | | Transition InstrProf and Coverage over to the stricter Error/Expected interface. Differential Revision: http://reviews.llvm.org/D19901 llvm-svn: 269462
* Remove unused header, NFCVedant Kumar2016-05-031-1/+0
| | | | llvm-svn: 268361
* Remove every uses of getGlobalContext() in LLVM (but the C API)Mehdi Amini2016-04-141-3/+4
| | | | | | | | | | | 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
* Add a profile summary class specific to instrumentation profiles.Easwaran Raman2016-02-171-2/+2
| | | | | | | | | 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
* [PGO] Differentiate Clang instrumentation and IR level instrumentation profilesRong Xu2016-02-101-4/+11
| | | | | | | | | | | | | | | | | | | | This patch uses one bit in profile version to differentiate Clang instrumentation and IR level instrumentation profiles. PGOInstrumenation generates a COMDAT variable __llvm_profile_raw_version so that the compiler runtime can set the right profile kind. For Maco-O platform, we generate the variable as linkonce_odr linkage as COMDAT is not supported. PGOInstrumenation now checks this bit to make sure it's an IR level instrumentation profile. The patch was submitted as r260164 but reverted due to a Darwin test breakage. Original Differential Revision: http://reviews.llvm.org/D15540 Differential Revision: http://reviews.llvm.org/D17020 llvm-svn: 260385
* [PGO] Revert r260146 as it breaks Darwin platforms.Rong Xu2016-02-081-11/+4
| | | | | | | r260146 | xur | 2016-02-08 13:07:46 -0800 (Mon, 08 Feb 2016) | 13 lines [PGO] Differentiate Clang instrumentation and IR level instrumentation profiles llvm-svn: 260170
* [PGO] Differentiate Clang instrumentation and IR level instrumentation profilesRong Xu2016-02-081-4/+11
| | | | | | | | | | | | | | This patch uses one bit in profile version to differentiate Clang instrumentation and IR level instrumentation profiles. PGOInstrumenation generates a COMDAT variable __llvm_profile_raw_version so that the compiler runtime can set the right profile kind. PGOInstrumenation now checks this bit to make sure it's an IR level instrumentation profile. Differential Revision: http://reviews.llvm.org/D15540 llvm-svn: 260146
* Refactor profile summary support code. NFC.Easwaran Raman2016-02-041-0/+1
| | | | | | | | | | Summary computation is not just for instrumented profiling and so I have moved the ProfileSummary class to ProfileCommon.h (named so to allow code unrelated to summary but common to instrumented and sampled profiling to be placed there) Differential Revision: http://reviews.llvm.org/D16661 llvm-svn: 259846
* [Profiling] Add a -sparse mode to llvm-profdata mergeVedant Kumar2016-01-291-3/+7
| | | | | | | | | | 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
* Remove autoconf supportChris Bieneman2016-01-261-17/+0
| | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "I felt a great disturbance in the [build system], as if millions of [makefiles] suddenly cried out in terror and were suddenly silenced. I fear something [amazing] has happened." - Obi Wan Kenobi Reviewers: chandlerc, grosbach, bob.wilson, tstellarAMD, echristo, whitequark Subscribers: chfast, simoncook, emaste, jholewinski, tberghammer, jfb, danalbert, srhines, arsenm, dschuff, jyknight, dsanders, joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D16471 llvm-svn: 258861
* [PGO] fix a bug in profile summary computationXinliang David Li2016-01-161-1/+1
| | | | | | | | Entry block count was not counted and is corrected. Also introduce a new metric that is MaxInternalBlockCount which show command shows (as before). llvm-svn: 257987
* [PGO] Move profile summary interface/impl into InstrProf.[*] /NFCXinliang David Li2016-01-141-99/+0
| | | | llvm-svn: 257819
* llvm-profdata.cpp: Fix comment lines. [-Wdocumentation]NAKAMURA Takumi2016-01-141-3/+3
| | | | llvm-svn: 257726
* Display detailed profile summary in llvm-profdata tool.Easwaran Raman2016-01-131-16/+136
| | | | | | | | | | | This adds a detailed profile summary in llvm-profdata. The summary is in the form of one or more triples of the form (P, N, M) which is interpreted as if we look at the Top-N counts in the profile, their sum accounts for P percentage of the sum of all counts in the program and the minimum count in the Top-N is M. Differential Revision: http://reviews.llvm.org/D16005 llvm-svn: 257680
* [PGO] Improve Indexed Profile Reader efficiency Xinliang David Li2015-12-201-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | With the support of value profiling added, the Indexed prof reader gets less efficient. The prof reader initialization used to be just reading the file header, but with VP support added, initialization needs to walk through all profile keys of ondisk hash table resulting in very poor locality and large memory increase (keys are stored together with the profile data in the mapped profile buffer). Even worse, when the reader is used by the compiler (not llvm-profdata too), the penalty becomes very high as compilation of each single module requires touching profile data buffer for the whole program. In this patch, the icall target values (MD5hash) are no longer eargerly converted back to name strings when the data is read into memory. New interface is added to to profile reader so that InstrProfSymtab can be lazily created for Indexed profile reader on-demand. Creating of the symtab is intended to be used by llvm-profdata tool for symbolic dumping of VP data. It can be used with compiler (for legacy out of tree uses) too but not recommended due to compile time and memory reasons mentioned above. Some other cleanups are also included: Function Addr to md5 map is now consolated into InstrProfSymtab. InstrProfStringtab is no longer used and eliminated. llvm-svn: 256114
* [PGO] Handle and report overflow during profile merge for all types of dataNathan Slingerland2015-12-161-1/+5
| | | | | | | | | | | | 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-18/+58
| | | | | | | | | | | | | | | | | | | | 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
* Fix formatting. NFC.Diego Novillo2015-12-141-8/+5
| | | | llvm-svn: 255541
* Revert "[llvm-profdata] Add support for weighted merge of profile data"Nathan Slingerland2015-12-041-54/+16
| | | | | | | | 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-16/+54
| | | | | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud