public class IdentityRemover implements Optimizer {
@Override
public boolean optimize(DeferredGraph graph, DeferredNode node) {
if(node.isComputation()) {
DeferredNode replacementValue = trySimplify(node);
if(replacementValue != null) {
graph.replaceNode(node, replacementValue);
return true;
}
}