Skip to content
Free planNo credit card requiredStart writing

Search 250 million research papers

Read the abstract, see who wrote it and who cites it, and get the citation in APA, MLA, Chicago or Harvard.

About 4,333 papers for “compiler optimization”

Boosting Compiler Testing via Compiler Optimization Exploration

Junjie Chen, Chenyao Suo · ACM Transactions on Software Engineering and Methodology · 2022

Compilers are a kind of important software, and similar to the quality assurance of other software, compiler testing is one of the most widely-used ways of guaranteeing their quality. Compiler bugs tend to occur in compiler optimizations. Detecting optimization bugs needs to consider two main factors: (1) the optimization flags controlling the accessability of the compiler buggy code should be turned on; and (2) the test program should be able to trigger the buggy code. However, existing compiler testing approaches only consider the latter to generate effective test programs, but just run them under several pre-defined optimization levels (e.g., -O0 , -O1 , -O2 , -O3 , -Os in GCC). To better understand the influence of compiler optimizations on compiler testing, we conduct the first empirical study, and find that (1) all the bugs detected under the widely-used optimization levels are also detected under the explored optimization settings (we call a combination of optimization flags turned on for compilation an optimization setting ), while 83.54% of bugs are only detected under the latter; (2) there exist both inhibition effect and promotion effect among optimization flags for compiler testing, indicating the necessity and challenges of considering the factor of compiler optimizations in compiler testing. We then propose the first approach, called COTest , by considering both factors to test compilers. Specifically, COTest first adopts machine-learning (the XGBoost algorithm) to model the relationship between test programs and optimization settings, to predict the bug-triggering probability of a test program under an optimization setting. Then, it designs a diversity augmentation strategy to select a set of diverse candidate optimization settings for prediction for a test program. Finally, Top-K optimization settings are selected for compiler testing according to the predicted bug-triggering probabilities. Then, it designs a diversity augmentation strategy to select a set of diverse candidate optimization settings for prediction for a test program. Finally, Top-K optimization settings are selected for compiler testing according to the predicted bug-triggering probabilities. The experiments on GCC and LLVM demonstrate its effectiveness, especially COTest detects 17 previously unknown bugs, 11 of which have been fixed or confirmed by developers.

Cited by 26

Towards intelligent compiler optimization

Mihael Kovač, Mario Brčić, Agneza Krajna et al. · 2022 45th Jubilee International Convention on Information, Communication and Electronic Technology (MIPRO) · 2022

The future of computation is massively parallel and heterogeneous with specialized accelerator devices and instruction sets in both edge- and cluster-computing. However, software development is bound to become the bottleneck. To extract the potential of hardware wonders, the software would have to solve the following problems: heterogeneous device mapping, capability discovery, parallelization, adaptation to new ISAs, and many others. This systematic complexity will be impossible to manually tame for human developers. These problems need to be offloaded to intelligent compilers. In this paper, we present the current research that utilizes deep learning, polyhedral optimization, reinforcement learning, etc. We envision the future of compilers as consisting of empirical testing, automatic statistics collection, continual learning, device capability discovery, multiphase compiling – precompiling and JIT tuning, and classification of workloads. We devise a simple classification experiment to demonstrate the power of simple graph neural networks (GNNs) paired with program graphs. The test performance demonstrates the effectiveness and representational appropriateness of GNNs for compiler optimizations in heterogeneous systems. The benefits of intelligent compilers are time savings for the economy, energy savings for the environment, and greater democratization of software development.

Cited by 7

Parity Quantum Optimization: Compiler

Kilian Ender, Roeland ter Hoeven, Benjamin E. Niehoff et al. · arXiv (Cornell University) · 2021

We introduce parity quantum optimization with the aim of solving optimization problems consisting of arbitrary $k$-body interactions and side conditions using planar quantum chip architectures. The method introduces a decomposition of the problem graph with arbitrary $k$-body terms using generalized closed cycles of a hypergraph. Side conditions of the optimization problem in form of hard constraints can be included as open cycles containing the terms involved in the side conditions. The generalized parity mapping thus circumvents the need to translate optimization problems to a quadratic unconstrained binary optimization problem (QUBO) and allows for the direct encoding of higher-order constrained binary optimization problems (HCBO) on a square lattice and full parallelizability of gates.

