-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
feat(rust,python): optimize away nested unions in lp #7861
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.
Thanks! I have left one remark.
|
||
match lp { | ||
Union { inputs, options } | ||
if inputs |
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.
Can we add a state flattened_by_opt
to the UnionOptions
. This will prevent we run this loop every time this rule is checked. It is not uncommon to have unions over a lot of files, so it is worth it to return early in such a case.
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.
not sure I 100% follow. If we add a flattened_by_opt
when would we set it? and when would we return early if it were set?
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.
We would set it in this optimization and in this optimization we return early.
These optimization rules can be called many times (until fixed point).
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.
@ritchie46, I added the opt state flattened_by_opt
. This should be ready for final review.
e961ec9
to
40f3fb0
Compare
@ritchie46 The test failures seem unrelated to my work. I already rebased from master, So i'm not entirely sure why those tests are failing. |
Yeap, test failure is unrelated. |
Implementation was mostly taken from the
SimplifyExprRule
for flattening nested concat_str calls.This'll flatten any arbitrarily nested unions into a single union.
closes #7855