1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
llvm-mirror/unittests
Roman Lebedev 079fdb41d4 [llvm-exegesis] Introduce a 'naive' clustering algorithm (PR40880)
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
2019-03-28 08:55:01 +00:00
..
ADT [ADT] Update SmallVectorTest.EmplaceBack tests after rL356312 2019-03-26 05:33:52 +00:00
Analysis [NewPM] Fix a nasty bug with analysis invalidation in the new PM. 2019-03-28 00:51:36 +00:00
AsmParser Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BinaryFormat [MsgPack] Removed MsgPackTypes 2019-03-13 18:56:33 +00:00
Bitcode Replace llvm::isPodLike<...> by llvm::is_trivially_copyable<...> 2019-01-20 21:19:56 +00:00
CodeGen [Subtarget] Merge ProcSched and ProcDesc arrays in MCSubtargetInfo into a single array. 2019-03-05 18:54:38 +00:00
DebugInfo [DWARFFormValue] Cleanup DWARFFormValue interface. (NFC) 2019-02-27 00:58:09 +00:00
Demangle Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
ExecutionEngine [opaque pointer types] Pass value type to LoadInst creation. 2019-02-01 20:44:24 +00:00
FuzzMutate Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IR [ConstantRangeTest] Add exhaustive intersectWith() test 2019-03-27 20:18:51 +00:00
LineEditor Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Linker [opaque pointer types] Pass value type to LoadInst creation. 2019-02-01 20:44:24 +00:00
MC Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MI MachineModuleInfo: Store more specific reference to LLVMTargetMachine; NFC 2018-11-05 23:49:13 +00:00
Object Fix two more issues with r356652 2019-03-21 10:21:55 +00:00
ObjectYAML [ObjectYAML] Add basic minidump generation support 2019-03-22 14:47:26 +00:00
Option Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Passes Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ProfileData [SampleFDO] add suffix elision control for fcn names 2019-03-14 13:56:49 +00:00
Remarks Reland "[Remarks] Add a new Remark / RemarkParser abstraction" 2019-03-19 21:11:07 +00:00
Support [AArch64, ARM] Add support for Exynos M5 2019-03-22 18:42:14 +00:00
Target [WebAssembly] Exception handling: Switch to the new proposal 2019-01-30 03:21:57 +00:00
TextAPI Disable MachO TBD write tests for Windows. 2019-03-23 00:03:23 +00:00
tools [llvm-exegesis] Introduce a 'naive' clustering algorithm (PR40880) 2019-03-28 08:55:01 +00:00
Transforms [DebugInfo] Introduce DW_OP_LLVM_convert 2019-03-19 13:16:28 +00:00
XRay Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CMakeLists.txt [OptRemarks] Make OptRemarks more generic: rename OptRemarks to Remarks 2019-03-05 20:45:17 +00:00
unittest.cfg.in Add support for unittest inputs. 2018-09-05 23:30:17 +00:00