-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add support for deduction of most kinds of type constant. #4389
Add support for deduction of most kinds of type constant. #4389
Conversation
Depends on #4380. |
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.
Basically LGTM, feel free to merge when ready.
worklist_.AddInstArg(kind0, param_inst.arg0(), arg_inst.arg0(), | ||
needs_substitution); | ||
worklist_.AddInstArg(kind1, param_inst.arg1(), arg_inst.arg1(), | ||
needs_substitution); |
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.
Is it worth at all conditioning this based on the # of args to the inst? Or if the arg is invalid?
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 could have different case blocks for different numbers of arguments, but I think it's probably not worth the complexity and tighter coupling. The switch in AddInstArg
immediately catches the case of no corresponding argument, so we should deal with that case quickly.
So far, we don't have any cases where the arg can be present but invalid. I guess we can handle that if/when it starts coming up.
This adds deduction in all the cases where we can match the instruction fields of the parameter against the corresponding instruction fields of the argument. This handles all current type constants except for struct types, for which we would want to match by field name.
Co-authored-by: Jon Ross-Perkins <[email protected]>
7d9e939
to
e82a0aa
Compare
This adds deduction in all the cases where we can match the instruction
fields of the parameter against the corresponding instruction fields of
the argument. This handles all current type constants except for struct
types, for which we would want to match by field name.