summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-exegesis/lib/Analysis.h
diff options
context:
space:
mode:
authorClement Courbet <courbet@google.com>2018-10-03 11:50:25 +0000
committerClement Courbet <courbet@google.com>2018-10-03 11:50:25 +0000
commitd5a39553ff3eafaab675e581d973f700a4d7a6b5 (patch)
tree8ca841ccd22b9b3fe08efcb98bc6e300e7a85a20 /llvm/tools/llvm-exegesis/lib/Analysis.h
parentd934032e48cad89d506880fce22e9df6cb66487a (diff)
downloadbcm5719-llvm-d5a39553ff3eafaab675e581d973f700a4d7a6b5.tar.gz
bcm5719-llvm-d5a39553ff3eafaab675e581d973f700a4d7a6b5.zip
[llvm-exegesis] Resolve variant classes in analysis.
Summary: See PR38884. Reviewers: gchatelet Subscribers: tschuett, RKSimon, llvm-commits Differential Revision: https://reviews.llvm.org/D52825 llvm-svn: 343680
Diffstat (limited to 'llvm/tools/llvm-exegesis/lib/Analysis.h')
-rw-r--r--llvm/tools/llvm-exegesis/lib/Analysis.h29
1 files changed, 19 insertions, 10 deletions
diff --git a/llvm/tools/llvm-exegesis/lib/Analysis.h b/llvm/tools/llvm-exegesis/lib/Analysis.h
index 1e6294b8770..a52ea27081c 100644
--- a/llvm/tools/llvm-exegesis/lib/Analysis.h
+++ b/llvm/tools/llvm-exegesis/lib/Analysis.h
@@ -49,11 +49,12 @@ private:
using ClusterId = InstructionBenchmarkClustering::ClusterId;
// An llvm::MCSchedClassDesc augmented with some additional data.
- struct SchedClass {
- SchedClass(const llvm::MCSchedClassDesc &SD,
- const llvm::MCSubtargetInfo &STI);
+ struct ResolvedSchedClass {
+ ResolvedSchedClass(const llvm::MCSubtargetInfo &STI,
+ unsigned ResolvedSchedClassId, bool WasVariant);
const llvm::MCSchedClassDesc *const SCDesc;
+ const bool WasVariant; // Whether the original class was variant.
const llvm::SmallVector<llvm::MCWriteProcResEntry, 8>
NonRedundantWriteProcRes;
const std::vector<std::pair<uint16_t, float>> IdealizedProcResPressure;
@@ -75,7 +76,8 @@ private:
// Returns true if the cluster representative measurements match that of SC.
bool
- measurementsMatch(const llvm::MCSubtargetInfo &STI, const SchedClass &SC,
+ measurementsMatch(const llvm::MCSubtargetInfo &STI,
+ const ResolvedSchedClass &SC,
const InstructionBenchmarkClustering &Clustering) const;
void addPoint(size_t PointId,
@@ -92,15 +94,22 @@ private:
void
printSchedClassClustersHtml(const std::vector<SchedClassCluster> &Clusters,
- const SchedClass &SC,
+ const ResolvedSchedClass &SC,
llvm::raw_ostream &OS) const;
- void printSchedClassDescHtml(const SchedClass &SC,
+ void printSchedClassDescHtml(const ResolvedSchedClass &SC,
llvm::raw_ostream &OS) const;
- // Builds a map of Sched Class -> indices of points that belong to the sched
- // class.
- std::unordered_map<unsigned, std::vector<size_t>>
- makePointsPerSchedClass() const;
+ // A pair of (Sched Class, indices of points that belong to the sched
+ // class).
+ struct ResolvedSchedClassAndPoints {
+ explicit ResolvedSchedClassAndPoints(ResolvedSchedClass &&RSC);
+
+ ResolvedSchedClass RSC;
+ std::vector<size_t> PointIds;
+ };
+
+ // Builds a list of ResolvedSchedClassAndPoints.
+ std::vector<ResolvedSchedClassAndPoints> makePointsPerSchedClass() const;
template <typename EscapeTag, EscapeTag Tag>
void writeSnippet(llvm::raw_ostream &OS, llvm::ArrayRef<uint8_t> Bytes,
OpenPOWER on IntegriCloud