2001
There’s more to performance than asymptotic complexity Constant factors matter too! • easily see 10:1 performance range depending on how code is written • must optimize at multiple levels: – algorithm, data representations, procedures, and loops Must understand system to optimize performance • how programs are compiled and executed • how to measure program performance and identify bottlenecks • how to improve performance without destroying code modularity and generality class10.ppt class10.ppt
Cited by 0
Pointer Code · 2000
There’s more to performance than asymptotic complexity Constant factors matter too! • easily see 10:1 performance range depending on how code is written • must optimize at multiple levels: – algorithm, data representations, procedures, and loops Must understand system to optimize performance • how programs are compiled and executed • how to measure program performance and identify bottlenecks • how to improve performance without destroying code modularity and generality class11.ppt class11.ppt – 2 –
Cited by 0
Tevaearai, Zacharie · Infoscience (Ecole Polytechnique Fédérale de Lausanne) · 2025
Modern regular expressions are powerful string-processing tools, available in most programming languages. However, their power comes at a cost. Most regex engines exhibit worst-case exponential time complexity with respect to the input size, because they rely on a backtracking matching algorithm. This can result in severe performance issues, and can be a vulnerability when the input string or the regex is controlled by the user, leading to so-called Regular Expression Denial of Service (ReDoS) attacks. Fortunately, a large subset of modern regex features can be matched in linear time using alternative algorithms. However they come with various tradeoffs; for instance matching using a deterministic automata is very fast, but suffer from exponential pre-processing time, while using a PikeVM gives use linear compilation and execution time complexity but often performs poorly in practice. We focus on that second algorithm, the PikeVM, and propose a native-compilation approach to accelerate its execution. We present two implementations: one as a standalone library and another integrated into V8, the JavaScript engine that powers Chromium. Our approach achieves a 3.6× speedup on average compared to other implementations based on an interpreter.
Cited by 0Open access
Gilles Barthe, Benjamin Grégoire, César Kunz et al. · Lecture notes in computer science · 2006
Cited by 18
Matthieu Stéphane Benoit Queva · 2007
The “quality” of code generated by compilers largely depends on the analyses and optimizations applied to the code during the compilation process. While modern compilers could choose from a plethora of optimizations and analyses, in current compilers the order of these pairs of analyses/transformations is fixed once and for all by the compiler developer. Of course there exist some flags that allow a marginal control of what is executed and how, but the most important source of information regarding what analyses/optimizations to run is ignoredthe source code. Indeed, some optimizations might be better to be applied on some source code, while others would be preferable on another. A new compilation model is developed in this thesis by implementing a Phase Manager. This Phase Manager has a set of analyses/transformations available, and can rank the different possible optimizations according to the current state of the intermediate representation. Based on this ranking, the Phase Manager can decide which phase should be run next. Such a Phase Manager has been implemented for a compiler for a simple imperative language, the while language, which includes several Data-Flow analyses. The new approach consists in calculating coefficients, called metrics, after each optimization phase. These metrics are used to evaluate where the transformations will be applicable, and are used by the Phase Manager to rank the phases. The metrics are calculated using a new algorithm that approximates the dataflow analyses for the while language. This algorithm skims through the intermediate representation of the program only once, and thus solves the analyses’ equations faster than classical worklist algorithms. In order to evaluate the metric-based approach, a benchmark suite is created. This suite generates a large amount of regular expressions that express various orders of optimizations. The metric-based phase-ordering is applied on several benchmark programs and compared to the best regular expression on each of these programs. Finally, this thesis considers the interactions between the transformations considered, as well as the effects of these transformations on the size and speed of the program to improve the metric-based algorithm. The resulting versions of the phase-ordering mechanism are then evaluated using the benchmark suite.
Cited by 4
W. P. Doddin · Software Practice and Experience · 1978
Cited by 1
Bruce W. Leverett · Medical Entomology and Zoology · 1983
The subject of this treatise is code optimization in compilers. I discuss both general strategies of optimizing compiler design and specific techniques for achieving individual optimizations. I am only secondarily interested in introducing new optimizations and algorithms; my goal is to integrate a comprehensive set of optimizations into a retargetable compiler. I introduce new formalizations of techniques that are, in many cases, already known.
A compiler is retargetable if it can easily be adapted to changes in the machine for which it generates code. These include changing to a completely different machine (different instruction set). In the broadest sense they also include changes to the run-time conventions. Historically, it has proven to be difficult to achieve both retargetability and a high degree of code optimization with a single compiler design. I describe the design and implementation of part of a compiler that achieves both of those goals.
I focus on a set of techniques somewhat loosely known as register allocation. This is the process of mapping data items in the source program onto storage locations in the target machine. Data items include variables, results of expression evaluations, results of hidden (implicit) computations, and frequently-used constants. Storage locations include accumulators, index registers, base registers, and (not least) memory locations.
Cited by 29
Dirk Grunwald, Tipp Moseley · 2009
Compilers employ many aggressive code transformations to achieve highly optimized code. However, because of complex target architectures and unpredictable optimization interactions, these transformations may not always be beneficial. Advances in hardware ensure that instruction set architectures are undergoing continual evolution. As a result, compilers are under constant pressure to adapt and take full advantage of available features.
Current techniques for evaluating code generation only compare profiles at the application level, but a fundamental step in tuning compiler performance is identifying the specific examples that can be improved. Quantitative function- and loop-level comparisons were previously not possible because techniques did not exist to compare them coherently after optimizations have been applied. To ensure the best performance is achieved, a more rigorous approach is necessary.
This work presents two toolchain-independent techniques to better measure and understand relative profile differences across binary programs (produced from the same source) compiled with different compilers, optimizations, or target architectures. OptiScope uses aggregate profile counts to match analogous code regions in different binaries. OptiScope has low overhead, but it only works on programs with identical inter-procedural optimizations applied. For programs with arbitrary transformations applied, including inter-procedural optimization, the Chainsaw tool uses more heavyweight analysis on execution logs to match semantically identical intervals of execution. To support each of these applications, I present novel techniques for low-overhead profile collection and seekable event log compression. Both binary matching approaches generate thousands of comparable regions from only a small set of benchmarks, and hundreds of key performance metrics for each region are loaded into a relational database to enable rapid querying for outliers. Case studies show the tools are proficient in identifying performance differences from 32.5% to 893% on select regions of SPEC 2006 benchmarks.
Cited by 0
Jennifer Elizabeth Shaw · eScholarship@McGill (McGill) · 2005
Optimizing compilers have traditionally had little support for visual tools which display the vast amount of information generated and which could aid in the development of analyses and teaching and provide extra information to general programmers. This thesis presents a set of visualization tools which integrate visualization support for Soot, an optimizing compiler framework, into Eclipse, a popular, extensible IDE. In particular, this work explores making the research compiler framework more accessible to new users and general programmers. Tools for displaying data flow analysis results in intermediate representations (IRs) and in the original source code are discussed, with consideration for the issue of the mapping of information between the low-level IRs and the source using flexible and extensible mechanisms. Also described are tools for interactive control flow graphs which can be used for research and teaching and tools for displaying large graphs, such as call graphs, in a manageable way. Additionally, the area of communicating information generated by optimizing compilers to general programmers is explored with a small case study to determine if analyses could be useful to general programmers and how the information is displayed. This work is shown to be useful for research to find imprecision or errors in analyses, both from visualizing the intermediate results with the interactive control flow graphs and the final results at the IR and source code levels, and for students learning about compiler optimizations and writing their first data flow analyses. i iiRésumé Les optimiseurs ont traditionnellement eu peu de support pour des outils visuels qui présentent la vaste quantité d’informations produites et qui pourraient faciliter le développement d’analyses et de l’enseignement et fournir des renseignements supplémentaires aux programmeurs généralistes. Cette thèse présente un ensemble d’outils de visualisation qui intègrent le soutien de visualisation de Soot, un cadre d’optimiseur, dans Eclipse, un environnement de développement intégré (Integrated
Cited by 2Open access
Gregory J. Chaitin, Marc A. Auslander, Ashok K. Chandra et al. · 1980
Abstract--Register allocation may be viewed as a graph coloring problem. Each node in the graph stands for a computed quantity that resides in a machine register, and two nodes are connected by an edge if the quantities interfere with each other, that is, if they are simultaneously live at some point in the object program. This approach, though mentioned in the literature, was never implemented before. Preliminary results of an experimental implementation i a PL/I optimizing compiler suggest hat global register allocation approaching that of hand-coded assembly language may be attainable.
Cited by 0
Samuel P. Harbison · 1982
Programming languages are designed to make programming productive. Computer architectures are designed to make program execution efficient. Although architectures should be designed with programming languages in mind, it may be as inappropriate to make the computer execute the programming language directly it is to make the programmer use machine language. It is the compiler's job to match the programming language and the computer architectures, and therefore making compiler's efficient and easy to write are important design goals of a complete hardware/software system. This paper summerizes research completed in 1980 [5] on a computer architecture, TM, that takes over some of the more burdensome tasks of optimizing compilers for high-level-languages (HLL's), performing these tasks dynamically during the execution of the object program. This is a different approach to making compilers efficient than is commonly taken; more common approaches include devising more efficient optimization algorithms[I], being clever about when to do optimizations [4], and building the compilers semiautomatically [6].
Cited by 40
Samuel P. Harbison · ACM SIGPLAN Notices · 1982
Programming languages are designed to make programming productive. Computer architectures are designed to make program execution efficient. Although architectures should be designed with programming languages in mind, it may be as inappropriate to make the computer execute the programming language directly it is to make the programmer use machine language. It is the compiler's job to match the programming language and the computer architectures, and therefore making compiler's efficient and easy to write are important design goals of a complete hardware/software system. This paper summerizes research completed in 1980 [5] on a computer architecture, TM , that takes over some of the more burdensome tasks of optimizing compilers for high-level-languages (HLL's), performing these tasks dynamically during the execution of the object program. This is a different approach to making compilers efficient than is commonly taken; more common approaches include devising more efficient optimization algorithms[I], being clever about when to do optimizations [4], and building the compilers semiautomatically [6].
Cited by 2Open access
Marc Michael Brandis · ETH Zürich Research Collection · 1995
Cited by 16Open access
Youfeng Wu · 2003
Modern processors rely heavily on optimizing compilers to deliver their performance potentials. The compilers, in turn, rely greatly on profile information to focus the optimization efforts and better match the generated code with the target machines. Maintaining the profile in an optimizing compiler is important as many optimizations can benefit from profile information and they are often performed one after the other. Maintaining a profile is, however, tedious and error prone. An erroneous profile is not easy to detect as it affects only the performance, not the correctness, of a program. Maintaining a profile also inherently loses accuracy, as the profile update operations often have to use probabilistic approximation. In this paper, we measure the accuracy of maintaining CFG profiles in a high-performance optimizing compiler. Our data indicates that the compiler maintains the profile more accurately within individual functions than globally across functions, and function inlining may be responsible for the loss of profile accuracy globally. We also identify a number of research issues related to profile maintenance.
Cited by 5
D. P. Gregor, B. Osman, D. R. Musser · 2002
This paper discusses concept lattices and some of their applications in component library development and compiler optimizations. Ongoing work on concept-based userextensible simplification (type-based optimizer generators) and library transformations is first reviewed, then a new application—categorization of algorithms via precise descriptions of their performance characteristics—is outlined, with Standard Template Library and Boost Graph Library algorithm concept lattices as examples. 1
Cited by 0
Jacqueline M. Caron, Peter A. Darnell · ACM SIGPLAN Notices · 1990
This paper describes a tool for isolating modules that are compiled incorrectly when optimization is invoked. This tool benefits application developers by automatically compiling each module to its highest level of correct optimization. It benefits compiler writers by pinpointing failing modules.
Cited by 20Open access
Clark Barrett, Yi Fang, Benjamin Goldberg et al. · Lecture notes in computer science · 2005
Cited by 72Open access
Aldo Dall’Osso · Science of Computer Programming · 2005
Cited by 7
Hagyoul Bae, Rudolf Eigenmann · 2008
Abstract. We have designed and implemented an interprocedural algorithm to analyze symbolic value ranges that can be assumed by variables at any given point in a program. Our algorithm contrasts with related work on interprocedural value range analysis in that it extends the ability to handle symbolic range expressions. It builds on our previous work of intraprocedural symbolic range analysis. We have evaluated our algorithm using 11 Perfect Benchmarks and 10 SPEC floating-point benchmarks of the CPU 95 and CPU 2000 suites. We have measured the ability to perform test elision, dead code elimination, and detect data dependences. We have also evaluated the algorithm’s ability to help detect zero-trip loops for induction variable substitution and subscript ranges for array reductions. 1
Cited by 0
David Bernstein, Martin C. Golumbic, Yishay Mansour et al. · 1989
Global register allocation and spilling is commonly performed by solving a graph coloring problem. In this paper we present a new coherent set of heuristic methods for reducing the amount of spill code gen-erated. This results in more efficient (and shorter) compiled code. Our approach has been compared to both standard and priority-based coloring algo-rithms, universally outperforming them. In our approach, we extend the capability of the existing algorithms in several ways. First, we use multiple heuristic functions to increase the likeli-hood that less spill code will be inserted. We have found three complementary heuristic functions which together appear to span a large proportion of good spill decisions. Second, we use a specially tuned greedy heuristic for determining the order of deleting (and hence coloring) the unconstrained vertices. Third, we have developed a “cleaning” technique which avoids some of the insertion of spill code in non-busy regions. kurrently with the IBM T.J. Watson Research Center
Cited by 0