[PATCH] D143162: [AArch64] Add PredictableSelectIsExpensive feature for the Neoverse V1

Aleksandr Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 7 03:52:20 PST 2023


aleksandr.popov added a comment.

> In the end of the day it is performance of the particular heuristics that matters. Do you have performance measurements to share? Are they with the 99% or 75%? Did you plan to change that? And are you running with or without PGO? Thanks.

Yep, we have been running benchmarks on java VM with llvm based JIT compiler. So that SelectOptimize pass relied on the profile information about branches weights.

The most runs with were made on the following benchmarks:  
Scala Benchmark Suite 0.0%
SPECjvm2008 +2,5% 
We've done a big amount of repeats to ensure that there is no nosie in the results.

During results analysis we've found out that there were cases when it's reasonable to convert select to branch and to get better score on the benchmark, but SelectOptimize pass made a decision not to do that.
There were 2 approaches to fix that:

- to update SelectOptimize's loop level heuristic;
- to use another one heuristic on the top of SelectOptimize pass;

The second approach turned out to be simple and effective: we just converted all selects with prediction rate > 75%. 
Anger Fog's rule of thumb for x86 seems to be working fine for AArch64 also (https://discourse.llvm.org/t/rfc-cmov-vs-branch-optimization/6040)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143162/new/

https://reviews.llvm.org/D143162



More information about the llvm-commits mailing list