[llvm] Try to use non-volatile registers for `preserve_none` parameters (PR #88333)

via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 19 15:45:24 PDT 2024


weiguozhi wrote:

I ran the udp protobuf parsing micro benchmarks on my desktop. Following are the results. Base uses the original preserve_none implementation. Test uses the new parameter passing order from this patch.

```
                                                      base           test
BM_Parse_Proto2<FileDescSV, InitBlock, Alias>    677.912MB/s       693.477MB/s        +
BM_Parse_Proto2<FileDesc, InitBlock, Copy>       727.151MB/s       752.567MB/s        +
BM_Parse_Proto2<FileDesc, UseArena, Copy>        710.576MB/s       740.293MB/s        +
BM_Parse_Proto2<FileDesc, NoArena, Copy>         391.355MB/s       390.845MB/s        =
```

The first 3 sub tests got performance improvement due to reduced register copy instructions from the preserve_none parsing functions. The last test is not impacted. I checked its profile, found there are more register spilling in parsing function FastSS1. Because there is no live ranges change, I think it's more like a register allocation problem.

So the general result is very positive for protobuf parsing.

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


More information about the llvm-commits mailing list