23 research outputs found

    Bidirectional Data Flow Analysis in Code Motion: Myth and Reality

    No full text
    . Bidirectional data flow analysis has become the standard technique for solving bit-vector based code motion problems in the presence of critical edges. Unfortunately, bidirectional analyses have turned out to be conceptually and computationally harder than their unidirectional counterparts. In this paper we show that code motion in the presence of critical edges can be achieved without bidirectional data flow analyses. This is demonstrated by means of an adaption of our algorithm for lazy code motion [15], which is developed from a fresh, specification oriented view. Besides revealing a better conceptual understanding of the phenomena caused by critical edges, this also settles the foundation for a new and e#cient hybrid iteration strategy that intermixes conventional round-robin iteration with the exhaustive iteration on critical subparts. 1 Motivation In data flow analysis equation systems involving bidirectional dependencies, i. e. dependencies from predecessor nodes as well as fr..

    Optimal Code Motion in the Presence of Large Expressions

    No full text
    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. In this paper we present 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 our algorithm for lazy code motion [12] that incorporates optimal register tradeoffs being computed by means of maximum bipartite graph matchings. 1 Motivation Partial redundancy elimination (PRE) is a technique that avoids unnecessar..

    Constant Propagation on Predicated Code

    No full text
    We present a new constant propagation (CP) algorithm for predicated code, for which classical CP-techniques are inadequate. The new algorithm works for arbitrary control flow, detects constancy of terms, whose operands are not constant themselves, and is optimal for acyclic code such as hyperblocks, the central "compilation units" for instruction scheduling of predicated code. The new algorithm operates on the predicated value graph, an extension of the well-known value graph of Alpern et al. [Alpern et al., 1988], which is tailored for predicated code and constructed on top of the predicate-sensitive SSA-form, which has been introduced by Carter et al. [Carter et al., 1999]. As an additional benefit, the new algorithm identifies off-predicated instructions in predicated code. They can simply be eliminated thereby further increasing the performance and simplifying later compilation phases such as instruction scheduling

    The Value Flow Graph: A Program Representation for Optimal Program Transformations

    No full text
    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. 1 Introduction There are two kinds of data flow analysis algorithms for imperative programming languages. First, the semantic algorithms that determine semantic equivalence between terms, e.g. the classical algorithm of ..

    Optimal Code Motion: Theory and Practice

    No full text
    this paper, we emphasize the practicality of lazy code motion by giving explicit directions for its implementation in standard compiler environments. In particular, we present a version of the algorithm here which works on flowgraphs whose nodes are basic blocks rather than single statements, as this format is standard in optimizing compilers. Our presentation is split into two parts which can be read and understood independently

    Lazy Code Motion

    No full text
    We present a bit-vector algorithm for the optimal and economical placement of computations within flow graphs, which is as efficient as standard uni-directional analyses. The point of our algorithm is the decomposition of the bi-directional structure of the known placement algorithms into a sequence of a backward and a forward analysis, which directly implies the efficiency 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

    Code Motion and Code Placement: Just Synonyms?

    No full text
    We prove that there is no difference between code motion (CM ) and code placement (CP) in the traditional syntactic setting, however, a dramatic difference in the semantic setting. We demonstrate this by re-investigating semantic CM under the perspective of the recent development of syntactic CM. Besides clarifying and highlightening the analogies and essential differences between the syntactic and the semantic approach, this leads as a side-effect to a drastical reduction of the conceptual complexity of the value-flow based procedure for semantic CM of [27], as the original bidirectional analysis is decomposed into purely unidirectional components. On the theoretical side, this establishes a natural semantical understanding in terms of the Herbrand interpretation (transparent equivalence), and thus eases the proof of correctness; moreover, it shows the frontier of semantic CM, and gives reason for the lack of algorithms going beyond. On the practical side, it simplifies the implemen..

    Partial Dead Code Elimination

    No full text
    A new aggressive algorithm for the elimination of partially dead code is presented, i.e., of code which is only dead on some program paths. Besides being more powerful than the usual approaches to dead code elimination, this algorithm is optimal in the following sense: partially dead code remaining in the resulting program cannot be eliminated without changing the branching structure or the semantics of the program, or without impairing some program executions. Our approach is based on techniques for partial redundancy elimination. Besides some new technical problems there is a significant difference here: partial dead code elimination introduces second order effects, which we overcome by means of exhaustive motion and elimination steps. The optimality and the uniqueness of the program obtained is proved by means of a new technique which is universally applicable and particularly useful in the case of mutually interdependent program optimizations. Topics: data flow analysis, program o..

    Efficient Code Motion and an Adaption to Strength Reduction

    No full text
    this paper we consider two elaborations of this algorithm, which are dealt with in Part I and Part II, respectively. Part I deals with the problem that the full variant of the algorithm of [SKR1] may excessively introduce trivial redefinitions of registers in order to cover a single computation. Rosen, Wegman and Zadeck avoided such a too excessive introduction of trivial redefinitions by means of some practically oriented restrictions, and they proposed an efficient algorithm, which optimally moves the computations of acyclic flow graphs under these additional constraints (the algorithm is "RWZoptimal " for acyclic flow graphs) [RWZ]. Here we adapt our algorithm to this notion of optimality. The result is a modular and efficient algorithm, which avoids a too excessive introduction of trivial redefinitions along the lines of [RWZ], and is RWZ-optimal for arbitrary flow graphs. Part II modularly extends the algorithm of [SKR1] in order to additionally cover strength reduction. This extension generalizes and improves all classical techniques for strength reduction in that it overcomes their structural restrictions concerning admissible program structures (e.g. previously determined loops) and admissible term structures (e.g. terms built of induction variables and region constants). Additionally, the program transformation obtained by our algorithm is guaranteed to be safe and to improve run-time efficiency. Both properties are not guaranteed by previous techniques. Structure of the Pape
    corecore