[llvm] [LV] Fix ScalarIVSteps vplan pattern matcher, remove m_CanonicalIV() (PR #138298)

Graham Hunter via llvm-commits llvm-commits at lists.llvm.org
Tue May 6 04:01:00 PDT 2025


================
@@ -0,0 +1,46 @@
+//===- llvm/unittests/Transforms/Vectorize/VPlanPatternMatchTest.cpp ------===//
----------------
huntergr-arm wrote:

Looks like `vputils::isHeaderMask` is only called from `collectAllHeaderMasks`, explicitly on users of WideCanonicalIVs. So I guess something changed at some point such that we never executed that path on recipes besides a wide canonical iv, and those matchers are now effectively unused.

`collectAllHeaderMasks` itself is only called from `VPlanTransforms::addActiveLaneMask`, which contains an assert that there is a `VPWidenCanonicalIVRecipe` among the users of the canonical IV.

The reason I encountered this is trying to use the matchers for my early-exit-with-store PR, and finding they didn't work.

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


More information about the llvm-commits mailing list