@@ -1085,36 +1085,36 @@ void VPlanTransforms::simplifyRecipes(VPlan &Plan, Type &CanonicalIVTy) {
1085
1085
}
1086
1086
}
1087
1087
1088
- static void convertToUniformRecipes (VPlan &Plan) {
1088
+ static void narrowToSingleScalarRecipes (VPlan &Plan) {
1089
1089
if (Plan.hasScalarVFOnly ())
1090
1090
return ;
1091
1091
1092
1092
for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(
1093
1093
vp_depth_first_shallow (Plan.getVectorLoopRegion ()->getEntry ()))) {
1094
1094
for (VPRecipeBase &R : make_early_inc_range (reverse (*VPBB))) {
1095
- // Try to narrow wide and replicating recipes to uniform recipes, based on
1096
- // VPlan analysis.
1095
+ // Try to narrow wide and replicating recipes to single scalar recipes,
1096
+ // based on VPlan analysis.
1097
1097
auto *RepR = dyn_cast<VPReplicateRecipe>(&R);
1098
1098
if (!RepR && !isa<VPWidenRecipe>(&R))
1099
1099
continue ;
1100
- if (RepR && RepR->isUniform ())
1100
+ if (RepR && RepR->isSingleScalar ())
1101
1101
continue ;
1102
1102
1103
1103
auto *RepOrWidenR = cast<VPSingleDefRecipe>(&R);
1104
- // Skip recipes that aren't uniform and don't have only their scalar
1105
- // results used. In the latter case, we would introduce extra broadcasts.
1106
- if (!vputils::isUniformAfterVectorization (RepOrWidenR) ||
1104
+ // Skip recipes that aren't single scalars and don't have only their
1105
+ // scalar results used. In the latter case, we would introduce extra
1106
+ // broadcasts.
1107
+ if (!vputils::isSingleScalar (RepOrWidenR) ||
1107
1108
any_of (RepOrWidenR->users (), [RepOrWidenR](VPUser *U) {
1108
1109
return !U->usesScalars (RepOrWidenR);
1109
1110
}))
1110
1111
continue ;
1111
1112
1112
- auto *Clone =
1113
- new VPReplicateRecipe ( RepOrWidenR->getUnderlyingInstr (),
1114
- RepOrWidenR-> operands (), /* IsUniform */ true );
1113
+ auto *Clone = new VPReplicateRecipe (RepOrWidenR-> getUnderlyingInstr (),
1114
+ RepOrWidenR->operands (),
1115
+ true /* IsSingleScalar */ );
1115
1116
Clone->insertBefore (RepOrWidenR);
1116
1117
RepOrWidenR->replaceAllUsesWith (Clone);
1117
- RepOrWidenR->eraseFromParent ();
1118
1118
}
1119
1119
}
1120
1120
}
@@ -1813,7 +1813,7 @@ void VPlanTransforms::optimize(VPlan &Plan) {
1813
1813
runPass (simplifyRecipes, Plan, *Plan.getCanonicalIV ()->getScalarType ());
1814
1814
runPass (simplifyBlends, Plan);
1815
1815
runPass (removeDeadRecipes, Plan);
1816
- runPass (convertToUniformRecipes , Plan);
1816
+ runPass (narrowToSingleScalarRecipes , Plan);
1817
1817
runPass (legalizeAndOptimizeInductions, Plan);
1818
1818
runPass (removeRedundantExpandSCEVRecipes, Plan);
1819
1819
runPass (simplifyRecipes, Plan, *Plan.getCanonicalIV ()->getScalarType ());
0 commit comments