This basically allows an aggregate's state to be shared between other aggregate functions when both aggregate's transition functions (and a few other things) match
There's quite a number of aggregates in our standard set which will benefit from this optimisation.
After compiling the original patch with another compiler, I noticed a couple of warnings.