[PATCH] D59951: [NFC][llvm-exegesis] Refactor Analysis::SchedClassCluster::measurementsMatch()

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 28 11:20:26 PDT 2019


lebedev.ri created this revision.
lebedev.ri added reviewers: courbet, gchatelet.
lebedev.ri added a project: LLVM.
Herald added subscribers: jdoerfert, tschuett.

The diff looks scary but it really isn't:

1. I moved the check for the number of measurements into `SchedClassClusterCentroid::validate()`
2. While there, added a check that we can only have a single inverse throughput measurement. I missed that when adding it initially.
3. In `Analysis::SchedClassCluster::measurementsMatch()` is called with the current LLVM values from schedule class and the values from Centroid.

3.1. The values from centroid we can already get from `SchedClassClusterCentroid::getAsPoint()`.

  This isn't 100% a NFC, because previously for inverse throughput we used `min()`. I have asked whether i have done that correctly in
  https://reviews.llvm.org/D57647?id=184939#inline-510384 but did not hear back. I think `avg()` should be used too, thus it is a fix.

3.2. Finally, refactor the computation of the LLVM-specified values into `Analysis::SchedClassCluster::getSchedClassPoint()`

  I will need that function for [[ https://bugs.llvm.org/show_bug.cgi?id=41275 | PR41275 ]]


Repository:
  rL LLVM

https://reviews.llvm.org/D59951

Files:
  tools/llvm-exegesis/lib/Analysis.cpp
  tools/llvm-exegesis/lib/Analysis.h
  tools/llvm-exegesis/lib/Clustering.cpp
  tools/llvm-exegesis/lib/Clustering.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59951.192687.patch
Type: text/x-patch
Size: 6945 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190328/185fbeea/attachment.bin>


More information about the llvm-commits mailing list