-
Notifications
You must be signed in to change notification settings - Fork 188
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
Improved global deadcode elimination #1681
Conversation
bb2da77
to
ed8e401
Compare
You need to check the effect on #1612 (if not already done) |
b4776ee
to
b314e35
Compare
c8d7a75
to
1d8e0b6
Compare
1d8e0b6
to
b06b0e4
Compare
What about memory peak ? |
b06b0e4
to
3a52bb1
Compare
fbfd7f8
to
6e10aee
Compare
I fixed a memory / speed issue. The numbers are pretty good now. |
Cc @JasonGross |
I didn't really reviewed df60582 . The rest looks good. Happy to merge. |
And remove the `Undefined` expression from `Code.expr`.
Functions can have a large number of returned variables (typically, the body is a match with lot of cases), which resulted on an overly large of number of generated dependencies.
We were considering all instructions, even those which were inside dead functions. Refine the analysis to only take into account constraints corresponding to live code.
6e10aee
to
0982199
Compare
cc @micahcantor FYI |
We now take into account of whether an instruction is in a live function or not when generating constraints, so that dead code can no longer result in making a variable live.
We also keep track of nested module.
The performance of the algorithm has been greatly improved as well.
On the
basic_website
example of Tyxml, compiled with--opt 3
, I get the following reduction in code size:Here are the numbers regarding #1612, when compiling
with_bedrock2_fiat_crypto.byte
. For comparison, I have included an intermediate step which just optimizes the current algorithm.