Index: llvm/lib/Target/X86/X86CallFrameOptimization.cpp =================================================================== --- llvm/lib/Target/X86/X86CallFrameOptimization.cpp +++ llvm/lib/Target/X86/X86CallFrameOptimization.cpp @@ -562,6 +562,7 @@ unsigned NumOps = DefMov->getDesc().getNumOperands(); for (unsigned i = NumOps - X86::AddrNumOperands; i != NumOps; ++i) Push->addOperand(DefMov->getOperand(i)); + Push->cloneMergedMemRefs(MF, {&*DefMov, &*Store}); DefMov->eraseFromParent(); } else { @@ -569,6 +570,7 @@ Push = BuildMI(MBB, Context.Call, DL, TII->get(PushOpcode)) .addReg(Reg) .getInstr(); + Push->cloneMemRefs(MF, *Store); } break; }