That is the theory behind "flex fuel" vehicles. In practice, the optimizations don't materialize in real world usage. This is likely because of safety factors built into the ECM preventing the engine from running enough timing advance to take advantage of the octane of a blended fuel.