-
Notifications
You must be signed in to change notification settings - Fork 1.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
Refactor: Consolidate expression simplification code in simplify_expression.rs
#1374
Refactor: Consolidate expression simplification code in simplify_expression.rs
#1374
Conversation
FYI @rdettai this is one strategy to hopefully make reviews a bit easier: the first PR is mechanical and hopefully quick to review. The second PR can then have logic changes in it without as many mechanical changes. |
FYI @houqp / @jgoday / @liukun4515 -- I plan a bit of consolidation in the expression simplification logic. See this PR and the ones linked to it |
I will review this later. |
Thank you @liukun4515 -- this PR in particular looks massive but in reality is pretty simple -- I literally cut/pasted code from one module to another |
simplify_expression.rs
simplify_expression.rs
I don't actually think this change requires much review (as it just moves stuff around) so unless anyone has any objections, I'll plan to merge it sometime tomorrow |
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.
LGTM
Thank you @houqp and @liukun4515 |
NOTE: This PR just moves code around (it doesn't change logic) so please don't be too scared of its size
Which issue does this PR close?
Re #1160 (more sophisticated expression simplification)
Rationale for this change
There are at least three places where expressions are simplified, with some overlap:
const_evaluator.rs
,expression_simplifier.rs
, andoptimizer/util.rs
This makes it hard both to understand what simplifications are applied, as well as what is redundant (e.g. #1164)
What changes are included in this PR?
ConstEvaluator
andSimplifier
logic and tests intoexpression_simplifier.rs
.Are there any user-facing changes?
The location of
ConstEvaluator
has changed