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 @@ -859,7 +859,7 @@ void VPlan::execute(VPTransformState *State) {
859
859
auto *WidenPhi = cast<VPWidenPointerInductionRecipe>(&R);
860
860
// TODO: Split off the case that all users of a pointer phi are scalar
861
861
// from the VPWidenPointerInductionRecipe.
862
- if (WidenPhi->onlyScalarsGenerated (State->VF ))
862
+ if (WidenPhi->onlyScalarsGenerated (State->VF . isScalable () ))
863
863
continue ;
864
864
865
865
auto *GEP = cast<GetElementPtrInst>(State->get (WidenPhi, 0 ));
Original file line number Diff line number Diff line change @@ -1736,7 +1736,7 @@ class VPWidenPointerInductionRecipe : public VPHeaderPHIRecipe {
1736
1736
void execute(VPTransformState &State) override ;
1737
1737
1738
1738
// / Returns true if only scalar values will be generated.
1739
- bool onlyScalarsGenerated (ElementCount VF );
1739
+ bool onlyScalarsGenerated (bool Scalable );
1740
1740
1741
1741
// / Returns the induction descriptor for the recipe.
1742
1742
const InductionDescriptor &getInductionDescriptor () const { return IndDesc; }
@@ -2957,6 +2957,9 @@ class VPlan {
2957
2957
}
2958
2958
2959
2959
bool hasVF (ElementCount VF) { return VFs.count (VF); }
2960
+ bool hasScalableVF () {
2961
+ return any_of (VFs, [](ElementCount VF) { return VF.isScalable (); });
2962
+ }
2960
2963
2961
2964
bool hasScalarVFOnly () const { return VFs.size () == 1 && VFs[0 ].isScalar (); }
2962
2965
Original file line number Diff line number Diff line change @@ -1686,9 +1686,9 @@ bool VPCanonicalIVPHIRecipe::isCanonical(
1686
1686
return StepC && StepC->isOne ();
1687
1687
}
1688
1688
1689
- bool VPWidenPointerInductionRecipe::onlyScalarsGenerated (ElementCount VF ) {
1689
+ bool VPWidenPointerInductionRecipe::onlyScalarsGenerated (bool Scalable ) {
1690
1690
return IsScalarAfterVectorization &&
1691
- (!VF. isScalable () || vputils::onlyFirstLaneUsed (this ));
1691
+ (!Scalable || vputils::onlyFirstLaneUsed (this ));
1692
1692
}
1693
1693
1694
1694
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
You can’t perform that action at this time.
0 commit comments