Redundant code elimination. Performing operations on data that are known at the time of supercompilation. Removing intermediate data structures. Transforming multi-pass algorithms to one-pass algorithms.
http://sites.google.com/site/keldyshscp/Home/supercompilerco...
I can see this coming up when you, say, make library calls in certain ways that don't need the full functionality of the algorithms. Maybe one paramater is fixed, or the sequence of the calls is really to achieve something else.
The original paper is freely available off of citeseer, "The Concept of a Supercompiler": http://citeseer.ist.psu.edu/viewdoc/download;jsessionid=B373...
I'm currently reading through it. I find it useful to forget the term "supercompiler," since that implies to me a "meta-compiler," which I don't think is an accurate way of describing the technique. This could be incorporated into a regular compiler, you'd just want this as the first optimization phase. (I think.)
"Yet another optimizer phase" is what I'm readying here.
- automatically finding and applying optimizations
- with a general approach, rather than a big database of hard-coded optimizations.
I'm not sure how (or how well) it all works, though... but it's the sort of thing I find interesting, so here's hoping for some free time sooner or later. ;)
If it actually changes the code I have written, and then leaves it in that state for some reason 1> I want to know about that and 2> I want to know about if the trade offs of using it are worth it for the payments we make via reduced readability and malleability.
Isn't this known as partial application? For example, I have a function of five arguments, and I know three of them, partial application optimizes the function based on the three knowns while retaining full generality for the two unknowns.
I recently discovered distillation [1], which could transform quadratic and even more complex programs into linear ones (ie, perform non-linear complexity reduction).
So there's more in supercompilation that partial evaluation.
[1]: http://meta2010.pereslavl.ru/accepted-papers/paper-info-2.ht...
Geoff Hamilton lectured my classes in computability, parsing, automata and compilers. He certainly knows his stuff.