From a47055fe6af27de9d1ce505938e0cebbca5532ff Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Wed, 26 Aug 2026 23:43:44 +0800 Subject: [CodeGen] Remove transactional register allocation --- backend/lib/CodeGen/InlineSpiller.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'backend/lib/CodeGen/InlineSpiller.cpp') diff --git a/backend/lib/CodeGen/InlineSpiller.cpp b/backend/lib/CodeGen/InlineSpiller.cpp index 1d5ba10..4aa43ce 100644 --- a/backend/lib/CodeGen/InlineSpiller.cpp +++ b/backend/lib/CodeGen/InlineSpiller.cpp @@ -78,9 +78,10 @@ Expected>> Spiller::tryRematerialize(Registe if (Sites.empty()) return std::optional>{}; - if (Actions != nullptr) { + if (ActionAnalyses != nullptr) { for (const UseSite &Site : Sites) { - auto Accepted = Actions->request("rematerialize", *Function, Site.Instruction->stableID()); + auto Accepted = ActionAnalyses->requestAction("rematerialize", *Function, + Site.Instruction->stableID()); if (!Accepted) return std::unexpected(Accepted.error()); if (!*Accepted) @@ -180,11 +181,12 @@ Expected> Spiller::spillAtInstructions(Register VirtualReg } std::vector NewRegisters; - if (Actions != nullptr) { + if (ActionAnalyses != nullptr) { for (const SpillSite &Site : Sites) { if (Site.OperandIndices.empty()) continue; - auto Accepted = Actions->request("split-live-range", *Function, Site.Instruction->stableID()); + auto Accepted = ActionAnalyses->requestAction("split-live-range", *Function, + Site.Instruction->stableID()); if (!Accepted) return std::unexpected(Accepted.error()); if (!*Accepted) { @@ -283,12 +285,12 @@ Expected> Spiller::spill(Register VirtualReg) { return makeUnexpected(ErrorCode::RegisterAllocationFailed, "register pressure requires spilling a non-spillable value"); } - if (Actions != nullptr) { + if (ActionAnalyses != nullptr) { const MachineOperand *Definition = Function->registerInfo().getUniqueVRegDef(VirtualReg); const MachineInstr *Instruction = Definition == nullptr ? nullptr : Definition->parent(); - auto Accepted = - Actions->request("spill", *Function, - Instruction == nullptr ? MachineInstrStableID{} : Instruction->stableID()); + auto Accepted = ActionAnalyses->requestAction( + "spill", *Function, + Instruction == nullptr ? MachineInstrStableID{} : Instruction->stableID()); if (!Accepted) return std::unexpected(Accepted.error()); if (!*Accepted) { -- cgit v1.2.3