-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Conversation
GT_BOX doesn't do anything so it should just get the VN of its sole operand. This allows assertion prop to see that the result of BOX is not null (since the BOX operand is the result of an object allocation which is never null).
jit-diff summary:
|
A complete (mostly, unfortunately different generic instantiations are reported as one method) list of affected methods is interesting to see where a certain pattern occurs - boxing followed by a null/type check:
|
It looks like coreclr/src/mscorlib/shared/System/ValueTuple.cs Lines 2259 to 2268 in 64ea348
Hrm, this |
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.
Thanks for spotting this. Looks good.
@AndyAyersMS @mikedn Looks like this caused an assert in armlb testing: https://ci.dot.net/job/dotnet_coreclr/job/master/job/armlb_cross_checked_windows_nt_flow/365/
|
Hmm, armlb is the legacy backend, right? |
Correct. |
Saw something similar over on desktop with the x86 frankenjit:
|
Thanks, I've reproduced locally with legacynonjit.dll and the following code: Dictionary<string, bool?> d = new Dictionary<string, bool?>();
d.Add("foo", true);
return d["foo"]; I'll investigate more this evening (your morning-afternoon). Heading out to work... |
GT_BOX
doesn't do anything so it should just get the VN of its sole operand. This allows assertion prop to see that the result ofBOX
is not null (since theBOX
operand is the result of an object allocation which is never null).