[PATCH] D80062: [x86] Propagate memory operands during call frame optimization & ISel DAG postprocessing
Jean-Michel Gorius via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat May 16 05:41:37 PDT 2020
Kayjukh created this revision.
Kayjukh added a reviewer: craig.topper.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
This propagates memory operands when folding loads instructions into instructions that directly operate on memory.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D80062
Files:
llvm/lib/Target/X86/X86CallFrameOptimization.cpp
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
===================================================================
--- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
+++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
@@ -1393,6 +1393,8 @@
And.getOperand(6) /* Chain */ };
MachineSDNode *Test = CurDAG->getMachineNode(NewOpc, SDLoc(N),
MVT::i32, MVT::Other, Ops);
+ CurDAG->setNodeMemRefs(
+ Test, cast<MachineSDNode>(And.getNode())->memoperands());
ReplaceUses(N, Test);
MadeChange = true;
continue;
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->setMemRefs(MF, DefMov->memoperands());
DefMov->eraseFromParent();
} else {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80062.264425.patch
Type: text/x-patch
Size: 1171 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200516/fba20bef/attachment.bin>
More information about the llvm-commits
mailing list