[llvm] [PatternMatch] Allow `m_ConstantInt` to match integer splats (PR #153692)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 15 05:18:40 PDT 2025


paulwalker-arm wrote:

>Whenever UseConstantIntForScalableSplat is enabled, and my understanding is that it will eventually be turned on by default, I think m_ConstantInt also matches constant splats?

Yes, `UseConstantIntForScalableSplat` will cause `m_ConstantInt` to fire for these cases.

> I wonder if we should just put more focus on enabling it by default. Is there much work left to do? cc @paulwalker-arm 

I agree, it would be nice to not increase the tech debt that will require removing once the default changes.

The scalable vector side is very close.  I'm down to my last couple of fixes, which I'll create PRs for next week.  One is a global-isel unit test and the other is something caught by the llvm-test-suite (assert fires in SelectOptimize.cpp).  Once those have landed I could do with somebody running the llvm-test-suite on RISCV hardware at which point I think we'll be good to try switching it on by default.

My only reservation is whether any of the remaining fixed-length failures (25, of which at least 3 are positive differences) are actually vector agnostic [1], so just highlight missing test coverage on the scalable vector side. That said, from a purely functional point of view the fixed-length side of things isn't far away either.

[1] I'm pretty sure `Transforms/InstSimplify/ConstProp/vecreduce.ll` is a good example. I have a fix for it, just not had chance to create a PR yet.



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


More information about the llvm-commits mailing list