-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Make idSmallCns signed to allow including -1 #87373
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
Make idSmallCns signed to allow including -1 #87373
Conversation
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsThis makes
|
|
There is quite a heavy weight towards BeforeAfter |
9604d4e to
645fb49
Compare
|
CC. @dotnet/jit-contrib. This is ready for review. As per the summary above, this updates small constants to be tracked as signed which reduces the total emitter allocations for This also cleaned up the There are no diffs. There are some TP diffs ranging from minor improvements to minor regressions which depend on the exact number of bits being used and the required codegen to sign-extend the value, rather than zero extend (this is cheap, but it is an extra instruction). This was done as part of investigating #87016. Not having this makes resolving #87016 much more complex and would cause it to introduce TP regressions. This is because we would have to introduce additional checks/branches to handle the combinations of new EVEX bits alongside the different sized constants (even though SIMD only ever needs 8-bits). Such logic would happen as part of allocating the With this, instead we can rely on SIMD instructions always having a small constant. This then allows us to also make use of bits that are otherwise unused to make it very pay for play as the handling is entirely relegated to the EVEX code paths and only has to be touched on the path that adds the EVEX prefix. |
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. Thanks for updating the emitter stats.
Co-authored-by: Bruce Forstall <[email protected]>
This makes
idSmallCnssigned on all platforms to allow including -1. This also means that all 8-bit values (signed or unsigned) can currently be tracked as small constants across all platforms. Doing this covers an additional 2% of constants, bringing the total number of small constants up to 94.33%The below comment gives a comparison of the
beforevsafterfor crossgen ofS.P.Corelib. There are various bits of interesting information that can be extrapolated, but the clearest is that 92% of all constants fit into anint8_t. There are then 4.5% of values that will never fit into a small constant (they take more than 16 bits) and so there's only about 1.2% of values that could fit into a small constant if we were given between[11, 16]bits to use.This also includes some cleanup to the
EMITTER_STATShandling/printing to ensure that scenarios are all being tracked.