aboutsummaryrefslogtreecommitdiff
path: root/backend/lib/CodeGen/GlobalISel
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-15 03:11:22 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-15 03:11:22 +0800
commit7d763c8b0ae6eee5f015fa82c744bff4c7ec8c8b (patch)
tree5394846395d59f68a33a2f590ddd144940c61051 /backend/lib/CodeGen/GlobalISel
parent2c39d48321658c43d49ada4d2b06be5e0de5d158 (diff)
downloadrcc-project-7d763c8b0ae6eee5f015fa82c744bff4c7ec8c8b.tar.gz
rcc-project-7d763c8b0ae6eee5f015fa82c744bff4c7ec8c8b.tar.xz
[GlobalISel] Preserve worklists when moving CSE instructions
Diffstat (limited to 'backend/lib/CodeGen/GlobalISel')
-rw-r--r--backend/lib/CodeGen/GlobalISel/CSEMIRBuilder.cpp8
1 files changed, 1 insertions, 7 deletions
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<void> 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<MachineInstr *>