-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[jit] Don't emit a redundant move in lazy fetch trampolines on AMD64. #5346
Conversation
how about you are trying your suggested general approach first? submit a PR and let us see what breaks 🙂 |
It would be better to just use an if () instead of an #ifdef, it looks better, and the compiler will optimize it away the same. |
Codegen macros should generate code, they should not do optimization. |
Thanks for the feedback, I've replaced the macro with an if as suggested. @lewurm |
@monojenkins rebase |
cannot rebase:
|
cannot rebase:
|
cannot rebase:
|
Hello,
This simple patch is meant to remove meaningless
movq %rdi, %rdi
instructions generated in rgctx fetch trampolines.For instance, jitting
csc.exe
would cause 37 such moves to appear.A more general approach would be making
*_mov_reg_reg
skip on move construction if it sees the source and the destination are the same, but I'm cautious that some of the existing code may be somehow relying on the expectation that a dummy instruction will always be built. (it doesn't appear so, though)