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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 30 14:09:40 PDT 2024


fhahn wrote:

> I think currently we need mul-extend-reduction and extend-reduction recipe to model these reduction pattern in the VPlan.
>
 
@davemgreen do you think those would be enough?

> Yes, generating new recipe is good but using new recipe to model these patterns would duplicate lots of codes in the `execute()` function since we lack of middle-end IRs for these patterns. The new recipes would still need to generate all vector instructions for recipes that has been folding into it.

This might be a case where gradual lowering would help. We could have a more abstract recipe early on which combines mul-extend in a single recipe, facilitating simple cost-computation. Before code-gen, we can replace the recipe with wide recipes for the adds and extends, so there is no need to duplicate codegen for those, similar to how things are sketched for scalar phis in https://github.com/llvm/llvm-project/pull/114305

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


More information about the llvm-commits mailing list