Also apply simplification rules that require multiple identical sub-expressions.

This commit is contained in:
chriseth committed 2018-02-06 22:51:30 +01:00
1 parent f7392cc698
commit 5523296eaa
5 files changed
+163 -3

No files matched your search

@@ -40,6 +40,7 @@ void ExpressionSimplifier::visit(Expression& _expression)
ASTModifier::visit(_expression);
while (auto match = SimplificationRules::findFirstMatch(_expression))
{
// Do not apply the rule if it removes non-constant parts of the expression.
// TODO: The check could actually be less strict than "movable".
// We only require "Does not cause side-effects".
if (std::get<2>(*match) && !MovableChecker(_expression).movable())