Cited by 4Open access

Parity Quantum Optimization: Compiler

Kilian Ender, Roeland ter Hoeven, Benjamin E. Niehoff et al. · Quantum · 2023

We introduce parity quantum optimization with the aim of solving optimization problems consisting of arbitrary <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mi>k</mml:mi></mml:math>-body interactions and side conditions using planar quantum chip architectures. The method introduces a decomposition of the problem graph with arbitrary <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mi>k</mml:mi></mml:math>-body terms using generalized closed cycles of a hypergraph. Side conditions of the optimization problem in form of hard constraints can be included as open cycles containing the terms involved in the side conditions. The generalized parity mapping thus circumvents the need to translate optimization problems to a quadratic unconstrained binary optimization problem (QUBO) and allows for the direct encoding of higher-order constrained binary optimization problems (HCBO) on a square lattice and full parallelizability of gates.

Cited by 27Open access

Python Binary Optimization Compiler

Izosimov, Pavel · Zenodo (CERN European Organization for Nuclear Research) · 2024

Python Binary Optimization Compiler Version: 1.3© 2024 αβ.net (alphabetanet.com) - Alpha Beta Network. All Rights Reserved.Note: This project is currently in Beta Testing and available for free. Introduction The Python Binary Optimization Compiler is a powerful command-line tool designed to provide performance optimization and code protection for Python scripts. By compiling Python code into native machine code executables, it offers significant speed improvements and enhanced security. This tool is ideal for developers looking to optimize Python code, protect their intellectual property, and adhere to code security best practices. Key Features Performance Optimization: Achieve up to 60-100% improvement in execution speed over standard Python interpretation, as demonstrated by benchmarks using the Python Performance Benchmark Tool. Native Compilation: Convert Python scripts into native binaries, eliminating the need for the Python interpreter during execution. Code Obfuscation and Protection: Implement multi-layer protection techniques, including code obfuscation in Python, encryption, and anti-debugging measures to protect Python code from reverse engineering. Cross-Platform Compatibility: Supports Windows, macOS, Linux/Unix, and other operating systems with Python 3.6+ installed. No Source Code Modification Required: Works without requiring any changes to your existing Python scripts. Main Functions Compiling Python Scripts to Native Binaries The tool uses Cython to compile Python scripts into native machine code executables, significantly improving performance by eliminating the overhead of bytecode interpretation. This process helps optimize Python code for better execution speed. Code Obfuscation and Protection After compilation, the tool applies multiple layers of protection to the binaries, including: Variable and Function Name Obfuscation: Complicates code analysis by renaming variables and functions to obscure names. String Encryption: Prevents easy extraction of sensitive information by encrypting strings within the code. Control Flow Obfuscation: Makes the code's control flow more complex and less predictable. Dynamic Key Validation: Requires a specific key to execute the code, adding an extra layer of security. Anti-Debugging Measures: Incorporates checks to detect and prevent debugging or tampering attempts. Runtime Integrity Checks: Validates code integrity at runtime to detect unauthorized modifications. Additional Features Performance Optimization By compiling to native binaries, the tool achieves significant performance improvements: Native Machine Code Execution: Executes code directly as machine instructions, eliminating the overhead of the Python interpreter. Platform-Specific Optimizations: Utilizes compiler-specific flags and optimizations tailored to the target architecture. Advanced Compilation Techniques: Applies optimization techniques such as dead code elimination, function inlining, and loop unrolling. Cross-Platform Compatibility The tool supports: Operating Systems: Windows, macOS, Linux/Unix. Python Versions: Compatible with Python 3.6 and above. Compiler Support: Automatically detects available compilers or allows specification of the compiler. Usage Examples Basic Compilation of a Script Compile a Python script without specifying a compiler (automatic detection).Command bash python python_binary_optimization_compiler.py my_script.py Output The optimized and protected binary will be saved in the Native_Protected directory as a compiled file. Specifying a Compiler Specify the compiler to use for compilation.Command bash python python_binary_optimization_compiler.py my_script.py --compiler mingw64 Notes Options for --compiler are mingw32, mingw64, or msvc. Installation Before using the Python Binary Optimization Compiler, ensure that you have Python 3.6+ installed on your system. Installing Required Packages Install the necessary Python packages: bash pip install requests psutil cryptography setuptools Cython astor Ensure you are using the correct version of pip associated with your Python 3 installation. If you are using a virtual environment, activate it before installing the packages.Compiler RequirementsYou need to have one of the following compilers installed: mingw32 or mingw64 (for Windows) gcc (for Linux/Unix) msvc (Microsoft Visual C++ Compiler for Windows) Recommendations and Best Practices Use Appropriate Compiler: Ensure that the specified compiler is installed and properly configured. Optimize Your Code: Applying optimization techniques in your Python code can further enhance performance when compiled. Use Clean Source Code: For successful compilation and computation optimization, use the original .py source code without prior obfuscation or encryption. Test Compiled Binaries: Thoroughly test the compiled binaries to ensure they function as expected. Combine with Other Protection Tools: For maximum code security, consider combining this tool with other Alpha Beta Network solutions like the Python Obfuscator Online and the Secure Python Code Manager. Stay Updated: Keep your compiler and Python environment up to date to benefit from the latest optimizations and security features. Alternative Solutions The Alpha Beta Network offers other tools for code protection and optimization: Python Obfuscator Online: An online tool for cloud-based Python code obfuscation and secure usage via the Alpha Beta Network cloud platform. Ideal for developers looking to implement advanced code obfuscation in Python. Secure Python Code Manager: A command-line tool for securely sharing and protecting Python code using the Alpha Beta Network cloud platform, offering solutions for secure code sharing and source code protection. Local Python Code Protector: Provides advanced encryption and obfuscation techniques for Python code, allowing secure code distribution without requiring an internet connection. Multi-Version PYZ Builder: Creates a Universal Python Module optimized for cross-platform and multi-version compatibility, aiding in building standalone Python applications. System Hardware ID Generator: Generates a unique Hardware ID (HWID) for devices, useful in software licensing and device authentication. Python Performance Benchmark Tool: Benchmarks the performance of various computations in pure Python, helping developers analyze and improve Python performance. Python App Bundle Shield: Helps developers create standalone protected applications and executable files from Python scripts. Comparative Performance Benchmarks The following benchmarks demonstrate the performance improvements achieved by using the Python Binary Optimization Compiler.Benchmark Results Standard Python Execution: Matrix Multiplication (200x200): Median time: 0.601605 seconds Recursive Fibonacci (n=35): Time taken: 1.215701 seconds Bubble Sort (List size 5000): Time taken: 0.903095 seconds Prime Number Generation (Limit 30000): Time taken: 1.788207 seconds Summary Evaluation (Higher is better): 4.151314 Compiled with Python Binary Optimization Compiler: Matrix Multiplication (200x200): Median time: 0.289568 seconds Recursive Fibonacci (n=35): Time taken: 1.083918 seconds Bubble Sort (List size 5000): Time taken: 0.666851 seconds Prime Number Generation (Limit 30000): Time taken: 1.012288 seconds Summary Evaluation (Higher is better): 6.863445 Performance Improvement Overall performance improvement is approximately 65% based on Summary Evaluation metrics. Note: Benchmarks were conducted on a system with the following specifications: Operating System: Windows 64-bit Processor: Intel64 Family 6 Model 165 Stepping 5, GenuineIntel Python Version: 3.11.9 Results may vary based on hardware and environment. Frequently Asked Questions (FAQ) Q: What are the system requirements for using this tool?A: You need Python 3.6 or higher, the required Python packages (requests, psutil, cryptography, setuptools, Cython, astor), and a supported compiler (mingw32, mingw64, or msvc). Q: Can I use this tool to protect my Python code from reverse engineering?A: Yes, the tool applies multiple code protection techniques, including obfuscation and encryption, to make reverse engineering significantly more difficult. Q: Does the compiled binary work on any system?A: The compiled binary is platform-specific. You need to compile your script on the target platform or ensure compatibility between systems. Q: Do I need to modify my code to use the compiled version?A: No, you simply replace your original .py script file with the compiled binary. The compiled binary is designed to be a drop-in replacement for your original Python script. Contact Information If you experience issues or have questions not covered in this documentation, please contact the Alpha Beta Network Research Team. Website: https://αβ.net | https://alphabetanet.com Official Telegram Channel: https://t.me/alphabetanetcom Stay connected to receive updates, provide feedback, and get early access to extended functionality. By utilizing the Python Binary Optimization Compiler, developers can achieve significant performance gains and secure their Python scripts effectively, adhering to code security best practices and protecting Python code from unauthorized access.This tool represents a robust solution for those looking to optimize Python code, implement advanced code obfuscation in Python, and enhance the overall security of their applications. © 2024 αβ.net (alphabetanet.com) - Alpha Beta Network. All Rights Reserved.

