================
@@ -2432,12 +2437,40 @@ static void 
tryToCreateAbstractReductionRecipe(VPReductionRecipe *Red,
   Red->replaceAllUsesWith(AbstractR);
 }
 
+/// This function tries to create an abstract recipe from a partial reduction 
to
+/// hide its mul and extends from cost estimation.
+static void
+tryToCreateAbstractPartialReductionRecipe(VPPartialReductionRecipe *PRed) {
----------------
sdesmalen-arm wrote:

The way I read the code is that at the point of getting to this point in the 
code, it has recognised a reduction so there is a `VP[Partial]ReductionRecipe`. 
It then tries to analyse whether that recipe can be transformed into a 
`VPMulAccumulateReductionRecipe`. For `VPReductionRecipe` it will clamp the 
range to all the VFs that can be turned into a 
`VPMulAccumulateReductionRecipe`, but for `VPPartialReductionRecipe` it doesn't 
do that. I don't see why for partial reductions we'd do something different.

In fact, why wouldn't the `tryToMatchAndCreateMulAccumulateReduction` code be 
sufficient here? Now that you've made `VPPartialReductionRecipe` a subclass of 
`VPReductionRecipe`, I'd expect that code to function roughly the same.

https://github.com/llvm/llvm-project/pull/136173
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to