Uh oh!
There was an error while loading. Please reload this page.
gh-131798: Small improvements to remove_unneeded_uops - #134554
Conversation
| if (op_without_push[last->opcode]) { | ||
| if (op_without_push[last->opcode] && op_without_pop[opcode]) { | ||
| last->opcode = op_without_push[last->opcode]; | ||
| opcode = buffer[pc].opcode = op_without_pop[opcode]; |
There was a problem hiding this comment.
When we are here, we know that op_without_pop[opcode] || op_without_pop_null[opcode] is true. But we should also make sure that op_without_pop[opcode] itself is true, otherwise it is possible to accidentally write 0 as the opcode.
Fidget-Spinner
commented
May 23, 2025
I read the code but just checking that I understand it right: |
tomasr8
commented
May 23, 2025
Yes, that's exactly the case! This allows us to optimize for instance: into just |
bedevere-bot
commented
May 23, 2025
|
…GH-134554) Improve remove_unneeded_uops
…GH-134554) Improve remove_unneeded_uops
…GH-134554) Improve remove_unneeded_uops
_CHECK_PERIODICto the list of skipped instructions. I believe this is safe to do since this instruction does not modify the stack. It is also relatively common so I think it's worth it to skip it.