-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SLP/RISCV: add test for vectorized ctpop, like in X86 #65330
Conversation
Would be good to add the corresponding test for the analysis/cost model |
Please rework your commit message. If your goal is to exercise the costs, then you really should be writing a cost model test, not an SLP test. I suspect that despite your wording, your actual intention is to add coverage showing that SLP can vectorize these examples on RISCV. (The difference in wording there is that the cost of the ctpop expansion is only part of that.) Note that we do appear to have cost model tests already in test/Analysis/CostModel/RISCV/int-bit-manip.ll. |
834e23d
to
7ce18ea
Compare
Thanks @preames; re-worded. |
Why specifically |
I was investigating some benchmarks where I came across
Do you have a different suggestion? |
7ce18ea
to
f7fe2f6
Compare
Recently, 7f26c27 turned on SLP by default for RISC-V, and although there are quite a few tests for SLP under the X86/ target, it is unclear whether the same constructs would be vectorized on RISC-V. This patch takes a step in the direction of remedying this, by noticing that ctpop is often vectorized on RISC-V, and adding four tests for different integer widths.
f7fe2f6
to
e21cfd6
Compare
LGTM as well. For your follow up on this, note that vector ctpop exists only under ZVBB. I suspect we didn't update the costs for ctpop if zvbb is enabled. Without it, vectorizing is probably not profitable with the default expansion. That'd be the first thing I'd check. If my guess is right, you're also want a CostModel test. @lukel97 FYI |
Recently, 7f26c27 turned on SLP by default for RISC-V, and although there are quite a few tests for SLP under the X86/ target, it is unclear whether the same constructs would be vectorized on RISC-V. This patch takes a step in the direction of remedying this, by noticing that ctpop is often vectorized on RISC-V, and adding four tests for different integer widths.
Recently, 7f26c27 turned on SLP by default for RISC-V, and although
there are quite a few tests for SLP under the X86/ target, it is unclear
whether the same constructs would be vectorized on RISC-V. This patch
takes a step in the direction of remedying this, by noticing that ctpop
is often vectorized on RISC-V, and adding four tests for different
integer widths.