File tree 2 files changed +198
-88
lines changed
test/Transforms/LoopVectorize/AArch64
2 files changed +198
-88
lines changed Original file line number Diff line number Diff line change @@ -4692,13 +4692,24 @@ InstructionCost AArch64TTIImpl::getPartialReductionCost(
4692
4692
EVT InputEVT = EVT::getEVT (InputTypeA);
4693
4693
EVT AccumEVT = EVT::getEVT (AccumType);
4694
4694
4695
- if (VF.isScalable () && !ST->isSVEorStreamingSVEAvailable ())
4696
- return Invalid;
4695
+ unsigned VFMinValue = VF.getKnownMinValue ();
4696
+
4697
+ if (VF.isScalable ()) {
4698
+ if (!ST->isSVEorStreamingSVEAvailable ())
4699
+ return Invalid;
4700
+
4701
+ // Don't accept a partial reduction if the scaled accumulator is vscale x 1,
4702
+ // since we can't lower that type.
4703
+ unsigned Scale =
4704
+ AccumEVT.getScalarSizeInBits () / InputEVT.getScalarSizeInBits ();
4705
+ if (VFMinValue == Scale)
4706
+ return Invalid;
4707
+ }
4697
4708
if (VF.isFixed () && (!ST->isNeonAvailable () || !ST->hasDotProd ()))
4698
4709
return Invalid;
4699
4710
4700
4711
if (InputEVT == MVT::i8) {
4701
- switch (VF. getKnownMinValue () ) {
4712
+ switch (VFMinValue ) {
4702
4713
default :
4703
4714
return Invalid;
4704
4715
case 8 :
@@ -4717,7 +4728,7 @@ InstructionCost AArch64TTIImpl::getPartialReductionCost(
4717
4728
} else if (InputEVT == MVT::i16) {
4718
4729
// FIXME: Allow i32 accumulator but increase cost, as we would extend
4719
4730
// it to i64.
4720
- if (VF. getKnownMinValue () != 8 || AccumEVT != MVT::i64)
4731
+ if (VFMinValue != 8 || AccumEVT != MVT::i64)
4721
4732
return Invalid;
4722
4733
} else
4723
4734
return Invalid;
You can’t perform that action at this time.
0 commit comments