For (1), Knuth (1971) shows empirically that simple assignment statements with one operation and one to three variables are themost often used statements:
A := B A := A OP 1 A := A OP k A := B OP k A := B OP CHere, A, B, and, C are variables and k is a constant. Follow-up studies have continued to comfirm this. It does little good to optimize for things programmers rarely write.
For (2), code in loops tends to be executed the most; thus optimizations concentrate onloops.
Send questions and comments to: Karen Lemone