aboutsummaryrefslogtreecommitdiff
path: root/backend/lib/CodeGen/MachinePassManager.cpp
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-27 16:05:37 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-27 16:05:37 +0800
commit5fd19fbe147eaff6e65e7dc3b63b324d80f19a05 (patch)
treebcf7d8cbe11192b1c1153a994c62ff9f711c55d4 /backend/lib/CodeGen/MachinePassManager.cpp
parentb7cb5381e520a25e8f0f465903d8eea1972761c2 (diff)
downloadrcc-project-5fd19fbe147eaff6e65e7dc3b63b324d80f19a05.tar.gz
rcc-project-5fd19fbe147eaff6e65e7dc3b63b324d80f19a05.tar.xz
[CodeGen] Remove machine action replay
Diffstat (limited to 'backend/lib/CodeGen/MachinePassManager.cpp')
-rw-r--r--backend/lib/CodeGen/MachinePassManager.cpp60
1 files changed, 0 insertions, 60 deletions
diff --git a/backend/lib/CodeGen/MachinePassManager.cpp b/backend/lib/CodeGen/MachinePassManager.cpp
index 2cd81b9..236457e 100644
--- a/backend/lib/CodeGen/MachinePassManager.cpp
+++ b/backend/lib/CodeGen/MachinePassManager.cpp
@@ -199,66 +199,6 @@ std::string MachineActionID::toString() const {
return Result;
}
-Expected<bool> MachineActionReplay::request(std::string_view Rule, const MachineFunction &Function,
- MachineInstrStableID Instruction, std::uint64_t Cost) {
- if (!IsReplaying) {
- const auto Position = RecordingInstructionIDs.find(Instruction);
- const MachineInstrStableID CanonicalInstruction =
- Position == RecordingInstructionIDs.end() ? Instruction : Position->second;
- auto Accepted = Request(Rule, Function, CanonicalInstruction, Cost);
- if (!Accepted)
- return std::unexpected(Accepted.error());
- Decisions.push_back({
- .Rule = std::string(Rule),
- .Function = Function.stableID(),
- .Instruction = CanonicalInstruction,
- .Cost = Cost,
- .Accepted = *Accepted,
- });
- return *Accepted;
- }
-
- if (NextDecision >= Decisions.size()) {
- return makeUnexpected(ErrorCode::InternalError,
- "machine action replay requested an unrecorded decision");
- }
- const Decision &Recorded = Decisions[NextDecision++];
- if (Recorded.Rule != Rule || Recorded.Function != Function.stableID() ||
- Recorded.Instruction != Instruction || Recorded.Cost != Cost) {
- std::string Message = "machine action replay diverged from transaction preflight: recorded ";
- Message.append(Recorded.Rule);
- Message.append(":f");
- Message.append(std::to_string(Recorded.Function.value()));
- Message.append(":i");
- Message.append(std::to_string(Recorded.Instruction.value()));
- Message.append(" cost=");
- Message.append(std::to_string(Recorded.Cost));
- Message.append(", requested ");
- Message.append(Rule);
- Message.append(":f");
- Message.append(std::to_string(Function.stableID().value()));
- Message.append(":i");
- Message.append(std::to_string(Instruction.value()));
- Message.append(" cost=");
- Message.append(std::to_string(Cost));
- return makeUnexpected(ErrorCode::InternalError, std::move(Message));
- }
- return Recorded.Accepted;
-}
-
-void MachineActionReplay::beginReplay() noexcept {
- IsReplaying = true;
- NextDecision = 0;
-}
-
-Expected<void> MachineActionReplay::finishReplay() const {
- if (!IsReplaying || NextDecision != Decisions.size()) {
- return makeUnexpected(ErrorCode::InternalError,
- "machine action replay did not consume every recorded decision");
- }
- return {};
-}
-
void MachinePassInstrumentation::addBeforeCallback(BeforeCallback Callback) {
if (!Callback)
return;