diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-16 01:35:02 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-16 01:35:02 +0800 |
| commit | 1be07c7af115630d26dd36da4ac4905190377a0e (patch) | |
| tree | dd6eda7d07c6b5c19eb70ce30828d3a20d7319ae /backend | |
| parent | 9388ff494a554e1f5d529be3636f9e1596fbf035 (diff) | |
| download | rcc-project-1be07c7af115630d26dd36da4ac4905190377a0e.tar.gz rcc-project-1be07c7af115630d26dd36da4ac4905190377a0e.tar.xz | |
[GlobalISel] Delete dead instructions before selection
Diffstat (limited to 'backend')
| -rw-r--r-- | backend/lib/CodeGen/GlobalISel/InstructionSelect.cpp | 12 |
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); } } |
