diff options
Diffstat (limited to 'backend/lib/CodeGen/GlobalISel/CSEMIRBuilder.cpp')
| -rw-r--r-- | backend/lib/CodeGen/GlobalISel/CSEMIRBuilder.cpp | 8 |
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 *> |
