Superoptimisation : provably optimal code generation using answer set programming

نویسنده

  • Thomas Crick
چکیده

Code optimisation in modern compilers is an accepted misnomer for performance im­ provement some of the time. The code that compilers generate is often significantly improved, but it is unlikely to produce optimal sequences of instructions; and if it does, it will not be possible to determine that they are indeed optimal. None of the existing approaches, or techniques for creating new optimisations, is likely to change this state of play. Superoptimisation is a radical approach to generating provably optimal code, that per­ forms searches over the space of all possible instructions. Rather than starting with naively generated code and improving it, a superoptimiser starts with the specification of a function and performs a directed search for an optimal sequence of instructions that fulfils this specification. In this thesis, we present TOAST, the Total Optimisation using Answer Set Techno­ logy system, a provably optimal code generation system that applies superoptimising techniques to optimise acyclic integer-based code for modern microprocessor architec­ tures. TOAST utilises Answer Set Programming (ASP), a declarative logic program­ ming language, as an expressive modelling and efficient computational framework to solve the optimal code generation problem. We demonstrate the validity of the approach of superoptimisation using Answer Set Programming by optimising code sequences for two 32-bit RISC architectures, the MIPS R2000 and the SPARC V8. We also present an application of the TOAST sys­ tem as a peephole optimiser, by generating libraries of equivalence classes of all op­ timal instruction sequences of a given length for a specific microprocessor architecture. While this is a computationally expensive process, it only ever needs to be performed once per architecture. We also provide significant benchmarks for the performance of state of the art domain solver tools, further demonstrating the applicability of Answer Set Programming in modelling complex real-world problems.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

TOAST: Applying Answer Set Programming to Superoptimisation

Over the last ten years Answer Set Programming (ASP) has grown from a pure theoretical knowledge representation and reasoning formalism to a computational approach with a very strong formal backing. At present, ASP is seen as the computational embodiment of non-monotonic reasoning incorporating techniques of databases, knowledge representation, logic and constraint programming. ASP has become a...

متن کامل

Automatic Synthesis of Optimal-Size Concentrators by Answer Set Programming

A concentrator is a circuit with N inputs and M ≤ N outputs that can route any given subset of K ≤ M valid inputs to K of its M outputs. Concentrator circuits are important building blocks of many parallel algorithms. The design of optimal concentrator circuits is however a challenging task that has already been considered in many research papers. In this paper, we show how answer set programmi...

متن کامل

Provably Correct Code Generation: A Case Study

Provably correct compilation is an important aspect in development of high assurance software systems. In this paper we present an approach to provably correct compilation based on Horn logical semantics of programming languages and partial evaluation. We also show that continuation semantics can be expressed in the Horn logical framework, and introduce Definite Clause Semantics. We illustrate ...

متن کامل

VIDEAS: Supporting Answer-Set Program Development using Model-Driven Engineering Techniques

Recently, the techniques of model-driven engineering (MDE) have been proven valuable to manage the complexity of modern software systems during the software development process. In the area of answer-set programming (ASP), the focus is set so far on theoretical aspects, applications, and the development of efficient solvers, reducing the attention that is paid to the pragmatics of programming a...

متن کامل

Towards Provably Correct Code Generation via Horn Logical Continuation Semantics

Provably correct compilation is an important aspect in development of high assurance software systems. In this paper we explore approaches to provably correct code generation based on programming language semantics, particularly Horn logical semantics, and partial evaluation. We show that the definite clause grammar (DCG) notation can be used for specifying both the syntax and semantics of impe...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2009