[NFC][llvm-exegesis] Refactor ResolvedSchedClass & friends
Summary:
`ResolvedSchedClass` will need to be used outside of `Analysis`
(before `InstructionBenchmarkClustering` even), therefore promote
it into a non-private top-level class, and while there also
move all of the functions that are only called by `ResolvedSchedClass`
into that same new file.
Reviewers: courbet, gchatelet
Reviewed By: courbet
Subscribers: mgorny, tschuett, mgrang, jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59993
llvm-svn: 357259
diff --git a/llvm/tools/llvm-exegesis/lib/Analysis.h b/llvm/tools/llvm-exegesis/lib/Analysis.h
index 36a3479..15bd832 100644
--- a/llvm/tools/llvm-exegesis/lib/Analysis.h
+++ b/llvm/tools/llvm-exegesis/lib/Analysis.h
@@ -15,6 +15,7 @@
#define LLVM_TOOLS_LLVM_EXEGESIS_ANALYSIS_H
#include "Clustering.h"
+#include "SchedClassResolution.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDisassembler/MCDisassembler.h"
#include "llvm/MC/MCInstPrinter.h"
@@ -51,19 +52,6 @@
private:
using ClusterId = InstructionBenchmarkClustering::ClusterId;
- // An llvm::MCSchedClassDesc augmented with some additional data.
- struct ResolvedSchedClass {
- ResolvedSchedClass(const llvm::MCSubtargetInfo &STI,
- unsigned ResolvedSchedClassId, bool WasVariant);
-
- const unsigned SchedClassId;
- 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;
- };
-
// Represents the intersection of a sched class and a cluster.
class SchedClassCluster {
public:
@@ -137,13 +125,6 @@
const bool AnalysisDisplayUnstableOpcodes_;
};
-// Computes the idealized ProcRes Unit pressure. This is the expected
-// distribution if the CPU scheduler can distribute the load as evenly as
-// possible.
-std::vector<std::pair<uint16_t, float>> computeIdealizedProcResPressure(
- const llvm::MCSchedModel &SM,
- llvm::SmallVector<llvm::MCWriteProcResEntry, 8> WPRS);
-
} // namespace exegesis
} // namespace llvm