[llvm] [VPlan] Impl VPlan-based pattern match for ExtendedRed and MulAccRed (PR #113903)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 22 10:25:24 PDT 2025


================
@@ -272,6 +272,14 @@ Type *VPTypeAnalysis::inferScalarType(const VPValue *V) {
             // TODO: Use info from interleave group.
             return V->getUnderlyingValue()->getType();
           })
+          .Case<VPExtendedReductionRecipe>(
+              [](const VPExtendedReductionRecipe *R) {
+                return R->getResultType();
+              })
+          .Case<VPMulAccumulateReductionRecipe>(
+              [](const VPMulAccumulateReductionRecipe *R) {
+                return R->getResultType();
+              })
----------------
fhahn wrote:

The lambda should have used `const auto *R` (updated the suggestion) which is something that should be supported by the type switch, I think we use that feature in a number of places

https://github.com/llvm/llvm-project/pull/113903


More information about the llvm-commits mailing list