aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-11-12 18:57:27 +0100
committerAdrian Kummerlaender2019-11-12 18:57:27 +0100
commita93535c32231d98ef8d080adac626f88b18f9db5 (patch)
tree85512472507364da15238bc30bf72128c83e94f6
parent4a2885ad3ae0396486d288df94339d0c45e6db8b (diff)
downloadboltzgen-a93535c32231d98ef8d080adac626f88b18f9db5.tar
boltzgen-a93535c32231d98ef8d080adac626f88b18f9db5.tar.gz
boltzgen-a93535c32231d98ef8d080adac626f88b18f9db5.tar.bz2
boltzgen-a93535c32231d98ef8d080adac626f88b18f9db5.tar.xz
boltzgen-a93535c32231d98ef8d080adac626f88b18f9db5.zip
Fix order of CSE and pow2 expansion
This way the expanded call to pow2 is resolved into a common subexpression.
-rw-r--r--boltzgen/utility/optimizations.py4
1 files 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
+]