diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-26 23:43:44 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-26 23:43:44 +0800 |
| commit | a47055fe6af27de9d1ce505938e0cebbca5532ff (patch) | |
| tree | 2de32b198f57408e52e7a226a548e54e418b512c /backend/lib/CodeGen/InlineSpiller.cpp | |
| parent | 35f4e0a3aa03dfae06b5c9f226e38e609de2eef5 (diff) | |
| download | rcc-project-a47055fe6af27de9d1ce505938e0cebbca5532ff.tar.gz rcc-project-a47055fe6af27de9d1ce505938e0cebbca5532ff.tar.xz | |
[CodeGen] Remove transactional register allocation
Diffstat (limited to 'backend/lib/CodeGen/InlineSpiller.cpp')
| -rw-r--r-- | backend/lib/CodeGen/InlineSpiller.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
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<std::optional<std::vector<Register>>> Spiller::tryRematerialize(Registe if (Sites.empty()) return std::optional<std::vector<Register>>{}; - 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<std::vector<Register>> Spiller::spillAtInstructions(Register VirtualReg } std::vector<Register> 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<std::vector<Register>> 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) { |
