-
Notifications
You must be signed in to change notification settings - Fork 219
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 MakeArray instruction to the ssa refactor #1733
Comments
@jfecher now that the SSA has matured further, what are your thoughts on this issue? |
@kevaundray we haven't had an issue arise from this in a while so changing this may not fix any bugs but it's something we could explore to see if it cleans up the code any. |
Okay I'll leave it open and we can review EOY as we'd have even more experience then |
I'm inclined to try adding this again with the goal of removing The main issue with The main difficulty with removing |
Closing this after the experiment in #2494 wasn't a large code improvement. |
Reopening this issue since although there was no large code improvement in that unfinished PR, I think it still think it simplifies the mental model of SSA a bit to have no nested ValueIds. |
Problem
Several recent issues (#1688, #1698) have been a result of ValueIds being nested inside Values (e.g.
Value::Array
). This necessitated a more-complex, recursiveget_value
/resolve
function which must also now require a mutable context to insert any new arrays required. This necessitated more cloning which is otherwise unnecessary.Happy Case
We could make a rule going forward that new nested value ids cannot appear without an instruction that introduced them first. This is for the benefit of passes which map instructions (and thus their value results) to new instructions in order. These passes would be able to continue looking instruction by instruction without needing to recursively peek into the values it references.
Current example:
New example:
To keep simplification on array instructions working, we will need to do one of:
make_array
instruction is created, always callset_value
on its result to set it to aValue::Array
instead of the defaultValue::Instruction
.get_array_constant
to also check forValue::Instruction
s which refer to a make_array instruction.Alternatives Considered
No response
Additional Context
No response
Would you like to submit a PR for this Issue?
No
Support Needs
No response
The text was updated successfully, but these errors were encountered: