-
Notifications
You must be signed in to change notification settings - Fork 2.6k
JIT: some lclvars related cleanup #19077
Conversation
Consolidate various compiler globals used when setting local var ref counts by folding them into the visitor: * lvaMarkRefsCurBlock * lvaMarkRefsCurStmt * lvaMarkRefsWeight Remove the largely vestigial `lvPrefReg` and associated methods to set or modify this field. Haven't verified but this is likely a remmant of the legacy backend. In the one remaning use (lcl var sorting predicates), swap in `lvIsRegArg` instead, which gets most of the same cases.
|
@dotnet/jit-contrib PTAL Some minimal diffs: |
CarolEidt
left a comment
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.
Nice! I'm loving all this cleanup. I just had one comment suggestion.
| // stmt - stmt that the tree node belongs to | ||
| // | ||
| // Notes: | ||
| // Invoked via the MarkLocalVarsVisitor |
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.
Might be nice to add a bit more detail here about what the "and more" is - e.g. "In addition to increment local var reference counts, it identifies additional local var properties such as those used by assertion prop."
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. I was surprised how much it did and never got back to filling it all in.
Ok if I do this in my next change? I need to make sure that the only required part for minopts is having nonzero ref counts.
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.
Fine with me, this is already way better than what was there!
|
OSX failures look like the somewhat typical IO pal test failures: @dotnet-bot retest OSX10.12 x64 Checked Innerloop Build and Test |
briansull
left a comment
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.
Looks Good
|
|
||
| // This fires when an uninitialize value for 'weight' is used (see lvaMarkRefsWeight) | ||
| // This fires when an uninitialize value for 'weight' is used | ||
| assert(weight != 0xdddddddd); |
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.
The value here '0xdddddddd' depends upon the value JitDefaultFill, we should fix this to call the method:
T UninitializedWord(Compiler* comp)
so that it compares with the correct value when JitDefaultFill isn't 0xdd.
Also code like this cause problems if we try to set JitDefaultFill to the value of 0x00 and sometimes 0x01 causes problems.
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.
Now that the weight always comes in via a parameter and not a field on the compiler instance this check seems much less useful anyways.
So I'd suggest we just remove it. Will do this in my next round of cleanups.
Consolidate various compiler globals used when setting local var ref counts by folding them into the visitor: * lvaMarkRefsCurBlock * lvaMarkRefsCurStmt * lvaMarkRefsWeight Remove the largely vestigial `lvPrefReg` and associated methods to set or modify this field. Haven't verified but this is likely a remmant of the legacy backend. In the one remaning use (lcl var sorting predicates), swap in `lvIsRegArg` instead, which gets most of the same cases.
Consolidate various compiler globals used when setting local var ref
counts by folding them into the visitor:
Remove the largely vestigial
lvPrefRegand associated methods to setor modify this field. Haven't verified but this is likely a remmant of
the legacy backend.
In the one remaning use (lcl var sorting predicates), swap in
lvIsRegArginstead, which gets most of the same cases.