-
Notifications
You must be signed in to change notification settings - Fork 225
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
chore: Remove ValueIds from SSA #6850
Conversation
…into jf/no-value-types
Changes to Brillig bytecode sizes
🧾 Summary (10% most significant diffs)
Full diff report 👇
|
Changes to number of Brillig opcodes executed
🧾 Summary (10% most significant diffs)
Full diff report 👇
|
Changes to circuit sizes
🧾 Summary (10% most significant diffs)
Full diff report 👇
|
Peak Memory Sample
|
Compilation Sample
|
Initial results are very ungood, I think this is because FieldElement is 256bits causing Value to be 320 bits. |
Execution Sample
|
Value's size has been reduced, although I'm unsure why the changes aren't more dramatic. I'd think removing the |
Potentially an increased size of the replaced values map due to holding the actual values now? |
Yes, but even then the increase is only from 32 to 64 bits which I'd expect to be offset by the other removals in this PR. |
8ce4c23
to
20a5713
Compare
From manually timing programs, it seems this PR is about ~5-8% faster compiling programs compared to master |
After some more perf testing, I'm going to close this PR. Testing it against master on rollup-base-private, this PR is compiling in ~90s compared to master's ~60s. Unsure if this is from the same regression as conditional_1 but this PR has been enough of a rabbit hole already that I'd rather close it. |
Description
Problem*
Summary*
Removes
ValueId
s from SSA to reduce memory usage and hopefully improve compiler performance as well.ValueId
s are replaced by theValue
enum itself, which is now thinner and implementsCopy
.block_parameters
,instruction_results
) now no longer require references to the DFG, so we don't need as much cloning in several passes.Value::constant
just needs a field and a type since we don't need the separate map to keep each valueid unique to each constant value any more. Similarly, evenValue::Instruction
only needs an instruction id and a position. No need to store instruction id values in an external map in the dfg. This means we can get rid of quite a few fields on the DFG to save memory.DFG::set_value_from_id
can no longer mutate the value a ValueId points to, and instead relies solely on the internal map between values.Additional Context
The integration tests are currently all passing, but there is a stack overflow somewhere within the test runner when running the unit tests, in between running the actual tests.
I have not started migrating all the SSA parser tests in the evaluator, these are expected to be failing currently since the display of valueids has changed.
Documentation*
Check one:
PR Checklist*
cargo fmt
on default settings.