From 1be07c7af115630d26dd36da4ac4905190377a0e Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Sun, 16 Aug 2026 01:35:02 +0800 Subject: [GlobalISel] Delete dead instructions before selection --- backend/lib/CodeGen/GlobalISel/InstructionSelect.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'backend/lib/CodeGen/GlobalISel') 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 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 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); } } -- cgit v1.2.3