Cited by 0Open access

LLM Compiler: Foundation Language Models for Compiler Optimization

Chris Cummins, Volker Seeker, Dejan Grubisic et al. · 2025

Large Language Models (LLMs) have demonstrated remarkable capabilities across a variety of software engineering and coding tasks. However, their application in the domain of code and compiler optimization remains underexplored. Training LLMs is resource-intensive, requiring substantial GPU hours and extensive data collection, which can be prohibitive. To address this gap, we introduce LLM Compiler, a suite of robust, openly available, pre-trained models specifically designed for compiler tasks. Built on the foundation of Code Llama, LLM Compiler enhances the understanding of compiler intermediate representations (IRs), assembly language, and optimization techniques. The models have been trained on a vast corpus of 546 billion tokens of LLVM-IR and assembly code and have undergone instruction fine-tuning to interpret compiler behavior. To demonstrate the utility of these research tools, we also present fine-tuned versions of the models with enhanced capabilities in optimizing code size and disassembling from x86_64 and ARM assembly back into LLVM-IR. These achieve 77% of the optimising potential of an autotuning search, and 45% disassembly round trip (14% exact match). LLM Compiler is released under a bespoke commercial license to allow wide reuse and is available in two sizes: 7 billion and 13 billion parameters. Our aim is to provide scalable, cost-effective foundational models for further research and development in compiler optimization by both academic researchers and industry practitioners. Since we released LLM Compiler the community has quantized, repackaged, and downloaded the models over 250k times.

