[PATCH] D156830: [RISCV] Copy memoperands in some of the post isel peepholes.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 2 09:24:45 PDT 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rGde7fa3ab9a4e: [RISCV] Copy memoperands in some of the post isel peepholes. (authored by craig.topper).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156830/new/
https://reviews.llvm.org/D156830
Files:
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.h
Index: llvm/lib/Target/RISCV/RISCVISelDAGToDAG.h
===================================================================
--- llvm/lib/Target/RISCV/RISCVISelDAGToDAG.h
+++ llvm/lib/Target/RISCV/RISCVISelDAGToDAG.h
@@ -185,7 +185,7 @@
private:
bool doPeepholeSExtW(SDNode *Node);
- bool doPeepholeMaskedRVV(SDNode *Node);
+ bool doPeepholeMaskedRVV(MachineSDNode *Node);
bool doPeepholeMergeVVMFold();
bool performVMergeToVMv(SDNode *N);
bool performCombineVMergeAndVOps(SDNode *N);
Index: llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
===================================================================
--- llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
+++ llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
@@ -142,7 +142,7 @@
continue;
MadeChange |= doPeepholeSExtW(N);
- MadeChange |= doPeepholeMaskedRVV(N);
+ MadeChange |= doPeepholeMaskedRVV(cast<MachineSDNode>(N));
}
CurDAG->setRoot(Dummy.getValue());
@@ -3205,7 +3205,7 @@
// corresponding "unmasked" pseudo versions. The mask we're interested in will
// take the form of a V0 physical register operand, with a glued
// register-setting instruction.
-bool RISCVDAGToDAGISel::doPeepholeMaskedRVV(SDNode *N) {
+bool RISCVDAGToDAGISel::doPeepholeMaskedRVV(MachineSDNode *N) {
const RISCV::RISCVMaskedPseudoInfo *I =
RISCV::getMaskedPseudoInfo(N->getMachineOpcode());
if (!I)
@@ -3244,7 +3244,12 @@
if (auto *TGlued = Glued->getGluedNode())
Ops.push_back(SDValue(TGlued, TGlued->getNumValues() - 1));
- SDNode *Result = CurDAG->getMachineNode(Opc, SDLoc(N), N->getVTList(), Ops);
+ MachineSDNode *Result =
+ CurDAG->getMachineNode(Opc, SDLoc(N), N->getVTList(), Ops);
+
+ if (!N->memoperands_empty())
+ CurDAG->setNodeMemRefs(Result, N->memoperands());
+
Result->setFlags(N->getFlags());
ReplaceUses(N, Result);
@@ -3514,10 +3519,13 @@
// Add the glue for the CopyToReg of mask->v0.
Ops.push_back(Glue);
- SDNode *Result =
+ MachineSDNode *Result =
CurDAG->getMachineNode(MaskedOpc, DL, True->getVTList(), Ops);
Result->setFlags(True->getFlags());
+ if (!cast<MachineSDNode>(True)->memoperands_empty())
+ CurDAG->setNodeMemRefs(Result, cast<MachineSDNode>(True)->memoperands());
+
// Replace vmerge.vvm node by Result.
ReplaceUses(SDValue(N, 0), SDValue(Result, 0));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156830.546504.patch
Type: text/x-patch
Size: 2330 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230802/13b30f2b/attachment.bin>
More information about the llvm-commits
mailing list