Commit 9c120d52 authored by Sapphie's avatar Sapphie
Browse files

Implement identity replacement

parent 3ad69e52
......@@ -140,7 +140,14 @@ abstract class CPSOptimizer[T <: CPSTreeModule { type Name = Symbol }]
// Right Absorbing
case Seq(a1, AtomL(l2)) if rightAbsorbing((prim, l2)) =>
shrink(body, s.withASubst(name, l2))
case _ => noOp
case _ => {
// If the primitive is id
if (prim == identity) {
shrink(body, s.withASubst(name, s.aSubst(replacedArgs(0))))
} else {
noOp
}
}
}
}
}
......
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