-
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
Introduce GenTreeDebugOperKind
#64498
Conversation
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsRecently, I've compressed all "oper kinds" into an It also cleans up Diffs are not expected.
|
// making the table for those larger in Release builds. However, it resides in the same | ||
// "namespace" and so all values here must be distinct from those in "GenTreeOperKind". | ||
// | ||
enum GenTreeDebugOperKind |
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.
It would have been possible to make the values here part of GenTreeOperKind
, but I think having a separate enum is clearer overall.
{ | ||
DBK_FIRST_FLAG = GTK_MASK + 1, | ||
|
||
DBK_NOTHIR = DBK_FIRST_FLAG, // This oper is not supported in HIR (before rationalization). |
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.
We also have "early HIR" in the compiler, i. e. HIR before morph: GT_FIELD
, GT_PUTARG_TYPE
, GT_RET_EXPR
, GT_RUNTIMELOOKUP
, GT_CNS_STR
, GT_FTN_ADDR
, GT_INDEX
, so something like DBK_EHIR
can now be easily added, if people feel like it is valuable (I personally do not see a lot of value).
@dotnet/jit-contrib |
To track invariants related to opers in asserts without increasing the size of the primary oper kind table. Some shuffling of the oper table to make it look better.
Put all OperIsIdir opers together, fix up formatting, move opers around to more logical places.
There is not a lot of point in this being a "release" oper kind, as it is really only useful for debug checks.
308eca9
to
61a2668
Compare
Looks good to me, but want to give the rest @dotnet/jit-contrib one last chance to weigh in... |
Recently, I've compressed all "oper kinds" into an
unsigned char
, however, that meant all 8 bits were taken, while not all of the kinds are actually needed in Release builds. This change fixes that by introducing another, DEBUG-only, type that serves the same purpose -GenTreeDebugOperKind
and frees 2 bits (GTK_EXOP
requires a bit more work) in the process. It also introduces a new "kind" for opers that should not appear in HIR -DBK_NOTHIR
, counterpart toDBK_NOTLIR
.It also cleans up
gtlist.h
a little by getting rid of redundant parenthesis and moving opers around to more logical places. This speeds upOperIsIndir
by a good margin.No diffs.