Skip to content

Commit 1a112f8

Browse files
Address PR comments. Move a check into an if condition so the check
is not performed where it is not necessary.
1 parent cc4fb09 commit 1a112f8

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21975,6 +21975,9 @@ SDValue tryLowerPartialReductionToDot(SDNode *N,
2197521975

2197621976
MulOpLHS = ExtMulOpLHS->getOperand(0);
2197721977
MulOpRHS = ExtMulOpRHS->getOperand(0);
21978+
21979+
if (MulOpLHS.getValueType() != MulOpRHS.getValueType())
21980+
return SDValue();
2197821981
} else
2197921982
return SDValue();
2198021983

@@ -21984,13 +21987,12 @@ SDValue tryLowerPartialReductionToDot(SDNode *N,
2198421987

2198521988
// Dot products operate on chunks of four elements so there must be four times
2198621989
// as many elements in the wide type
21987-
if ((!(ReducedVT == MVT::nxv4i64 && MulSrcVT == MVT::nxv16i8) &&
21988-
!(ReducedVT == MVT::nxv4i32 && MulSrcVT == MVT::nxv16i8) &&
21989-
!(ReducedVT == MVT::nxv2i64 && MulSrcVT == MVT::nxv8i16) &&
21990-
!(ReducedVT == MVT::v4i64 && MulSrcVT == MVT::v16i8) &&
21991-
!(ReducedVT == MVT::v4i32 && MulSrcVT == MVT::v16i8) &&
21992-
!(ReducedVT == MVT::v2i32 && MulSrcVT == MVT::v8i8)) ||
21993-
(MulOpLHS.getValueType() != MulOpRHS.getValueType()))
21990+
if (!(ReducedVT == MVT::nxv4i64 && MulSrcVT == MVT::nxv16i8) &&
21991+
!(ReducedVT == MVT::nxv4i32 && MulSrcVT == MVT::nxv16i8) &&
21992+
!(ReducedVT == MVT::nxv2i64 && MulSrcVT == MVT::nxv8i16) &&
21993+
!(ReducedVT == MVT::v4i64 && MulSrcVT == MVT::v16i8) &&
21994+
!(ReducedVT == MVT::v4i32 && MulSrcVT == MVT::v16i8) &&
21995+
!(ReducedVT == MVT::v2i32 && MulSrcVT == MVT::v8i8))
2199421996
return SDValue();
2199521997

2199621998
// If the extensions are mixed, we should lower it to a usdot instead

0 commit comments

Comments
 (0)