[llvm] [VPlan] Allow VPValue in match_fn without needing explicit template arguments. NFC (PR #205748)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 25 03:48:34 PDT 2026
================
@@ -27,20 +27,15 @@ template <typename Val, typename Pattern> bool match(Val *V, const Pattern &P) {
return P.match(V);
}
-/// A match functor that can be used as a UnaryPredicate in functional
-/// algorithms like all_of.
-template <typename Val, typename Pattern> auto match_fn(const Pattern &P) {
- return bind_back<match<Val, Pattern>>(P);
-}
-
template <typename Pattern> bool match(VPUser *U, const Pattern &P) {
auto *R = dyn_cast<VPRecipeBase>(U);
return R && match(R, P);
}
-/// Match functor for VPUser.
+/// A match functor that can be used as a UnaryPredicate in functional
+/// algorithms like all_of.
template <typename Pattern> auto match_fn(const Pattern &P) {
----------------
lukel97 wrote:
Ah right, even if it's templated it still instantiates to two different function pointers. So bind_back doesn't work.
https://github.com/llvm/llvm-project/pull/205748
More information about the llvm-commits
mailing list