RISC-V performance regression in telecomm-gsm benchmark after a00f7be392d9
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
telecomm-gsm (and toast, which contains the same function) are 8% slower after a00f7be392d9: https://cc-perf.igalia.com/db_default/v4/nts/703
It's caused by unprofitable SLP vectorization.
I think we're overcosting the scalar llvm.sadd.sat.i16: https://godbolt.org/z/ffadqhEW1
We're also probably undercosting the roots, we end up with both a `<1 x i16>` and `i16` store somehow:
```asm
vmv.x.s a0, v8
vslidedown.vi v8, v8, 1
vsetivli zero, 1, e16, mf4, ta, ma
vse16.v v8, (a3)
sh a0, 0(a4)
```
Contributor guide
Research direction
Reproduce the telecomm-gsm and toast regressions from the benchmark link and compare code generation before and after a00f7be392d9. Start by examining SLP vectorization costs for scalar llvm.sadd.sat.i16 and the vector/scalar store roots, using the provided Godbolt case and generated assembly. Done means the unnecessary vectorization no longer regresses performance or emits the extra stores.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100