-
Notifications
You must be signed in to change notification settings - Fork 5
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
Implement optimization step to replace use of upvalues with constants where upvalue references a constant #77
Comments
Here is one way to do this:
p.s. Need to know that all upvalue access occurs post initialization of local. One option is to insist on statements like:
That is, initialized in the local statement, and also all RHS values are constants. |
A second more sophisticated approach might be to implement a constant propagation data flow step; but unsure how to handle upvalues there. |
IR opcodes that may update a local (directly or via upvalue) are - |
…lized with a literal value.
…lized with a literal value.
…lized with a literal value.
Motivation:
Here
NAME
is an up-value but we can see it refers to a constant that is never amended. So we can rewrite the code as follows:The text was updated successfully, but these errors were encountered: