-
Notifications
You must be signed in to change notification settings - Fork 11
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
Separate optimization of functions #660
Conversation
f0bf927
to
33a7c6a
Compare
pub fn build_program( | ||
program: &TreeProgram, | ||
inline_program: Option<&TreeProgram>, |
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.
Do we need both program and inline_program? How are they different? Is inline_program
the "full" program and program
a batch of programs to be optimized?
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.
The inline program is the original program for this iteration- if you make them the same, you might inline something that has already been inlined, causing blowup
br v4_ .b12_ .b13_; | ||
.b12_: | ||
v11_: int = id c5_; | ||
v11_: int = select v4_ c5_ c10_; |
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.
Nice that the select
optimization is applied. Any idea why it was not applied before?
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.
It's flaky, probably an extraction problem or same cost
This PR adds separate optimization of functions. This allows us to run the egraph separately for different functions, while still doing inlining and all our optimizations we did before.
We could also in the future choose which functions to batch together.
The extractor is now aware of what function it is extracting, which I plan to leverage soon for a better cost model of recursive functions.