Commit e86031e1 authored by Sapphie's avatar Sapphie
Browse files

Fix/Implement CSE

parent ded6fc57
......@@ -115,8 +115,7 @@ abstract class CPSOptimizer[T <: CPSTreeModule { type Name = Symbol }]
val allLitOpt = replacedArgs.map(_.asLiteral)
val isAllLit = allLitOpt.forall(_.isDefined)
lazy val asLit = allLitOpt.map(_.get)
// TODO: fix this. For some reason it doesn't work
if (false && s.eInvEnv.isDefinedAt((prim, replacedArgs))) {
if (!unstable(prim) && !impure(prim) && s.eInvEnv.isDefinedAt((prim, replacedArgs))) {
val preComputedAtom = s.eInvEnv((prim, replacedArgs))
shrink(body, newState.withASubst(name, preComputedAtom))
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment