aboutsummaryrefslogtreecommitdiff
path: root/backend/lib/CodeGen/MachineCopyPropagation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backend/lib/CodeGen/MachineCopyPropagation.cpp')
-rw-r--r--backend/lib/CodeGen/MachineCopyPropagation.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/backend/lib/CodeGen/MachineCopyPropagation.cpp b/backend/lib/CodeGen/MachineCopyPropagation.cpp
index 9cb64cb..94d83e3 100644
--- a/backend/lib/CodeGen/MachineCopyPropagation.cpp
+++ b/backend/lib/CodeGen/MachineCopyPropagation.cpp
@@ -232,7 +232,7 @@ struct CopyOperands final {
if (*Destination == *Source) {
if (!IsGenericCopy)
return false;
- auto Removed = Block->removeInstruction(Copy);
+ auto Removed = Copy.eraseFromParent();
if (!Removed)
return std::unexpected(Removed.error());
return true;
@@ -285,7 +285,7 @@ struct CopyOperands final {
if (IsGenericCopy &&
Operands.DestinationOperand->registerFlags().has(RegisterOperandFlag::Renamable) &&
!valueUsedAfter(Copy, *Destination, Target)) {
- auto Removed = Block->removeInstruction(Copy);
+ auto Removed = Copy.eraseFromParent();
if (!Removed)
return std::unexpected(Removed.error());
Changed = true;
@@ -326,8 +326,7 @@ MachineCopyPropagationPass::runImplementation(MachineFunction &Function,
Instruction = Next;
continue;
}
- auto Accepted =
- Analyses.requestAction("propagate-copy", Function, Instruction->stableID());
+ auto Accepted = Analyses.requestAction("propagate-copy", Function, Instruction->stableID());
if (!Accepted)
return std::unexpected(Accepted.error());
if (!*Accepted) {