Changes to constant handling - faster deduplication, more compact represtntation#680
Changes to constant handling - faster deduplication, more compact represtntation#680antoyo merged 1 commit intorust-lang:masterfrom
Conversation
antoyo
left a comment
There was a problem hiding this comment.
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. |
antoyo
left a comment
There was a problem hiding this comment.
After this, it should be good to merge.
Thanks!
1616001 to
4efa778
Compare
antoyo
left a comment
There was a problem hiding this comment.
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.