Optimal code motion in the presence of large expressions
Oliver Rüthing · 2002
Common algorithms for partial redundancy elimination that are sensitive to register pressure are designed from a single-expression point of view. For each computation under investigation unnecessary code motion is avoided as far as possible. Unfortunately, such a view is only adequate when dealing with a flat universe of expressions. In a more realistic setting where both composite expressions and their subexpressions are subjected to code motion trade-offs among the lifetimes of symbolic registers have to be taken into account. The author presents a polynomial time algorithm for the elimination of partially redundant computations that uniformly minimizes the total number of lifetime ranges at each program point. This is achieved by a refinement of the algorithm for lazy code motion that incorporates optimal register tradeoffs being computed by means of maximum bipartite graph matchings.