diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-27 16:05:37 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-27 16:05:37 +0800 |
| commit | 5fd19fbe147eaff6e65e7dc3b63b324d80f19a05 (patch) | |
| tree | bcf7d8cbe11192b1c1153a994c62ff9f711c55d4 /backend/include/rcc/IR/PassInstrumentation.h | |
| parent | b7cb5381e520a25e8f0f465903d8eea1972761c2 (diff) | |
| download | rcc-project-5fd19fbe147eaff6e65e7dc3b63b324d80f19a05.tar.gz rcc-project-5fd19fbe147eaff6e65e7dc3b63b324d80f19a05.tar.xz | |
[CodeGen] Remove machine action replay
Diffstat (limited to 'backend/include/rcc/IR/PassInstrumentation.h')
| -rw-r--r-- | backend/include/rcc/IR/PassInstrumentation.h | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/backend/include/rcc/IR/PassInstrumentation.h b/backend/include/rcc/IR/PassInstrumentation.h index 082ec81..f90df37 100644 --- a/backend/include/rcc/IR/PassInstrumentation.h +++ b/backend/include/rcc/IR/PassInstrumentation.h @@ -180,48 +180,6 @@ private: template <typename, typename, typename> friend struct PassManagerCallbacks; }; -class MachineActionReplay final { -public: - template <typename AnalysisManagerT> - explicit MachineActionReplay(AnalysisManagerT &Analyses) - : Request([&Analyses](std::string_view Rule, const MachineFunction &Function, - MachineInstrStableID Instruction, std::uint64_t Cost) { - return Analyses.requestAction(Rule, Function, Instruction, Cost); - }) {} - - template <typename AnalysisManagerT> - MachineActionReplay( - AnalysisManagerT &Analyses, - const std::unordered_map<MachineInstrStableID, MachineInstrStableID> &SourceToClone) - : MachineActionReplay(Analyses) { - for (const auto &[Source, Clone] : SourceToClone) - RecordingInstructionIDs.try_emplace(Clone, Source); - } - - [[nodiscard]] Expected<bool> request(std::string_view Rule, const MachineFunction &Function, - MachineInstrStableID Instruction = {}, - std::uint64_t Cost = 1); - void beginReplay() noexcept; - [[nodiscard]] Expected<void> finishReplay() const; - -private: - struct Decision final { - std::string Rule; - MachineFunctionStableID Function; - MachineInstrStableID Instruction; - std::uint64_t Cost = 0; - bool Accepted = false; - }; - - std::function<Expected<bool>(std::string_view, const MachineFunction &, MachineInstrStableID, - std::uint64_t)> - Request; - std::unordered_map<MachineInstrStableID, MachineInstrStableID> RecordingInstructionIDs; - std::vector<Decision> Decisions; - std::size_t NextDecision = 0; - bool IsReplaying = false; -}; - } // namespace rcc #endif // RCC_IR_PASSINSTRUMENTATION_H |
