[llvm] [PHIElimination] Reuse existing COPY in predecessor basic block (PR #131837)
Guy David via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 30 05:44:07 PDT 2025
================
@@ -581,6 +581,15 @@ void PHIEliminationImpl::LowerPHINode(MachineBasicBlock &MBB,
continue;
}
+ // Reuse an existing copy in the block if possible.
+ if (MachineInstr *DefMI = MRI->getUniqueVRegDef(SrcReg)) {
+ if (DefMI->isCopy() && DefMI->getParent() == &opBlock &&
+ MRI->use_empty(SrcReg)) {
----------------
guy-david wrote:
Will be drive-by fixed in https://github.com/llvm/llvm-project/pull/146337.
https://github.com/llvm/llvm-project/pull/131837
More information about the llvm-commits
mailing list