On Wed, 9 Apr 2025 06:41:51 GMT, Fei Yang <fy...@openjdk.org> wrote:

>  Sorry for not being clear enough. I am suggesting this:

  if (UseZicond) {
    FLAG_SET_DEFAULT(ConditionalMoveLimit, 3);
  }


I think this depends on whether we should enable ConditionalMoveLimit based on 
`UseZicond`? So, I'll leave it until we have a dicision about the following 
discussion.

> Without Zicond extension, conditional moves composed by C2 are simply 
> emulated with regular conditional branches on riscv, which I think is not 
> good in respect of performance.

Yes, when Zicond is not supported (or turned off), C2 use the alternative path 
which is `branch + mv`.  When Zicond was introduced 
(https://github.com/openjdk/jdk/pull/22386), the rational behind it is that 
brach bring regression, but I think it's based on the fact that code size is 
the same. But in cmove case, the size is increased, and in particular when C2 
unrolls a loop, it can increase the code size a lot, which is not good for 
cache. And the jmh test result shows that brach version is better than patch 
with Zicond and master with/wo Zicond in most of test cases.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24490#discussion_r2034819606

Reply via email to