Open havogt opened 4 years ago
Pythran pass manager shows a simple way to do something like this. It caches the results of the analysis passes (which I think corresponds to what Dawn calls "derived information") and invalidates them automatically if a transformation pass modifies the tree:
https://pythran.readthedocs.io/en/latest/TUTORIAL.html#pythran-pass-manager https://github.com/serge-sans-paille/pythran/blob/master/pythran/passmanager.py
Just as a reminder to discuss it at some point...
Dawn has the concept of derived information which is some extra information computed from the IR and re-used by several transformations. (Things that are expensive to recompute.) Would be interesting to discuss if we could implement such a thing with automatic invalidation.
One example could be dependency graphs. You would give_me_dependency(some_expression) and it will retrieve it from cache or compute it and store in cache.
This would be only a compiler performance optimization which we shouldn't do now.