Edward K. Ream wrote:
I don't think CPU caches have much bearing on this discussion. Caches speed up frequently used values. The problems here are not the same.
I think what you mean here is frequently used code/data as CPU caches are address based, not value based; locality of reference.
2. I have looked again at the code generators of the optimizing C compiler I wrote about 10 years ago. I can find no instance where knowing the value of an operand, rather than just its type, would produce better code.
Zero. Many redundant instructions can be eliminated on a wide variety of architectures due to the way the value zero is handled by the CPU; results of the previous instruction may set condition codes, instructions that test for zero, ... Knowlege of values can better construct jump tables for switches.