-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[LoongArch] Fix for VLDREPL node validation
#168993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@llvm/pr-subscribers-backend-loongarch Author: ZhaoQi (zhaoqi5) ChangesFull diff: https://github.com/llvm/llvm-project/pull/168993.diff 3 Files Affected:
diff --git a/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp b/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
index ac95ef5f30888..b8c1c261fa6db 100644
--- a/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
+++ b/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
@@ -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;
diff --git a/llvm/lib/Target/LoongArch/LoongArchSelectionDAGInfo.cpp b/llvm/lib/Target/LoongArch/LoongArchSelectionDAGInfo.cpp
index 11d05042c94f8..c07adfc48a0f5 100644
--- a/llvm/lib/Target/LoongArch/LoongArchSelectionDAGInfo.cpp
+++ b/llvm/lib/Target/LoongArch/LoongArchSelectionDAGInfo.cpp
@@ -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);
-}
diff --git a/llvm/lib/Target/LoongArch/LoongArchSelectionDAGInfo.h b/llvm/lib/Target/LoongArch/LoongArchSelectionDAGInfo.h
index ba5657080b3e4..7210a15297a3e 100644
--- a/llvm/lib/Target/LoongArch/LoongArchSelectionDAGInfo.h
+++ b/llvm/lib/Target/LoongArch/LoongArchSelectionDAGInfo.h
@@ -21,9 +21,6 @@ class LoongArchSelectionDAGInfo : public SelectionDAGGenTargetInfo {
LoongArchSelectionDAGInfo();
~LoongArchSelectionDAGInfo() override;
-
- void verifyTargetNode(const SelectionDAG &DAG,
- const SDNode *N) const override;
};
} // namespace llvm
|
🐧 Linux x64 Test Results
|
s-barannikov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/138/builds/22271 Here is the relevant piece of the build log for the reference |
No description provided.