91 research outputs found
Finding Dominators via Disjoint Set Union
The problem of finding dominators in a directed graph has many important
applications, notably in global optimization of computer code. Although linear
and near-linear-time algorithms exist, they use sophisticated data structures.
We develop an algorithm for finding dominators that uses only a "static tree"
disjoint set data structure in addition to simple lists and maps. The algorithm
runs in near-linear or linear time, depending on the implementation of the
disjoint set data structure. We give several versions of the algorithm,
including one that computes loop nesting information (needed in many kinds of
global code optimization) and that can be made self-certifying, so that the
correctness of the computed dominators is very easy to verify
Formalizing the SSA-based Compiler for Verified Advanced Program Transformations
Compilers are not always correct due to the complexity of language semantics and transformation algorithms, the trade-offs between compilation speed and verifiability,etc.The bugs of compilers can undermine the source-level verification efforts (such as type systems, static analysis, and formal proofs) and produce target programs with different meaning from source programs. Researchers have used mechanized proof tools to implement verified compilers that are guaranteed to preserve program semantics and proved to be more robust than ad-hoc non-verified compilers.
The goal of the dissertation is to make a step towards verifying an industrial strength modern compiler--LLVM, which has a typed, SSA-based, and general-purpose intermediate representation, therefore allowing more advanced program transformations than existing approaches. The dissertation formally defines the sequential semantics of the LLVM intermediate representation with its type system, SSA properties, memory model, and operational semantics. To design and reason about program transformations in the LLVM IR, we provide tools for interacting with the LLVM infrastructure and metatheory for SSA properties, memory safety, dynamic semantics, and control-flow-graphs. Based on the tools and metatheory, the dissertation implements verified and extractable applications for LLVM that include an interpreter for the LLVM IR, a transformation for enforcing memory safety, translation validators for local optimizations, and verified SSA construction transformation.
This dissertation shows that formal models of SSA-based compiler intermediate representations can be used to verify low-level program transformations, thereby enabling the construction of high-assurance compiler passes
Dominators in Directed Graphs: A Survey of Recent Results, Applications, and Open Problems
The computation of dominators is a central tool in program optimization and code generation, and it has applications in other diverse areas includingconstraint programming, circuit testing, and biology. In this paper we survey recent results, applications, and open problems related to the notion of dominators in directed graphs,including dominator verification and certification, computing independent spanning trees, and connectivity and path-determination problems in directed graphs
Average case analysis of DJ graphs
AbstractSreedhar et al. [V.C. Sreedhar, G.R. Gao, Y.-F. Lee, A new framework for elimination-based data flow analysis using DJ graphs, ACM Trans. Program. Lang. Syst. 20 (2) (1998) 388–435; V.C. Sreedhar, Efficient program analysis using DJ graphs, PhD thesis, School of Computer Science, McGill University, Montréal, Québec, Canada, 1995] have presented an elimination-based algorithm to solve data flow problems. A thorough analysis of the algorithm shows that the worst-case performance is at least quadratic in the number of nodes of the underlying graph. In contrast, Sreedhar reports a linear time behavior based on some practical applications.In this paper we prove that for goto-free programs, the average case behavior is indeed linear. As a byproduct our result also applies to the average size of the so-called dominance frontier.A thorough average case analysis based on a graph grammar is performed by studying properties of the j-edges in DJ graphs. It appears that this is the first time that a graph grammar is used in order to analyze an algorithm. The average linear time of the algorithm is obtained by classic techniques in the analysis of algorithms and data structures such as singularity analysis of generating functions and transfer lemmas
Optimizing Service Orchestration in OutSystems
The growing demand for continuous development and deployment is causing many to
steer away from the traditional monolithic architectural style and opt instead for Service-
Oriented Architectures (SOAs). Adopting an architecture that is based on loosely-coupled
services leads to enhanced modularity and flexibility, further translated into a philosophy
of iterative, evolutionary development. The benefits of this development pattern
were also made available in the OutSystems low-code platform, with the introduction of
services as a new development building-block.
Moreover, the independence innate to the multiple services that comprise a SOA hints
at possible opportunities for task parallelism: as long as different remote calls to services
don’t interfere with each other, they could be performed in parallel. As an immediate
result, there could be speedups in multiple parts of an application’s layers. Idle time
waiting for data could be reduced, along with internal business logic that could be carried
out faster, factors that would positively impact the overall flow of any application.
In this thesis we propose the design and implementation of an optimization process
that targets the heart of the SOA: the orchestrator itself, the conductor of service interaction
that enables the different business processes involved in a software system. The
work produced comprises a set of data analysis and representation techniques that work
together with the goal of detecting and informing opportunities for safe parallelism in the
interaction and composition of the services that make up software factories. The formal
definition of the algorithm is accompanied with a prototype that targets the OutSystems
platform, with the achievement of considerable speedups in common scenarios. The
results obtained suggest the viability of such a mechanism in the world of SOAs
Waddle - Always-canonical Intermediate Representation
Program transformations that are able to rely on the presence of canonical properties of the program undergoing optimization can be written to be more robust and efficient than an equivalent but generalized transformation that also handles non-canonical programs. If a canonical property is required but broken earlier in an earlier transformation, it must be rebuilt (often from scratch). This additional work can be a dominating factor in compilation time when many transformations are applied over large programs. This dissertation introduces a methodology for constructing program transformations so that the program remains in an always-canonical form as the program is mutated, making only local changes to restore broken properties
SSI Revisited
The static single information (SSI) form, proposed by Ananian, then in a more general form by Singer, is an extension of the static single assignment (SSA) form. The latter is a well-established compiler intermediate representation that has been successfully used for numerous compiler analysis and optimizations. Several interesting results have also been shown for SSI concerning liveness analysis and representation of live-ranges of variables, which could make SSI appealing for just-in-time compilation. Unfortunately, previous literature on the SSI form is sparse and appears to be partly incorrect. Our paper corrects some of the mistakes that have been made. Our main result is a complete proof that, even for the most general definition of SSI, basic blocks, and thus program points, can be totally ordered so that live-ranges of variables correspond to intervals. This corrects the erroneous proof of Brisk and Sarrafzadeh
- …