Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2886,11 +2886,13 @@ static SDValue lowerBUILD_VECTORAsBroadCastLoad(BuildVectorSDNode *BVOp,

if ((ExtType == ISD::EXTLOAD || ExtType == ISD::NON_EXTLOAD) &&
VT.getScalarSizeInBits() == LN->getMemoryVT().getScalarSizeInBits()) {
SDVTList Tys =
LN->isIndexed()
? DAG.getVTList(VT, LN->getBasePtr().getValueType(), MVT::Other)
: DAG.getVTList(VT, MVT::Other);
SDValue Ops[] = {LN->getChain(), LN->getBasePtr(), LN->getOffset()};
// Indexed loads and stores are not supported on LoongArch.
assert(LN->isUnindexed() && "Unexpected indexed load.");

SDVTList Tys = DAG.getVTList(VT, MVT::Other);
// The offset operand of unindexed load is always undefined, so there is
// no need to pass it to VLDREPL.
SDValue Ops[] = {LN->getChain(), LN->getBasePtr()};
SDValue BCast = DAG.getNode(LoongArchISD::VLDREPL, DL, Tys, Ops);
DAG.ReplaceAllUsesOfValueWith(SDValue(LN, 1), BCast.getValue(1));
return BCast;
Expand Down
10 changes: 0 additions & 10 deletions llvm/lib/Target/LoongArch/LoongArchSelectionDAGInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,3 @@ LoongArchSelectionDAGInfo::LoongArchSelectionDAGInfo()
: SelectionDAGGenTargetInfo(LoongArchGenSDNodeInfo) {}

LoongArchSelectionDAGInfo::~LoongArchSelectionDAGInfo() = default;

void LoongArchSelectionDAGInfo::verifyTargetNode(const SelectionDAG &DAG,
const SDNode *N) const {
switch (N->getOpcode()) {
case LoongArchISD::VLDREPL:
// invalid number of operands; expected 2, got 3
return;
}
SelectionDAGGenTargetInfo::verifyTargetNode(DAG, N);
}
3 changes: 0 additions & 3 deletions llvm/lib/Target/LoongArch/LoongArchSelectionDAGInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ class LoongArchSelectionDAGInfo : public SelectionDAGGenTargetInfo {
LoongArchSelectionDAGInfo();

~LoongArchSelectionDAGInfo() override;

void verifyTargetNode(const SelectionDAG &DAG,
const SDNode *N) const override;
};

} // namespace llvm
Expand Down