[llvm-branch-commits] [llvm] [RISCV] Support select optimization (PR #80124)

Wang Pengcheng via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Mar 19 03:08:36 PDT 2024


wangpc-pp wrote:

> > > JFYI, I don't find the AArch64 data particularly convincing for RISCV. The magnitude of the change even on AArch64 is small, and could easily be swung one direction or the other by differences in implementation between the backends.
> > 
> > 
> > Yeah! The result will differ for different targets/CPUs. One RISCV data for SPEC 2006 (which is not universal I think) on an OoO RISCV CPU, options: `-march=rv64gc_zba_zbb_zicond -O3`:
> > ```
> > 400.perlbench    0.538%
> > 401.bzip2        0.018%
> > 403.gcc          0.105%
> > 429.mcf          1.028%
> > 445.gobmk        -0.221%
> > 456.hmmer        1.582%
> > 458.sjeng        -0.026%
> > 462.libquantum   -0.090%
> > 464.h264ref      0.905%
> > 471.omnetpp      -0.776%
> > 473.astar        0.205%
> > ```
> > The geomean is: 0.295%. The result can be better with PGO I think (haven't tried it). Some related discussions: https://discourse.llvm.org/t/rfc-cmov-vs-branch-optimization. So I think we can be just like AArch64, make it a tune feature and processors can add it if needed.
> 
> Do we have any data without Zicond? The worst case Zicond sequence is czero.eqz+czero.nez+or which is kind of expensive. Curious if this is pointing to Zicond being used too aggressively.

Sorry, I didn't run it with this configuration.
I was going to run some small benchmarks (the hardware resources were busy) like coremark on CA model today, but it seems there is no codegen change with selectopt enabled. :-(
Will lacking this data block this PR?


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


More information about the llvm-branch-commits mailing list