-
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
JIT: Optimize bit-wise AND with a constant mask in combination with a left shift in a compare #111979
JIT: Optimize bit-wise AND with a constant mask in combination with a left shift in a compare #111979
Conversation
…a left shift in a compare This optmizes the generated code when having a pattern like '(SomeConstant & (1 << value)) != 0' which was previously only optimized for '(variable & (1 << value)) != 0'. Fix dotnet#111554
@dotnet-policy-service agree |
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!
@jakobbotsch should this be merged? |
Yes, I was waiting for CI and it fell off my radar. Thanks again! |
* main: (30 commits) JIT: Optimize bit-wise AND with a constant mask in combination with a left shift in a compare (dotnet#111979) Change how we build the cross-OS DAC to support building in the VMR (dotnet#111927) Add Windows Server 2025 to test configurations (dotnet#111938) [PERF] Move performance testing YAML from dotnet/runtime to dotnet/performance (dotnet#111454) arm64: Add support for Bitwise OR NOT & XOR NOT (dotnet#111893) JIT: Fix cross crossgen comparison failures (dotnet#112078) Bump `StyleCop.Analyzers` to `1.2.0-beta.556` (dotnet#111278) Remove `RequiresProcessIsolation` on InterfaceFolding tests (dotnet#112098) Use hardlinks in helixpublishwitharcade (dotnet#112091) Update breaking change rules regarding byref/objref fields. (dotnet#112087) [daccess] Do not use USE_DAC_TABLE_RVA on Apple platforms (dotnet#112076) use collection syntax in illink (dotnet#108458) Include PDB for all TfmRuntimeSpecificPackageFile (dotnet#111879) [main] Update dependencies from dotnet/emsdk (dotnet#111690) Enable Mono tests (dotnet#111981) Let the debugger knows DATAS is on (dotnet#107115) Tests ran counter (dotnet#111145) Some System.Decimal performance improvements (dotnet#99212) [mono][mini] Remove support for the Xamarin.iOS and Xamarin.Mac assemblies in the AOT compiler. (dotnet#108886) Remove one usage of `Unsafe.AsPointer`. (dotnet#112079) ...
This resolves #111554.
C# code (example code from the issue):
x64 (before):
x64 (after):