[riscv-port] RFR: 8278041: riscv: Use t2 as the dedicated machine flags register in C2 [v2]
Yadong Wang
yadongwang at openjdk.java.net
Thu Dec 2 13:06:49 UTC 2021
On Thu, 2 Dec 2021 04:02:02 GMT, Fei Yang <fyang at openjdk.org> wrote:
> > Hi Yadong, it looks cost too much to reserve a dedicated register for control flag. I think in most cases we can use the 2 scratch registers instead. Can you show some complicated cases? We can check if they can be rewrite to avoid the complication.
>
> Well, I think there might be some tradeoff here. On the one hand, use the same register 't1' for two different purposes (scratch register & flags registers) at the same time looks rather error prone as mentioned in the PR description. On the other hand, use another register 't2' as the dedicated flags register could somehow affect the performance in certain cases even though this is not reflected on the specjbb2015 numbers. Personally, I have no obvious bias here. I would like to hear how the other Reviewers would say about this. Maybe @shipilev ? Thanks.
Agree. it's a tradeoff. There may be more spill/unspills in some scenarios of a high register pressue, but it is more friendly for code scheduling and higher maintainability with less data flow effects. By the way, we found this PR did not affect the performance of SPECjvm2008 on unmatched.
-------------
PR: https://git.openjdk.java.net/riscv-port/pull/21
More information about the riscv-port-dev
mailing list