A composite algorithm for strength reduction and code movement optimization

In the presence of information regarding the execution frequencies of various control paths in a program, use of the tradeoff between code space and execution efficiency has been shown to aid in “selective replication” and optimal placement of code over a program region. This paper extends the scope of the code replication and placement strategies to optimization by reduction of operator strength. The resulting composite strength reduction-cum-code placement approach is shown to eliminate the latent suboptimalities of conventional strength reduction. The approach subsumes the conventional transformations of (1) common subexpression elimination, and (2) movement of loop invariant code, and is easily amenable to the use of efficient solution procedures.