Cited by 19Open access

Machine Learning in Compiler Optimization

Haj Ali, Ameer · eScholarship (California Digital Library) · 2020

The end of Moore's law is driving the search for new techniques to improve system performance as applications continue to evolve rapidly and computing power demands continue to rise. One promising technique is to build more intelligent compilers.Compilers map high-level programs to lower-level primitives that run on hardware. During this process, compilers perform many complex optimizations to boost the performance of the generated code. These optimizations often require solving NP-Hard problems and dealing with an enormous search space. To overcome these challenges, compilers currently use hand-engineered heuristics that can achieve good but often far-from-optimal performance. Alternatively, software engineers resort to manually writing the optimizations for every section in the code, a burdensome process that requires prior experience and significantly increases the development time.In this thesis, novel approaches for automatically handling complex compiler optimization tasks are explored. End-to-end solutions using deep reinforcement learning and other machine learning algorithms are proposed. These solutions dramatically reduce the search time while capturing the code structure, different instructions, dependencies, and data structures to enable learning a sophisticated model that can better predict the actual performance cost and determine superior compiler optimizations. The proposed techniques can outperform existing state-of-the-art solutions while requiring shorter search time. Furthermore, unlike existing solutions, the deep reinforcement learning solutions are shown to generalize well to real benchmarks.

Cited by 0Open access

Combinatorial Problems in Compiler Optimization

Mirza Omer Beg · UWSpace (University of Waterloo) · 2013

