YJIT: Stop padding nops at jump instructions on Arm #6755
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
When we ported YJIT to Arm64, jump instructions used to appear very often in short blocks that could be invalidated. Small invalidation points were typically a YJIT entry, a jump instruction, or just long enough. So it was enough to just pad YJIT entries (with
PadEntryExit
IR, which was then renamed toPadInvalPatch
) and jump instructions.However, when we changed the code layout #6460 for Code GC, many other instructions also started to appear in places that need invalidation; the beginning of a page. So we built a more robust solution to the padding for invalidation:
PadInvalPatch
, which is an IR added to every invalidation point, including YJIT entries.As long as we have
PadInvalPatch
on every invalidation point, thePadInvalPatch
should be able to add padding even if jump instructions don't do that.Changes
So this PR stops padding nops on jump instructions, fully delegating the job to
PadInvalPatch
. This makes A LOT of jump instructions on Arm shorter. This is the actual performance gain that #6460 was supposed to deliver.