Skip to content

Commit 9e0f9f1

Browse files
committed
[RISCV] Preserve chain output when selecting splat as x0 strided load.
We need the vlse node to have a chain output and it should replace the chain output of the original load.
1 parent 8a1ccb8 commit 9e0f9f1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1834,10 +1834,12 @@ void RISCVDAGToDAGISel::Select(SDNode *Node) {
18341834
/*IsMasked*/ false, /*IsTU*/ false, /*IsStrided*/ true, /*FF*/ false,
18351835
Log2SEW, static_cast<unsigned>(LMUL));
18361836
MachineSDNode *Load =
1837-
CurDAG->getMachineNode(P->Pseudo, DL, Node->getVTList(), Operands);
1838-
1837+
CurDAG->getMachineNode(P->Pseudo, DL, {VT, MVT::Other}, Operands);
1838+
// Update the chain.
1839+
ReplaceUses(Src.getValue(1), SDValue(Load, 1));
1840+
// Record the mem-refs
18391841
CurDAG->setNodeMemRefs(Load, {Ld->getMemOperand()});
1840-
1842+
// Replace the splat with the vlse.
18411843
ReplaceNode(Node, Load);
18421844
return;
18431845
}

0 commit comments

Comments
 (0)