-
Notifications
You must be signed in to change notification settings - Fork 4.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
Arm64: Align methods containing loops to 32B #59828
Conversation
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsFrom Arm Neoverse N1 Software Optimization Guide it is beneficial to align methods at 32B boundary. This will further work well when we start loop alignment at 32B boundaries. As a continuation of #2249, align bigger methods having loops to 32B alignment boundary.
|
@dotnet/jit-contrib , @jkotas |
@kunalspathak Have we ever seen an overestimation issue on Arm64? I thought we shouldn't given that all the instructions have the same size. |
That's right, but the assert we had was little lose. I updated it for Arm64 to make sure that the memory consumed size and the code size matches. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
If I read this right, we don't attempt to align methods with R2R?
#ifdef TARGET_XARCH | ||
// For x64/x86, align methods that are "optimizations enabled" to 32 byte boundaries if | ||
#if defined(TARGET_XARCH) || defined(TARGET_ARM64) | ||
// For x64/x86/arm64, align methods that are "optimizations enabled" to 32 byte boundaries if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, does it make any sense to align methods without loops in terms of performance? I just wonder if we should also enable it for "hot" methods with PGO/callcount data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could do that but we need to validate if it pays off. Remember that aligning methods to higher boundary is not free and introduces memory fragmentation.
Correct, that is a separate work item. |
Failures unrelated. |
From Arm Neoverse N1 Software Optimization Guide it is beneficial to align methods at 32B boundary. This will further work well when we start loop alignment at 32B boundaries.
As a continuation of #2249, align bigger methods having loops to 32B alignment boundary.
idCodeSize()
before printing the instruction which was necessary because the callers never pass thesz
and it