Skip to content

Commit 33088b4

Browse files
committed
Address comments
1 parent d6d1f56 commit 33088b4

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,8 +1451,16 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
14511451
for (MVT VT : { MVT::v32i8, MVT::v16i16, MVT::v8i32, MVT::v4i64 })
14521452
setOperationAction(ISD::ADD, VT, Custom);
14531453
// FADDP custom lowering
1454-
for (MVT VT : { MVT::v16f16, MVT::v8f32, MVT::v4f64 })
1454+
for (MVT VT : {MVT::v16f16, MVT::v8f32, MVT::v4f64})
14551455
setOperationAction(ISD::FADD, VT, Custom);
1456+
1457+
if (EnablePartialReduceNodes && Subtarget->hasDotProd()) {
1458+
setPartialReduceMLAAction(MVT::v2i64, MVT::v8i16, Legal);
1459+
setPartialReduceMLAAction(MVT::v4i32, MVT::v16i8, Legal);
1460+
setPartialReduceMLAAction(MVT::v2i32, MVT::v8i8, Legal);
1461+
setPartialReduceMLAAction(MVT::v2i64, MVT::v16i8, Custom);
1462+
}
1463+
14561464
} else /* !isNeonAvailable */ {
14571465
for (MVT VT : MVT::fixedlen_vector_valuetypes()) {
14581466
for (unsigned Op = 0; Op < ISD::BUILTIN_OP_END; ++Op)
@@ -1872,15 +1880,6 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
18721880
setPartialReduceMLAAction(MVT::nxv2i64, MVT::nxv16i8, Custom);
18731881
}
18741882

1875-
if (EnablePartialReduceNodes && Subtarget->hasNEON() &&
1876-
Subtarget->hasDotProd()) {
1877-
setPartialReduceMLAAction(MVT::v2i64, MVT::v8i16, Legal);
1878-
setPartialReduceMLAAction(MVT::v4i32, MVT::v16i8, Legal);
1879-
setPartialReduceMLAAction(MVT::v4i32, MVT::v16i8, Legal);
1880-
setPartialReduceMLAAction(MVT::v2i32, MVT::v8i8, Legal);
1881-
setPartialReduceMLAAction(MVT::v2i64, MVT::v16i8, Custom);
1882-
}
1883-
18841883
// Handle operations that are only available in non-streaming SVE mode.
18851884
if (Subtarget->isSVEAvailable()) {
18861885
for (auto VT : {MVT::nxv16i8, MVT::nxv8i16, MVT::nxv4i32, MVT::nxv2i64,
@@ -29544,10 +29543,12 @@ SDValue
2954429543
AArch64TargetLowering::LowerPARTIAL_REDUCE_MLA(SDValue Op,
2954529544
SelectionDAG &DAG) const {
2954629545
bool Scalable = Op.getValueType().isScalableVector();
29547-
if (Scalable && !Subtarget->isSVEorStreamingSVEAvailable())
29548-
return SDValue();
29549-
if (!Scalable && (!Subtarget->isNeonAvailable() || !Subtarget->hasDotProd()))
29550-
return SDValue();
29546+
29547+
assert((!Scalable || Subtarget->isSVEorStreamingSVEAvailable()) &&
29548+
"SVE or StreamingSVE must be available when using scalable vectors.");
29549+
assert(
29550+
(Scalable || (Subtarget->isNeonAvailable() || Subtarget->hasDotProd())) &&
29551+
"Neon or dotprod must be available when using fixed-width vectors.");
2955129552

2955229553
SDLoc DL(Op);
2955329554

llvm/test/CodeGen/AArch64/neon-partial-reduce-dot-product.ll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
; RUN: llc -mtriple aarch64 -mattr=+neon < %s | FileCheck %s --check-prefixes=CHECK,CHECK-NOI8MM,CHECK-NODOT
44
; RUN: llc -mtriple aarch64 -mattr=+neon,+dotprod,+i8mm < %s | FileCheck %s --check-prefixes=CHECK,CHECK-DOT,CHECK-I8MM,CHECK-DOT-I8MM
55
; RUN: llc -mtriple aarch64 -mattr=+neon,+dotprod,+i8mm -aarch64-enable-partial-reduce-nodes < %s | FileCheck %s --check-prefixes=CHECK,CHECK-DOT,CHECK-I8MM,CHECK-NEWLOWERING-I8MM
6-
; RUN: llc -mtriple aarch64 -mattr=+neon,+dotprod -aarch64-enable-partial-reduce-nodes < %s | FileCheck %s --check-prefixes=CHECK,CHECK-DOT,CHECK-NOI8MM,CHECK-NEWLOWERING-NOI8MM
76

87
define <4 x i32> @udot(<4 x i32> %acc, <16 x i8> %u, <16 x i8> %s) {
98
; CHECK-DOT-LABEL: udot:

0 commit comments

Comments
 (0)