[llvm] [VP][EVL] Support select instruction with EVL-vectorization (PR #109614)
Mel Chen via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 7 05:50:28 PDT 2024
Mel-Chen wrote:
> I am wondering if there's a better way to avoid duplicating all or most recipes for EVL.
I’ve also been seriously thinking about this recently. But my thinking is whether it’s really necessary to create an EVL version for each recipe, especially after noticing VLOpt https://github.com/llvm/llvm-project/pull/108640.
I think maybe we only need to create EVL recipes for a small subset of recipes, such as those related to memory accesses (load, store, interleaved accesses), in-loop reduction... etc. IIUC, VLOpt should have the ability to prune the VL.
There are two pros to this approach:
1. Minimizing the number of added recipes.
2. We can reuse optimizations, such as InstCombine. For example, if there is a combination rule for `add <vec1>, <vec2>`, we can share that rule without needing to add the similar comibination rule for `vp.add`.
In conclusion, we only need to transforms the partial recipes into EVL recipes. As for which ones exactly, we can determine by whether the recipe has a mask operand to decide if an EVL recipe is necessary.
What do you think?
https://github.com/llvm/llvm-project/pull/109614
More information about the llvm-commits
mailing list