cmd/compile: regalloc fails to reserve key register (CX) for future code #44671
Labels
Milestone
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After CLs 297049 and 297050, generate code for shrVU_g in math/big.
The tight inner loop compiles to:
This contains unnecessary copies. One is #44670.
The others are
CX
contention. Regalloc decided to puti
inCX
. Unfortunately,CX
is the required register for the shift amount input for theSHRDQ
instruction. So we shufflei
in and out ofCX
on every iteration.I thought regalloc had some amount of lookahead to avoid using highly restricted registers in upcoming code, to avoid this situation. Either I was wrong, or it isn't working as desired here.
I believe that fixing this issue would make the generated code as fast (or nearly so) as the hand-written assembly, allowing us to delete the assembly.
cc @randall77 @cherrymui
The text was updated successfully, but these errors were encountered: