From 5690d6d01ce6f1ced0f02a3be3562bf163ae5f78 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Sat, 15 Aug 2026 23:00:43 +0800 Subject: [GlobalISel] Preserve MIR live-ins during selection --- backend/lib/CodeGen/GlobalISel/InstructionSelect.cpp | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'backend/lib/CodeGen/GlobalISel/InstructionSelect.cpp') diff --git a/backend/lib/CodeGen/GlobalISel/InstructionSelect.cpp b/backend/lib/CodeGen/GlobalISel/InstructionSelect.cpp index 09b2b66..15dfdf0 100644 --- a/backend/lib/CodeGen/GlobalISel/InstructionSelect.cpp +++ b/backend/lib/CodeGen/GlobalISel/InstructionSelect.cpp @@ -2,7 +2,6 @@ #include "rcc/CodeGen/GlobalISel/InstructionSelect.h" -#include "rcc/CodeGen/LiveVariables.h" #include "rcc/CodeGen/MachineBasicBlock.h" #include "rcc/CodeGen/MachineFunction.h" #include "rcc/CodeGen/MachineFunctionCloner.h" @@ -167,20 +166,6 @@ void combineFingerprint(std::uint64_t &State, std::uint64_t Value) noexcept { return Error(Code, std::move(Message)); } -[[nodiscard]] Expected repairTrackedLiveness(MachineFunction &Function, - const TargetDescription &Target, - MachinePassResult &Result) { - if (!Result.Changed || !Function.properties().has(MachineFunctionProperty::TracksLiveness)) { - return {}; - } - auto Rebuilt = rebuildMachineLiveness(Function, Target); - if (!Rebuilt) - return std::unexpected(Rebuilt.error()); - if (*Rebuilt) - Result.Changes.add(MachinePassChange::Operands); - return {}; -} - } // namespace const MachinePassContract &InstructionSelect::contract() const noexcept { @@ -341,11 +326,6 @@ Expected InstructionSelect::runImplementation(MachineFunction if (!RegisterValidation) return std::unexpected(withErrorContext(RegisterValidation.error(), "instruction selection produced invalid registers: ")); - auto Liveness = repairTrackedLiveness(Function, Target, Result); - if (!Liveness) { - return std::unexpected( - withErrorContext(Liveness.error(), "instruction-selection liveness repair failed: ")); - } Result.Preserved = Result.Changed ? PreservedAnalyses::none() : PreservedAnalyses::all(); return Result; } -- cgit v1.2.3