They can also define term-rewriting templates to catch that:
    
    
    template simplifyExpLn{ln(exp(x))}(x: untyped): untyped = x
    
    
    Run

And now this simplifies `ln(exp(x))` but this is limited to direct calls, if 
the ln or exp are hidden in other functions this won't work.

Ergo, you might need a extension system for your `passes` so that people can 
add new simplification passes.

You might want to look into some example simplification passes used in DaCe (a 
compiler for linear algebra): 
[https://github.com/spcl/dace/tree/de7deaee/dace/transformation/dataflow](https://github.com/spcl/dace/tree/de7deaee/dace/transformation/dataflow)

Reply via email to