Skip to content

Conversation

topperc
Copy link
Collaborator

@topperc topperc commented Oct 8, 2025

Using DAG.getSplitVector creates new nodes that need to be legalized. We should use GetSplitVector to get the already legalized copy of the inputs.

Using DAG.getSplitVector creates new nodes that need to be legalized.
We should use GetSplitVector to get the already legalized copy of
the inputs.
@llvmbot
Copy link
Member

llvmbot commented Oct 8, 2025

@llvm/pr-subscribers-llvm-selectiondag

Author: Craig Topper (topperc)

Changes

Using DAG.getSplitVector creates new nodes that need to be legalized. We should use GetSplitVector to get the already legalized copy of the inputs.


Full diff: https://github.com/llvm/llvm-project/pull/162513.diff

1 Files Affected:

  • (modified) llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp (+5-5)
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
index 87d5453cd98cf..3b5f83f7c089a 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
@@ -3416,7 +3416,7 @@ void DAGTypeLegalizer::SplitVecRes_PARTIAL_REDUCE_MLA(SDNode *N, SDValue &Lo,
   SDValue Input2 = N->getOperand(2);
 
   SDValue AccLo, AccHi;
-  std::tie(AccLo, AccHi) = DAG.SplitVector(Acc, DL);
+  GetSplitVector(Acc, AccLo, AccHi);
   unsigned Opcode = N->getOpcode();
 
   // If the input types don't need splitting, just accumulate into the
@@ -3429,8 +3429,8 @@ void DAGTypeLegalizer::SplitVecRes_PARTIAL_REDUCE_MLA(SDNode *N, SDValue &Lo,
 
   SDValue Input1Lo, Input1Hi;
   SDValue Input2Lo, Input2Hi;
-  std::tie(Input1Lo, Input1Hi) = DAG.SplitVector(Input1, DL);
-  std::tie(Input2Lo, Input2Hi) = DAG.SplitVector(Input2, DL);
+  GetSplitVector(Input1, Input1Lo, Input1Hi);
+  GetSplitVector(Input2, Input2Lo, Input2Hi);
   EVT ResultVT = AccLo.getValueType();
 
   Lo = DAG.getNode(Opcode, DL, ResultVT, AccLo, Input1Lo, Input2Lo);
@@ -4761,8 +4761,8 @@ SDValue DAGTypeLegalizer::SplitVecOp_PARTIAL_REDUCE_MLA(SDNode *N) {
 
   SDLoc DL(N);
   SDValue Input1Lo, Input1Hi, Input2Lo, Input2Hi;
-  std::tie(Input1Lo, Input1Hi) = DAG.SplitVector(N->getOperand(1), DL);
-  std::tie(Input2Lo, Input2Hi) = DAG.SplitVector(N->getOperand(2), DL);
+  GetSplitVector(N->getOperand(1), Input1Lo, Input1Hi);
+  GetSplitVector(N->getOperand(2), Input2Lo, Input2Hi);
   unsigned Opcode = N->getOpcode();
   EVT ResultVT = Acc.getValueType();
 

@topperc topperc changed the title [SelectionDAG] Use GetSplitVector in SplitVec(Res/Op)_PARTIAL_REDUCE_MLA [LegalizeTypes] Use GetSplitVector in SplitVec(Res/Op)_PARTIAL_REDUCE_MLA Oct 8, 2025
Copy link
Collaborator

@preames preames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@topperc topperc merged commit 2afd71f into llvm:main Oct 9, 2025
11 checks passed
@topperc topperc deleted the pr/getsplitvector branch October 9, 2025 03:29
svkeerthy pushed a commit that referenced this pull request Oct 9, 2025
…_MLA (#162513)

Using DAG.getSplitVector creates new nodes that need to be legalized. We
should use GetSplitVector to get the already legalized copy of the
inputs.
clingfei pushed a commit to clingfei/llvm-project that referenced this pull request Oct 10, 2025
…_MLA (llvm#162513)

Using DAG.getSplitVector creates new nodes that need to be legalized. We
should use GetSplitVector to get the already legalized copy of the
inputs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llvm:SelectionDAG SelectionDAGISel as well

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants