-
Notifications
You must be signed in to change notification settings - Fork 82
Changes to constant handling - faster deduplication, more compact represtntation #680
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
Conversation
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.
Very nice work!
Here's a first review for the ConstAllocation part.
As a nice bonus, this PR seems to drastically reduce the ammount of memory used to build I can now build |
Very nice improvement! |
On |
Should be good to merge now. |
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.
After this, it should be good to merge.
Thanks!
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.
A few nitpicks:
1616001
to
4efa778
Compare
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.
After this last nitpick is fixed, I believe I can merge.
Thanks!
In your commit message: *representation |
Did not see that, thanks :)! |
Thanks a lot for this nice improvement! |
This PR changes a few things.
First of all, it caches ConstAllocations, ensuring that for a given ConstAllocation(or one an identical one with a different aligement), you will get the exact same Rvalue.
This allows us to simplify the deduplication code in
static_addr_of
, and remove the formating (which caused memory leaks).Additonally, this allows constant byte sequences to sometimes be represented in a more compact fashion. From a few checks, it looks like ~80 % of constant byte sequences can be optimized this way.