An implementation-oriented algorithm for
lazy code motion
is presented that minimizes the number of computations in programs while suppressing any unnecessary code motion in order to avoid superfluous register pressure. In particular, this variant of the original algorithm for lazy code motion works on flowgraphs whose nodes are basic blocks rather than single statements, since this format is standard in optimizing compilers. The theoretical foundations of the modified algorithm are given in the first part, where
t
-refined flowgraphs are introduced for simplifying the treatment of flow graphs whose nodes are basic blocks. The second part presents the “basic block” algorithm in standard notation and gives directions for its implementation in standard compiler environments.
Data flow analysis algorithms for imperative programming languages can be split into two groups: first, into the semantic algorithms that determine semantic equivalence between terms, and second, into the syntactic algorithms that compute complex program properties based on syntactic term identity, which support powerful optimization techniques like for example partial redundancy elimination. Value Flow Graphs represent semantic equivalence of terms syntactically. This allows us to feed the knowledge of semantic equivalence into syntactic algorithms. The power of this technique, which leads to modularly extendable algorithms, is demonstrated by developing a two stage algorithm for the optimal placement of computations within a program wrt the Herbrand interpretation.
We present a bit-vector algorithm for the optimal and economical placement of computations within flow graphs, which is as eficient as standard uni-directional analyses. The point of our algorithm is the decomposition of the hi-directional structure of the known placement algorithms into a sequence of a backward and a forward analysis, which directly implies the etllciency result. Moreover, the new compositional structure opens the algorithm for modification: two further uni-directional analysis components exclude any unnecessary code motion. This laziness of our algorithm minimizes the register pressure, which has drastic effects on the run-time behaviour of the optimized programs in practice, where an economical use of registers is essential.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.