[Bug target/110136] After optimization, the $r1 register will be broken when jumping to the jump table, resulting in a significant increase in the false prediction rate of branch prediction.

chenglulu at loongson dot cn gcc-bugzilla@gcc.gnu.org
Tue Jun 6 09:55:24 GMT 2023


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110136

--- Comment #3 from chenglulu <chenglulu at loongson dot cn> ---
(In reply to Andrew Pinski from comment #1)
> >In the regrename passover optimization
> 
> I am trying to understand the issue.
> 
> 5912         ldx.d   $r20,$r16,$r19
>  5913         add.d   $r1,$r16,$r20
>  5914         jr      $r1
> 
> Is the issue is jr does not like r1 register or some other kind of
> performance issue?

This is because if you break $r1 when jumping to the jump table, it will affect
the branching prediction rate of the hardware.


More information about the Gcc-bugs mailing list