[llvm] [VPlan] Allow VPValue in match_fn without needing explicit template arguments. NFC (PR #205748)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 25 02:10:15 PDT 2026


artagnon wrote:

> Currently if you want to use match_fn over a range of VPValues, you have to explicitly write `match_fn<VPValue>` otherwise it will resolve to the VPUser overload.

Could investigate, as there is already code like this:

```cpp
   VPValue *BackedgeVal = PhiR->getBackedgeValue();
    auto *FindLastSelect = cast<VPSingleDefRecipe>(BackedgeVal);
    if (HeaderMask &&
        !match(BackedgeVal,
               m_Select(m_Specific(HeaderMask),
                        m_VPSingleDefRecipe(FindLastSelect), m_Specific(PhiR))))
```

I think the underlying problem is that operands() is marked const?

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


More information about the llvm-commits mailing list