summaryrefslogtreecommitdiffstats
path: root/llvm/utils/opt-viewer/opt-viewer.py
Commit message (Collapse)AuthorAgeFilesLines
* [opt-viewer] Unique across the different jobs as wellAdam Nemet2017-01-271-24/+11
| | | | llvm-svn: 293264
* [opt-viewer] Make sorting for the index page deterministicAdam Nemet2017-01-271-2/+2
| | | | | | Break the tie between entries with identical hotness deterministically. llvm-svn: 293263
* [opt-viewer] Include the function in the remark keyAdam Nemet2017-01-271-1/+1
| | | | | | Avoid uniquing remarks with different the inlining context (Function). llvm-svn: 293262
* [opt-viewer] Put critical items in parallelAdam Nemet2017-01-271-42/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Put opt-viewer critical items in parallel Patch by Brian Cain! Requires features from Python 2.7 **Performance** Below are performance results across various configurations. These were taken on an i5-5200U (dual core + HT). They were taken with a small subset of the YAML output of building Python 3.6.0b3 with LTO+PGO. 60 YAML files. "multiprocessing" is the current submission contents. "baseline" is as of 544f14c6b2a07a94168df31833dba9dc35fd8289 (I think this is aka r287505). "ImportError" vs "class<...CLoader>" below are just confirming the expected configuration (with/without CLoader). The below was measured on AMD A8-5500B (4 cores) with 224 input YAML files, showing a ~1.75x speed increase over the baseline with libYAML. I suspect it would scale well on high-end servers. ``` **************************************** MULTIPROCESSING **************************************** PyYAML: Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: cannot import name CLoader Python 2.7.10 489.42user 5.53system 2:38.03elapsed 313%CPU (0avgtext+0avgdata 400308maxresident)k 0inputs+31392outputs (0major+473540minor)pagefaults 0swaps PyYAML+libYAML: <class 'yaml.cyaml.CLoader'> Python 2.7.10 78.69user 5.45system 0:32.63elapsed 257%CPU (0avgtext+0avgdata 398560maxresident)k 0inputs+31392outputs (0major+542022minor)pagefaults 0swaps PyPy/PyYAML: Traceback (most recent call last): File "<builtin>/app_main.py", line 75, in run_toplevel File "<builtin>/app_main.py", line 601, in run_it File "<string>", line 1, in <module> ImportError: cannot import name 'CLoader' Python 2.7.9 (2.6.0+dfsg-3, Jul 04 2015, 05:43:17) [PyPy 2.6.0 with GCC 4.9.3] 154.27user 8.12system 0:53.83elapsed 301%CPU (0avgtext+0avgdata 627960maxresident)k 808inputs+30376outputs (0major+727994minor)pagefaults 0swaps **************************************** BASELINE **************************************** PyYAML: Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: cannot import name CLoader Python 2.7.10 358.08user 4.05system 6:08.37elapsed 98%CPU (0avgtext+0avgdata 315004maxresident)k 0inputs+31392outputs (0major+85252minor)pagefaults 0swaps PyYAML+libYAML: <class 'yaml.cyaml.CLoader'> Python 2.7.10 50.32user 3.30system 0:56.59elapsed 94%CPU (0avgtext+0avgdata 307296maxresident)k 0inputs+31392outputs (0major+79335minor)pagefaults 0swaps PyPy/PyYAML: Traceback (most recent call last): File "<builtin>/app_main.py", line 75, in run_toplevel File "<builtin>/app_main.py", line 601, in run_it File "<string>", line 1, in <module> ImportError: cannot import name 'CLoader' Python 2.7.9 (2.6.0+dfsg-3, Jul 04 2015, 05:43:17) [PyPy 2.6.0 with GCC 4.9.3] 72.94user 5.18system 1:23.41elapsed 93%CPU (0avgtext+0avgdata 455312maxresident)k 0inputs+30392outputs (0major+110280minor)pagefaults 0swaps ``` Reviewers: fhahn, anemet Reviewed By: anemet Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D26967 llvm-svn: 293261
* [opt-viewer] Add support for libYAML for faster parsingAdam Nemet2016-11-151-2/+12
| | | | | | | | | | | | | | | | | | | | | | This results in a speed-up of over 6x on sqlite3. Before: $ time -p /org/llvm/utils/opt-viewer/opt-viewer.py ./MultiSource/Applications/sqlite3/CMakeFiles/sqlite3.dir/sqlite3.c.opt.yaml html real 415.07 user 410.00 sys 4.66 After with libYAML: $ time -p /org/llvm/utils/opt-viewer/opt-viewer.py ./MultiSource/Applications/sqlite3/CMakeFiles/sqlite3.dir/sqlite3.c.opt.yaml html real 63.96 user 60.03 sys 3.67 I followed these steps to get libYAML working with PyYAML: http://rmcgibbo.github.io/blog/2013/05/23/faster-yaml-parsing-with-libyaml/ llvm-svn: 286942
* [opt-viewer] Don't fail with remarks without debug locationAdam Nemet2016-11-141-2/+2
| | | | llvm-svn: 286861
* [opt-viewer] Make it work in the absence of hotness informationAdam Nemet2016-11-111-12/+30
| | | | | | In this case the index page is sorted by the source location. llvm-svn: 286572
* [opt-viewer] PEPify opt-viewer.pyMandeep Singh Grang2016-11-111-5/+18
| | | | | | | | | | Reviewers: anemet Subscribers: fhahn Differential Revision: https://reviews.llvm.org/D26535 llvm-svn: 286564
* [opt-viewer] Add column number supportAdam Nemet2016-11-111-3/+8
| | | | | | | With this the yellow (bubble) part of the remark shows up under the corresponding expression. llvm-svn: 286545
* [opt-viewer] Display inlining contextAdam Nemet2016-11-111-0/+18
| | | | | | | | | | | When a function is inlined, each instance is optimized in their own inlining context. This can produce different remarks all pointing to the same source line. This adds a new column on the source view to display the inlining context. llvm-svn: 286537
* [opt-viewer] Add option to set source directoryAdam Nemet2016-11-111-1/+22
| | | | llvm-svn: 286536
* [opt-viewer] Mention Pygments in the descriptionAdam Nemet2016-11-111-1/+1
| | | | llvm-svn: 286535
* [opt-viewer] Add syntax highlightingAdam Nemet2016-11-111-1/+7
| | | | | | Uses pygments. llvm-svn: 286532
* [opt-viewer] Avoid duplicated remarksAdam Nemet2016-11-101-4/+13
| | | | | | | This can happen if a pass is run multiple times or if the code is in a header file which is included multiple times. llvm-svn: 286489
* [opt-viewer] Avoid division by zeroAdam Nemet2016-11-071-1/+1
| | | | llvm-svn: 286172
* [OptDiag, opt-viewer] Save callee's location and display as linkAdam Nemet2016-11-071-8/+24
| | | | | | | | | | | | | With this we get a new field in the YAML record if the value being streamed out has a debug location. For examples, please see the changes to the tests. This is then used in opt-viewer to display a link for the callee function in the inlining remarks. Differential Revision: https://reviews.llvm.org/D26366 llvm-svn: 286169
* [opt-viewer] Remove unnecessary call to demangleAdam Nemet2016-10-111-1/+1
| | | | llvm-svn: 283898
* [opt-viewer] Print hotness as percentage of the maximum hotnessAdam Nemet2016-10-111-2/+9
| | | | llvm-svn: 283897
* [opt-viewer] Convert another HTML output to use a multiline stringAdam Nemet2016-10-111-10/+16
| | | | llvm-svn: 283896
* New utility to visualize optimization recordsAdam Nemet2016-10-071-0/+189
This is a new tool built on top of the new YAML ouput generated from optimization remarks. It produces HTML for easy navigation and visualization. The tool assumes that hotness information for the remarks is available (the YAML file was produced with PGO). It uses hotness to list the remarks prioritized by the hotness on the index page. Clicking the source location of the remark in the list takes you the source where the remarks are rendedered inline in the source. For now, the tool is meant as prototype. It's written in Python. It uses PyYAML to parse the input. Differential Revision: https://reviews.llvm.org/D25348 llvm-svn: 283571
OpenPOWER on IntegriCloud