Several important compiler optimizations such as instruction scheduling&#13;\nand register allocation are fundamentally hard and are usually solved using heuristics&#13;\nor approximate solutions.&#13;\nIn contrast, this thesis examines optimal solutions to three combinatorial problems in compiler optimization.&#13;\nThe first problem addresses instruction scheduling for clustered&#13;\narchitectures, popular in embedded systems. Given a set of&#13;\ninstructions the optimal solution gives the best possible schedule for a given clustered&#13;\narchitectural model. The problem is solved&#13;\nusing a decomposition technique applied to constraint programming which determines the spatial and&#13;\ntemporal schedule using an integrated approach. The experiments&#13;\nshow that our solver can tradeoff some compile time efficiency to solve most instances in&#13;\nstandard benchmarks giving significant performance improvements.&#13;\nThe second problem addresses&#13;\ninstruction selection in the compiler code generation phase.&#13;\nGiven the intermediate representation of code the optimal solution&#13;\ndetermines the sequence of equivalent machine instructions as it optimizes for code size.&#13;\nThis thesis shows that a large number of benchmark instances can be solved optimally&#13;\nusing constraint programming techniques.&#13;\nThe third problem addressed is the placement of data in memory for efficient&#13;\ncache utilization.&#13;\nUsing the data access patterns of a given program, our algorithm&#13;\ndetermines a placement to reorganize data in&#13;\nmemory which would result in fewer cache misses.&#13;\nBy focusing on graph theoretic placement techniques it is&#13;\nshown that there exist, in special cases, efficient and optimal algorithms for&#13;\ndata placement that significantly&#13;\nimprove cache utilization. We also propose heuristic solutions for solving larger instances&#13;\nfor which provably optimal solutions cannot be determined using polynomial time algorithms.&#13;\nWe demonstrate that cache hit rates can&#13;\nbe significantly improved by using profiling techniques over a wide range of benchmarks and cache configurations.

Cited by 4Open access

Optimization aspects of compiler-compilers

Thomas E. Cheatham, Thomas A. Standish · ACM SIGPLAN Notices · 1970

A decade of experience with prototype versions of compiler-compilers, some of which have been successful and some of which have not been so successful, leads us to the conclusion that we can now engineer good compiler-compilers which can generate efficient compilers that generate efficient object code. This paper reviews the experience with compiler-compilers, documents reasons for believing that some compiler-compilers are good, and advocates the importation of compiler-compiler techniques by commercial firms and the production of well-engineered compiler-compilers as commercial products. Some unanswered questions about compiler-compiler techniques are explored in relation to the newly emerging discipline of software engineering.

Cited by 3Open access

Generating compiler optimization from proofs

Ross Tate, Sorin Lerner · 2010

We present an automated technique for generating compiler optimizations from examples of concrete programs before and after improvements have been made to them. The key technical insight of our technique is that a proof of equivalence between the original and transformed concrete programs informs us which aspects of the programs are important and which can be discarded. Our technique therefore uses these proofs, which can be produced by translation validation or a proof-carrying compiler, as a guide to generalize the original and transformed programs into broadly applicable optimization rules. We present a category-theoretic formalization of our proof generalization technique. This abstraction makes our technique applicable to logics besides our own. In particular, we demonstrate how our technique can also be used to learn query optimizations for relational databases or to aid programmers in debugging type errors. Finally, we show experimentally that our technique enables programmers to train a compiler with application-specific optimizations by providing concrete examples of original programs and the desired transformed programs. We also show how it enables a compiler to learn efficient-to-run optimizations from expensive-to-run super-optimizers.

Cited by 0

Machine Learning in Compiler Optimization

Zheng Wang, Michael O’Boyle · Proceedings of the IEEE · 2018

In the last decade, machine-learning-based compilation has moved from an obscure research niche to a mainstream activity. In this paper, we describe the relationship between machine learning and compiler optimization and introduce the main concepts of features, models, training, and deployment. We then provide a comprehensive survey and provide a road map for the wide variety of different research areas. We conclude with a discussion on open issues in the area and potential research directions. This paper provides both an accessible introduction to the fast moving area of machine-learning-based compilation and a detailed bibliography of its main achievements.

Cited by 186Open access

Ecient, Compiler-Aided Dynamic Optimization

David Hodgdon · 2004

While dynamic optimizers perform well when improving code generated with little compile-time optimization (-O0,-O1), optimizing code with aggressive compile-time optimizations yields little performance increase, often increasing run-time due to the overhead of identifying and building hot traces. As dynamic optimizers mostly use information also available to the compiler via proling, their inability to improve already optimized code is not surprising. In order to improve aggressively optimized binaries, the dynamic optimizer must utilize information that is not available to the compiler even with prole feedback. The proposed dy-namic optimizer will utilize run-time data values and data object liveness information to expose additional optimization opportunities in traces. By assuming certain values remain constant or objects remain allocated, the trace must be removed when these precondition assumption become invalid. The compiler can reduce analysis overhead in the dynamic optimizer by deter-mining which objects have long lifetimes and which objects have relatively constant values. The compiler can also insert instrumentation calling the dynamic optimizer in code regions which potentially violate trace assumptions, allowing the optimizer to sleep reducing overhead. To address redundant proling and trace optimization in distributed environments, a server thread maintains a trace library and coordinates distributed path proling for trusted threads of the same program.

