aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/X86/X86CallFrameOptimization.cpp
diff options
context:
space:
mode:
authorJean-Michel Gorius <jean-michel.gorius@ens-rennes.fr>2020-05-28 17:43:59 +0200
committerJean-Michel Gorius <jean-michel.gorius@ens-rennes.fr>2020-05-28 17:45:53 +0200
commitf5192d7fb7564c45ff4ec42f359408974b7c8fa2 (patch)
treef9ffd099b38ba04aa7eea8bab3780e891a9ba827 /llvm/lib/Target/X86/X86CallFrameOptimization.cpp
parentce5780b88c6e2f3303afd266e5e29c1badd9eb3b (diff)
downloadllvm-f5192d7fb7564c45ff4ec42f359408974b7c8fa2.zip
llvm-f5192d7fb7564c45ff4ec42f359408974b7c8fa2.tar.gz
llvm-f5192d7fb7564c45ff4ec42f359408974b7c8fa2.tar.bz2
[x86] Propagate memory operands during call frame optimization
Summary: Propagate memory operands when folding load instructions into instructions that directly operate on memory. The original revision has been split. See D80140 for the other part of the changes. Reviewers: craig.topper, rnk, lebedev.ri, efriedma Reviewed By: craig.topper Subscribers: lebedev.ri, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D80062
Diffstat (limited to 'llvm/lib/Target/X86/X86CallFrameOptimization.cpp')
-rw-r--r--llvm/lib/Target/X86/X86CallFrameOptimization.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86CallFrameOptimization.cpp b/llvm/lib/Target/X86/X86CallFrameOptimization.cpp
index 8144e85d..caa1f79 100644
--- a/llvm/lib/Target/X86/X86CallFrameOptimization.cpp
+++ b/llvm/lib/Target/X86/X86CallFrameOptimization.cpp
@@ -531,6 +531,7 @@ void X86CallFrameOptimization::adjustCallSequence(MachineFunction &MF,
PushOpcode = Is64Bit ? X86::PUSH64i8 : X86::PUSH32i8;
}
Push = BuildMI(MBB, Context.Call, DL, TII->get(PushOpcode)).add(PushOp);
+ Push->cloneMemRefs(MF, *Store);
break;
case X86::MOV32mr:
case X86::MOV64mr: {
@@ -562,6 +563,7 @@ void X86CallFrameOptimization::adjustCallSequence(MachineFunction &MF,
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 +571,7 @@ void X86CallFrameOptimization::adjustCallSequence(MachineFunction &MF,
Push = BuildMI(MBB, Context.Call, DL, TII->get(PushOpcode))
.addReg(Reg)
.getInstr();
+ Push->cloneMemRefs(MF, *Store);
}
break;
}