aboutsummaryrefslogtreecommitdiff
path: root/backend/lib
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-15 23:00:43 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-15 23:00:43 +0800
commit5690d6d01ce6f1ced0f02a3be3562bf163ae5f78 (patch)
tree915f86ed13b166e2596c37c92f56daca8b497ea1 /backend/lib
parent2e9b2fb721ad61800456668a37162e3b241d6063 (diff)
downloadrcc-project-5690d6d01ce6f1ced0f02a3be3562bf163ae5f78.tar.gz
rcc-project-5690d6d01ce6f1ced0f02a3be3562bf163ae5f78.tar.xz
[GlobalISel] Preserve MIR live-ins during selection
Diffstat (limited to 'backend/lib')
-rw-r--r--backend/lib/CodeGen/GlobalISel/InstructionSelect.cpp20
1 files changed, 0 insertions, 20 deletions
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<void> 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<MachinePassResult> 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;
}