File tree Expand file tree Collapse file tree 4 files changed +8
-5
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 4 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -9237,7 +9237,7 @@ void VPWidenPointerInductionRecipe::execute(VPTransformState &State) {
9237
9237
auto *IVR = getParent ()->getPlan ()->getCanonicalIV ();
9238
9238
PHINode *CanonicalIV = cast<PHINode>(State.get (IVR, 0 ));
9239
9239
9240
- if (onlyScalarsGenerated (State.VF )) {
9240
+ if (onlyScalarsGenerated (State.VF . isScalable () )) {
9241
9241
// This is the normalized GEP that starts counting at zero.
9242
9242
Value *PtrInd = State.Builder .CreateSExtOrTrunc (
9243
9243
CanonicalIV, IndDesc.getStep ()->getType ());
Original file line number Diff line number Diff line change @@ -854,7 +854,7 @@ void VPlan::execute(VPTransformState *State) {
854
854
auto *WidenPhi = cast<VPWidenPointerInductionRecipe>(&R);
855
855
// TODO: Split off the case that all users of a pointer phi are scalar
856
856
// from the VPWidenPointerInductionRecipe.
857
- if (WidenPhi->onlyScalarsGenerated (State->VF ))
857
+ if (WidenPhi->onlyScalarsGenerated (State->VF . isScalable () ))
858
858
continue ;
859
859
860
860
auto *GEP = cast<GetElementPtrInst>(State->get (WidenPhi, 0 ));
Original file line number Diff line number Diff line change @@ -1745,7 +1745,7 @@ class VPWidenPointerInductionRecipe : public VPHeaderPHIRecipe {
1745
1745
void execute(VPTransformState &State) override ;
1746
1746
1747
1747
// / Returns true if only scalar values will be generated.
1748
- bool onlyScalarsGenerated (ElementCount VF );
1748
+ bool onlyScalarsGenerated (bool IsScalable );
1749
1749
1750
1750
// / Returns the induction descriptor for the recipe.
1751
1751
const InductionDescriptor &getInductionDescriptor () const { return IndDesc; }
@@ -2966,6 +2966,9 @@ class VPlan {
2966
2966
}
2967
2967
2968
2968
bool hasVF (ElementCount VF) { return VFs.count (VF); }
2969
+ bool hasScalableVF () {
2970
+ return any_of (VFs, [](ElementCount VF) { return VF.isScalable (); });
2971
+ }
2969
2972
2970
2973
bool hasScalarVFOnly () const { return VFs.size () == 1 && VFs[0 ].isScalar (); }
2971
2974
Original file line number Diff line number Diff line change @@ -1650,9 +1650,9 @@ bool VPCanonicalIVPHIRecipe::isCanonical(
1650
1650
return StepC && StepC->isOne ();
1651
1651
}
1652
1652
1653
- bool VPWidenPointerInductionRecipe::onlyScalarsGenerated (ElementCount VF ) {
1653
+ bool VPWidenPointerInductionRecipe::onlyScalarsGenerated (bool IsScalable ) {
1654
1654
return IsScalarAfterVectorization &&
1655
- (!VF. isScalable () || vputils::onlyFirstLaneUsed (this ));
1655
+ (!IsScalable || vputils::onlyFirstLaneUsed (this ));
1656
1656
}
1657
1657
1658
1658
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
You can’t perform that action at this time.
0 commit comments