-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Match BOX idioms early in the importer #23550
Conversation
Number of small improvements in CoreLib R2R image (the CoreLib image is about 2kB smaller with this change). For example: ; Assembly listing for method ThrowHelper:IfNullAndNullsAreIllegalThenThrow(ref,int) Before:
After:
|
@AndyAyersMS PTLA |
src/jit/importer.cpp
Outdated
// box + br_true/false | ||
if ((codeAddr + ((codeAddr[0] >= CEE_BRFALSE) ? 5 : 2)) <= codeEndp) | ||
{ | ||
if (!(impStackTop().val->gtFlags & GTF_SIDE_EFFECT)) |
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.
Would it be better to just spill the side-effects here instead?
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.
I think it's cleaner like you have it -- leaves the eval stack unmodified when the patterns don't match.
Yay, the JIT team got bigger 😄 |
Someone should write a "detailed "book on it, there are a lot of info/book on GC but few info(other than code and old high level BOTR) of this great piece of tech. |
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.
Changes LGTM.
Interesting that this led to diffs even when optimizing. I would have expected we'd end up with teh same code. Did you look into why this happens? If not, I'll put it on my todo list.
I have looked into a few of them:
|
Commit migrated from dotnet/coreclr@13bc9b7
This avoids some of the surprise allocations mentioned in #22984, and helps with downstream optimizations in some cases.