From a93535c32231d98ef8d080adac626f88b18f9db5 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Tue, 12 Nov 2019 18:57:27 +0100 Subject: Fix order of CSE and pow2 expansion This way the expanded call to pow2 is resolved into a common subexpression. --- boltzgen/utility/optimizations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boltzgen/utility/optimizations.py b/boltzgen/utility/optimizations.py index 6dc23e9..0acf3e8 100644 --- a/boltzgen/utility/optimizations.py +++ b/boltzgen/utility/optimizations.py @@ -12,7 +12,7 @@ expand_neg_square = ReplaceOptim( lambda p: UnevaluatedExpr(Mul(p.base, p.base, evaluate = False)) ) -custom = [ +custom = cse_main.basic_optimizations + [ (expand_pos_square, expand_pos_square), (expand_neg_square, expand_neg_square) -] + cse_main.basic_optimizations +] -- cgit v1.2.3