[llvm] [AArch64] Copy implicit def operands when creating LDP. (PR #164253)
Ricardo Jesus via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 20 08:34:14 PDT 2025
================
@@ -1386,6 +1386,17 @@ AArch64LoadStoreOpt::mergePairedInsns(MachineBasicBlock::iterator I,
if (MOP.isReg() && MOP.isKill())
DefinedInBB.addReg(MOP.getReg());
+ // Copy over any implicit-def operands. This is like MI.copyImplicitOps, but
+ // only copies implicit defs.
+ auto CopyImplicitOps = [&](MachineBasicBlock::iterator MI) {
+ for (const MachineOperand &MO :
+ llvm::drop_begin(MI->operands(), MI->getDesc().getNumOperands()))
+ if (MO.isReg() && MO.isImplicit() && MO.isDef())
+ MIB.add(MO);
+ };
+ CopyImplicitOps(I);
+ CopyImplicitOps(Paired);
----------------
rj-jesus wrote:
It might be worth only calling this for loads?
https://github.com/llvm/llvm-project/pull/164253
More information about the llvm-commits
mailing list