Cited by 0

Optimization aspects of compiler- compilers

T. E. Cheatham, Thomas A. Standish · 1970

A decade of experience with prototype versions of compiler-compilers, some of which have been successful and some of which have not been so successful, leads us to the conclusion that we can now engineer good compiler-compilers which can generate efficient compilers that generate efficient object code. This paper reviews the experience with compiler-compilers, documents reasons for believing that some compiler-compilers are good, and advocates the importation of compiler-compiler techniques by commercial firms and the production of well-engineered compiler-compilers as commercial products. Some unanswered questions about compiler-compiler techniques are explored in relation to the newly emerging discipline of software engineering.

Cited by 0

Fast Compiler Optimization Flag Selection

Melih Peker, Özcan Öztürk · 2023

Predefined optimization levels used in compilers enable generic optimization options. However, these options provide limited improvements. On the other hand, manual code optimization is challenging. Therefore, machine learning models are widely used in the literature for fast and automatic code optimization. We propose a rapid machine learning-based strategy for automatic code optimization using static, spatial, and deep analysis methods. We implemented and trained our model using eight optimization flags and two benchmark sets. We compiled these programs using each combination of the eight flags and generated thousands of graphs. We were able to obtain an average accuracy of 75%.

Cited by 0

Meta Large Language Model Compiler: Foundation Models of Compiler Optimization

Chris Cummins, Volker Seeker, Dejan Grubisic et al. · arXiv (Cornell University) · 2024

Large Language Models (LLMs) have demonstrated remarkable capabilities across a variety of software engineering and coding tasks. However, their application in the domain of code and compiler optimization remains underexplored. Training LLMs is resource-intensive, requiring substantial GPU hours and extensive data collection, which can be prohibitive. To address this gap, we introduce Meta Large Language Model Compiler (LLM Compiler), a suite of robust, openly available, pre-trained models specifically designed for code optimization tasks. Built on the foundation of Code Llama, LLM Compiler enhances the understanding of compiler intermediate representations (IRs), assembly language, and optimization techniques. The model has been trained on a vast corpus of 546 billion tokens of LLVM-IR and assembly code and has undergone instruction fine-tuning to interpret compiler behavior. LLM Compiler is released under a bespoke commercial license to allow wide reuse and is available in two sizes: 7 billion and 13 billion parameters. We also present fine-tuned versions of the model, demonstrating its enhanced capabilities in optimizing code size and disassembling from x86_64 and ARM assembly back into LLVM-IR. These achieve 77% of the optimising potential of an autotuning search, and 45% disassembly round trip (14% exact match). This release aims to provide a scalable, cost-effective foundation for further research and development in compiler optimization by both academic researchers and industry practitioners.

Cited by 1Open access

Program Type Recognition for Compiler Optimization

Tzu-Han Hung, Jiunn-yeu Chen, Wuu Yang et al. · 2009

Today’s compilers have many optimization options, and it is difficult to understand all the details and the interactions between them. Therefore, many application developers simply use the well-known compiler flags to compile all their programs. On the other hand, some researchers focus on customizing the optimizations for each program. The former method may hurt the performance of some programs since non-optimal options are applied on them. The latter approach takes care of the variations of programs but suffer from the scalability problem because the optimization space is often huge. This makes it less popular for the emerging dynamic optimizing compilers. We attack this problem by exploiting two insights: first, it is feasible to categorize the programs into different classes according to their functionalities and characteristics; second, dynamic profiling information is useful for recognizing the type of a program. With both insights, we present a novel approach for program optimization: first, the programs are categorized into different classes and the classlevel optimization decision is made by the domain experts; then, the class of an input program is recognized by the machine learning models and the optimal class-level optimizations are applied to obtain the best performance. We demonstrate that this approach can be applied to a binary translator and great performance improvement can be achieved.

Cited by 0