summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/tools/llvm-exegesis/ClusteringTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [llvm-exegesis] Introduce a 'naive' clustering algorithm (PR40880)Roman Lebedev2019-03-281-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is an alternative to D59539. Let's suppose we have measured 4 different opcodes, and got: `0.5`, `1.0`, `1.5`, `2.0`. Let's suppose we are using `-analysis-clustering-epsilon=0.5`. By default now we will start processing the `0.5` point, find that `1.0` is it's neighbor, add them to a new cluster. Then we will notice that `1.5` is a neighbor of `1.0` and add it to that same cluster. Then we will notice that `2.0` is a neighbor of `1.5` and add it to that same cluster. So all these points ended up in the same cluster. This may or may not be a correct implementation of dbscan clustering algorithm. But this is rather horribly broken for the reasons of comparing the clusters with the LLVM sched data. Let's suppose all those opcodes are currently in the same sched cluster. If i specify `-analysis-inconsistency-epsilon=0.5`, then no matter the LLVM values this cluster will **never** match the LLVM values, and thus this cluster will **always** be displayed as inconsistent. The solution is obviously to split off some of these opcodes into different sched cluster. But how do i do that? Out of 4 opcodes displayed in the inconsistency report, which ones are the "bad ones"? Which ones are the most different from the checked-in data? I'd need to go in to the `.yaml` and look it up manually. The trivial solution is to, when creating clusters, don't use the full dbscan algorithm, but instead "pick some unclustered point, pick all unclustered points that are it's neighbor, put them all into a new cluster, repeat". And just so as it happens, we can arrive at that algorithm by not performing the "add neighbors of a neighbor to the cluster" step. But that won't work well once we teach analyze mode to operate in on-1D mode (i.e. on more than a single measurement type at a time), because the clustering would depend on the order of the measurements. Instead, let's just create a single cluster per opcode, and put all the points of that opcode into said cluster. And simultaneously check that every point in that cluster is a neighbor of every other point in the cluster, and if they are not, the cluster (==opcode) is unstable. This is //yet another// step to bring me closer to being able to continue cleanup of bdver2 sched model.. Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=40880 | PR40880 ]]. Reviewers: courbet, gchatelet Reviewed By: courbet Subscribers: tschuett, jdoerfert, RKSimon, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59820 llvm-svn: 357152
* [llvm-exegesis] Fix compilation before c++17.Clement Courbet2019-03-221-1/+1
| | | | | | | ClusteringTest.cpp:25:23: error: constexpr variable cannot have non-literal type 'const llvm::exegesis::(anonymous namespace)::(lambda at /home/buildslave/ps4-buildslave4/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.src/unittests/tools/llvm-exegesis/ClusteringTest.cpp:25:35)' static constexpr auto HasPoints = [](const std::vector<int> &Indices) { llvm-svn: 356748
* [llvm-exegesis] Add clustering test.Clement Courbet2019-03-221-5/+37
| | | | | | | | | | | | Summary: To show that dbscan is insensitive to the order of the points. Subscribers: tschuett, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59693 llvm-svn: 356747
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [llvm-exegesis] Move namespace exegesis inside llvm::Fangrui Song2018-10-221-0/+2
| | | | | | | | | | | | | | | | Summary: This allows simplifying references of llvm::foo with foo when the needs come in the future. Reviewers: courbet, gchatelet Reviewed By: gchatelet Subscribers: javed.absar, tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D53455 llvm-svn: 344922
* [llvm-exegesis] Get rid of debug_string.Clement Courbet2018-09-261-9/+9
| | | | | | | | | | | | | | | | Summary: THis is a backwards-compatible change (existing files will work as expected). See PR39082. Reviewers: gchatelet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D52546 llvm-svn: 343108
* [llvm-exegesis] Output the unscaled value as well as the scaled one.Clement Courbet2018-09-261-9/+15
| | | | | | | | | | | | Summary: See PR38936 for context. Reviewers: gchatelet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D52500 llvm-svn: 343081
* [llvm-exegesis] Analysis output uses HTML.Clement Courbet2018-05-221-0/+14
| | | | | | | | | | | | Summary: This makes the report much more readable. Reviewers: gchatelet Subscribers: tschuett, mgrang, craig.topper, RKSimon, llvm-commits Differential Revision: https://reviews.llvm.org/D47189 llvm-svn: 332979
* Re-land r331622 "[llvm-exegesis] Add a library to cluster benchmark results."Clement Courbet2018-05-071-0/+86
| | | | | | Add missing move. llvm-svn: 331624
* Revert r331622 "[llvm-exegesis] Add a library to cluster benchmark results."Clement Courbet2018-05-071-86/+0
| | | | | | Breaks build over llvm::Error copy construction. llvm-svn: 331623
* [llvm-exegesis] Add a library to cluster benchmark results.Clement Courbet2018-05-071-0/+86
Reviewers: gchatelet Subscribers: mgorny, tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D46432 llvm-svn: 331622
OpenPOWER on IntegriCloud