@@ -2909,13 +2909,6 @@ void VPlanTransforms::canonicalizeEVLLoops(VPlan &Plan) {
29092909void VPlanTransforms::replaceSymbolicStrides (
29102910 VPlan &Plan, PredicatedScalarEvolution &PSE,
29112911 const DenseMap<Value *, const SCEV *> &StridesMap) {
2912- // Replace VPValues for known constant strides guaranteed by predicate scalar
2913- // evolution.
2914- auto CanUseVersionedStride = [&Plan](VPUser &U, unsigned ) {
2915- auto *R = cast<VPRecipeBase>(&U);
2916- return R->getRegion () ||
2917- R->getParent () == Plan.getVectorLoopRegion ()->getSinglePredecessor ();
2918- };
29192912 ValueToSCEVMapTy RewriteMap;
29202913 for (const SCEV *Stride : StridesMap.values ()) {
29212914 using namespace SCEVPatternMatch ;
@@ -2928,7 +2921,7 @@ void VPlanTransforms::replaceSymbolicStrides(
29282921 auto *CI =
29292922 Plan.getOrAddLiveIn (ConstantInt::get (Stride->getType (), *StrideConst));
29302923 if (VPValue *StrideVPV = Plan.getLiveIn (StrideV))
2931- StrideVPV->replaceUsesWithIf (CI, CanUseVersionedStride );
2924+ StrideVPV->replaceAllUsesWith (CI);
29322925
29332926 // The versioned value may not be used in the loop directly but through a
29342927 // sext/zext. Add new live-ins in those cases.
@@ -2942,7 +2935,7 @@ void VPlanTransforms::replaceSymbolicStrides(
29422935 APInt C =
29432936 isa<SExtInst>(U) ? StrideConst->sext (BW) : StrideConst->zext (BW);
29442937 VPValue *CI = Plan.getOrAddLiveIn (ConstantInt::get (U->getType (), C));
2945- StrideVPV->replaceUsesWithIf (CI, CanUseVersionedStride );
2938+ StrideVPV->replaceAllUsesWith (CI);
29462939 }
29472940 RewriteMap[StrideV] = PSE.getSCEV (StrideV);
29482941 }
0 commit comments