File tree Expand file tree Collapse file tree 2 files changed +198
-88
lines changed
test/Transforms/LoopVectorize/AArch64 Expand file tree Collapse file tree 2 files changed +198
-88
lines changed Original file line number Diff line number Diff line change @@ -4682,13 +4682,24 @@ InstructionCost AArch64TTIImpl::getPartialReductionCost(
46824682 EVT InputEVT = EVT::getEVT (InputTypeA);
46834683 EVT AccumEVT = EVT::getEVT (AccumType);
46844684
4685- if (VF.isScalable () && !ST->isSVEorStreamingSVEAvailable ())
4686- return Invalid;
4685+ unsigned VFMinValue = VF.getKnownMinValue ();
4686+
4687+ if (VF.isScalable ()) {
4688+ if (!ST->isSVEorStreamingSVEAvailable ())
4689+ return Invalid;
4690+
4691+ // Don't accept a partial reduction if the scaled accumulator is vscale x 1,
4692+ // since we can't lower that type.
4693+ unsigned Scale =
4694+ AccumEVT.getScalarSizeInBits () / InputEVT.getScalarSizeInBits ();
4695+ if (VFMinValue == Scale)
4696+ return Invalid;
4697+ }
46874698 if (VF.isFixed () && (!ST->isNeonAvailable () || !ST->hasDotProd ()))
46884699 return Invalid;
46894700
46904701 if (InputEVT == MVT::i8 ) {
4691- switch (VF. getKnownMinValue () ) {
4702+ switch (VFMinValue ) {
46924703 default :
46934704 return Invalid;
46944705 case 8 :
@@ -4707,7 +4718,7 @@ InstructionCost AArch64TTIImpl::getPartialReductionCost(
47074718 } else if (InputEVT == MVT::i16 ) {
47084719 // FIXME: Allow i32 accumulator but increase cost, as we would extend
47094720 // it to i64.
4710- if (VF. getKnownMinValue () != 8 || AccumEVT != MVT::i64 )
4721+ if (VFMinValue != 8 || AccumEVT != MVT::i64 )
47114722 return Invalid;
47124723 } else
47134724 return Invalid;
You can’t perform that action at this time.
0 commit comments