From 7d763c8b0ae6eee5f015fa82c744bff4c7ec8c8b Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Sat, 15 Aug 2026 03:11:22 +0800 Subject: [GlobalISel] Preserve worklists when moving CSE instructions --- backend/lib/CodeGen/GlobalISel/CSEMIRBuilder.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'backend/lib/CodeGen/GlobalISel') diff --git a/backend/lib/CodeGen/GlobalISel/CSEMIRBuilder.cpp b/backend/lib/CodeGen/GlobalISel/CSEMIRBuilder.cpp index e1fdaa6..caf9652 100644 --- a/backend/lib/CodeGen/GlobalISel/CSEMIRBuilder.cpp +++ b/backend/lib/CodeGen/GlobalISel/CSEMIRBuilder.cpp @@ -53,13 +53,7 @@ Expected CSEMIRBuilder::makeInstructionDominate(MachineInstr &Instruction) } if (InsertBefore == nullptr || dominatesInsertionPoint(Instruction)) return {}; - auto Removed = Block->removeInstruction(Instruction); - if (!Removed) - return std::unexpected(Removed.error()); - auto Inserted = Block->insertInstructionBefore(*InsertBefore, Instruction); - if (!Inserted) - return std::unexpected(Inserted.error()); - return {}; + return Block->spliceInstructionBefore(*InsertBefore, Instruction); } Expected -- cgit v1.2.3