aboutsummaryrefslogtreecommitdiff
path: root/backend/lib/CodeGen/GlobalISel
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-16 01:35:02 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-16 01:35:02 +0800
commit1be07c7af115630d26dd36da4ac4905190377a0e (patch)
treedd6eda7d07c6b5c19eb70ce30828d3a20d7319ae /backend/lib/CodeGen/GlobalISel
parent9388ff494a554e1f5d529be3636f9e1596fbf035 (diff)
downloadrcc-project-1be07c7af115630d26dd36da4ac4905190377a0e.tar.gz
rcc-project-1be07c7af115630d26dd36da4ac4905190377a0e.tar.xz
[GlobalISel] Delete dead instructions before selection
Diffstat (limited to 'backend/lib/CodeGen/GlobalISel')
-rw-r--r--backend/lib/CodeGen/GlobalISel/InstructionSelect.cpp12
1 files changed, 1 insertions, 11 deletions
diff --git a/backend/lib/CodeGen/GlobalISel/InstructionSelect.cpp b/backend/lib/CodeGen/GlobalISel/InstructionSelect.cpp
index 31d880e..862b63f 100644
--- a/backend/lib/CodeGen/GlobalISel/InstructionSelect.cpp
+++ b/backend/lib/CodeGen/GlobalISel/InstructionSelect.cpp
@@ -230,11 +230,6 @@ Expected<MachinePassResult> InstructionSelect::runImplementation(MachineFunction
if (!Validation)
return std::unexpected(
withErrorContext(Validation.error(), "instruction selector input is invalid: "));
- if (!Descriptor->Flags.has(InstructionFlag::Generic))
- continue;
- auto Match = Info->canSelect(*Instruction, Function, Target);
- if (!Match)
- return std::unexpected(Match.error());
Worklist.push_back(Instruction);
DiscoveredInstructions.insert(Instruction->stableID());
}
@@ -308,13 +303,8 @@ Expected<MachinePassResult> InstructionSelect::runImplementation(MachineFunction
if (CandidateDescriptor == nullptr)
return std::unexpected(
passFailure("instruction selector produced an unknown instruction descriptor"));
- if (!CandidateDescriptor->Flags.has(InstructionFlag::Generic) ||
- !DiscoveredInstructions.insert(Candidate->stableID()).second) {
+ if (!DiscoveredInstructions.insert(Candidate->stableID()).second)
continue;
- }
- auto CandidateMatch = Info->canSelect(*Candidate, Function, Target);
- if (!CandidateMatch)
- return std::unexpected(CandidateMatch.error());
Worklist.push_back(Candidate);
}
}