Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[AArch64][SVE] Add lowering for PARTIAL_REDUCE_U/SMLA to USDOT #131327

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

Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Adjust how usdot cases are lowered
  • Loading branch information
NickGuy-Arm committed May 12, 2025
commit 22636ac1a9bd8e73943f9b52dc5ff063dc5ed258
14 changes: 12 additions & 2 deletions 14 llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -925,8 +925,18 @@ SDValue DAGTypeLegalizer::CreateStackStoreLoad(SDValue Op,
bool DAGTypeLegalizer::CustomLowerNode(SDNode *N, EVT VT, bool LegalizeResult) {
// See if the target wants to custom lower this node.
unsigned Opcode = N->getOpcode();
if (TLI.getOperationAction(Opcode, VT) != TargetLowering::Custom)
return false;
bool IsPRMLAOpcode =
Opcode == ISD::PARTIAL_REDUCE_UMLA || Opcode == ISD::PARTIAL_REDUCE_SMLA;

if (IsPRMLAOpcode) {
if (TLI.getPartialReduceMLAAction(N->getValueType(0),
N->getOperand(1).getValueType()) !=
TargetLowering::Custom)
return false;
} else {
if (TLI.getOperationAction(Opcode, VT) != TargetLowering::Custom)
return false;
}

SmallVector<SDValue, 8> Results;
if (LegalizeResult)
Expand Down
14 changes: 3 additions & 11 deletions 14 llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1872,17 +1872,9 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
// 8to64
setPartialReduceMLAAction(MVT::nxv2i64, MVT::nxv16i8, Custom);

if (Subtarget->hasMatMulInt8()) {
// USDOT
setPartialReduceMLAAction(MVT::nxv2i64, MVT::nxv8i64, Custom);
// USDOT
if (Subtarget->hasMatMulInt8())
setPartialReduceMLAAction(MVT::nxv4i32, MVT::nxv16i32, Custom);
setPartialReduceMLAAction(MVT::nxv2i64, MVT::nxv4i64, Custom);
setPartialReduceMLAAction(MVT::nxv4i32, MVT::nxv8i32, Custom);
setPartialReduceMLAAction(MVT::nxv8i16, MVT::nxv16i16, Custom);
setPartialReduceMLAAction(MVT::nxv16i8, MVT::nxv32i8, Custom);

setOperationAction(ISD::PARTIAL_REDUCE_UMLA, MVT::nxv16i32, Custom);
}
}

// Handle operations that are only available in non-streaming SVE mode.
Expand Down Expand Up @@ -7755,8 +7747,8 @@ SDValue AArch64TargetLowering::LowerOperation(SDValue Op,
return LowerFLDEXP(Op, DAG);
case ISD::EXPERIMENTAL_VECTOR_HISTOGRAM:
return LowerVECTOR_HISTOGRAM(Op, DAG);
case ISD::PARTIAL_REDUCE_UMLA:
case ISD::PARTIAL_REDUCE_SMLA:
case ISD::PARTIAL_REDUCE_UMLA:
return LowerPARTIAL_REDUCE_MLA(Op, DAG);
}
}
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.