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.rssimplify_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 |
|
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.rsThis 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?
ConstEvaluatorandSimplifierlogic and tests intoexpression_simplifier.rs.Are there any user-facing changes?
The location of
ConstEvaluatorhas changed