I wonder how far we can take this sort of effort -- collect exact usage statistics for users and optimize software exactly for known usage patterns. Of course some statistical technique would be needed to deal with the long tail of usage patterns -- surely some program branches are used extremely rarely (or not even seen in collected samples), but you still wouldn't want them to be extremely slow (slower than necessary) or crash just because they're rarely used. The cumulative usage of many of those long tail events can be large.
Either (regularized) statistical inference of branches or something like assuming a baseline usage for every branch would be necessary.
This is all significantly complex of course, so for anything that are not the consumer megaprojects of software (browsers and operating systems?), I wonder if those tools could be used as well. Perhaps there could be some automated, anonymized usage reporting that does all this work?