-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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: look into some small CQ issues in ValueTuple.GetHashCode #9165
Comments
The cost of the G_M4164_IG01:
G_M4164_IG02:
8B01 mov eax, dword ptr [rcx]
3909 cmp dword ptr [rcx], ecx
488D5104 lea rdx, bword ptr [rcx+4]
8B12 mov edx, dword ptr [rdx]
35EFFB8960 xor eax, 0x6089FBEF ; "inlined" RandomSeed
8BC8 mov ecx, eax
C1C105 rol ecx, 5
03C8 add ecx, eax
8BC1 mov eax, ecx
33C2 xor eax, edx
G_M4164_IG03:
C3 ret I wonder if this warrants turning RandomSeed into an intrinsic. The extra moves are gone but the nullcheck is still present. There's also the pesky LEA that can't be removed due to the lack of some kind of forward propagation. Otherwise the code looks pretty good. |
And what do you know - the extra moves are caused by a well known importer problem: After register allocation:
Node 77 and 91 are originally created in the importer:
In some cases the RA manages to allocate the same register to both variables involved in such an assignment and then no code is generated. But in some case different registers are allocated and we get those moves. Not sure if RA is to blame for this, seems more like a "where's copy propagation when you need it" problem... |
The redundant NULLCHECK is generated by morph for a
It's not clear why assertionprop doesn't handle this null check. It refuses to generate non-null assertions for byrefs that cannot be tracked back to an object reference but it's not readily obvious why: |
Couple of things to investigate here:
rcx
esi
andedx
test source
category:cq
theme:basic-cq
skill-level:expert
cost:small
The text was updated successfully, but these errors were encountered: