[llvm] [VPlan] Move EVL-based transforms to VPlanEVLTransforms.cpp (NFC) (PR #209883)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 17 08:20:55 PDT 2026


================
@@ -597,6 +599,43 @@ struct VPlanTransforms {
                                         VPCostContext &CostCtx);
 };
 
+/// Removes the permutation pattern \p Perm from any elementwise operations
+/// in the plan, by constructing a new permutation via \p Build.
+/// e.g. binop(perm(x), perm(y)) -> perm(binop(x,y)).
+template <typename Match_t, typename Builder>
+void pullOutPermutations(VPlan &Plan, Match_t Perm, Builder Build) {
----------------
fhahn wrote:

It is possible with minor changes, by adjusting the implementation in the .cpp to take `Perm` and `Build` as function_refs, and have thin wrapper in the header that takes care of the templated matchers, to keep existing call-sites tidy. Updated, thanks (also moved to VPlanUtils.h)

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


More information about the llvm-commits mailing list