9 research outputs found

    In and Out of SSA : a Denotational Specification

    No full text
    International audienceWe present non-standard denotational specifications of the SSA form and of its conversion processes from and to imperative programming languages. Thus, we provide a strong mathematical foundation for this intermediate code representation language used in modern compilers such as GCC or Intel CC. More specifically, we provide (1) a new functional approach to SSA, the Static Single Assignment form, together with its denotational semantics, (2) a collecting denotational semantics for a simple imperative language Imp, (3) a non-standard denotational semantics specifying the conversion of Imp to SSA and (4) a non-standard denotational semantics for the reverse SSA to Imp conversion process. These translations are proven correct, ensuring that the structure of the memory states manipulated by imperative constructs is preserved in compilers' middle ends that use the SSA form as control-flow data representation. Interestingly, a s unexpected by-products of our conversion procedures, we offer (1) a new proof of the reducibility of the RAM computing model to the domain of Kleene's partial recursive functions, to which SSA is strongly related, and, on a more practical note, (2) a new algorithm to perform program slicing in imperative programming languages. All these specifications have been prototyped using GNU Common Lisp. These fundamental results prove that the widely used SSA technology is sound. Our formal denotational framework further suggests that the SSA form could become a target of choice for other optimization analysis techniques such as abstract interpretation or partial evaluation. Indeed, since the SSA form is language-independent, the resulting optimizations would be automatically enabled for any source language supported by compilers such as GCC

    Dynamic Compilation for Functional Programs

    Get PDF
    Diese Arbeit behandelt die dynamische, zur Laufzeit stattfindende Übersetzung und Optimierung funktionaler Programme. Ziel der Optimierung ist die erhöhte Laufzeiteffizient der Programme, die durch die compilergesteuerte Eliminierung von Abstraktionen der Programmiersprache erreicht wird. Bei der Implementierung objekt-orientierter Programmiersprachen werden bereits seit mehreren Jahrzehnten Compiler-Techniken zur Laufzeit eingesetzt, um objekt-orientierte Programme effizient ausführen zu können. Spätestens seit der Einführung der Programmiersprache Java und ihres auf einer abstrakten Maschine basierenden Ausführungsmodells hat sich die Praktikabilität dieser Implementierungstechnik gezeigt. Viele Eigenschaften moderner Programmiersprachen konnten erst durch den Einsatz dynamischer Transformationstechniken effizient realisiert werden, wie zum Beispiel das dynamische Nachladen von Programmteilen (auch über Netzwerke), Reflection sowie verschiedene Sicherheitslösungen (z.B. Sandboxing). Ziel dieser Arbeit ist zu zeigen, dass rein funktionale Programmiersprachen auf ähnliche Weise effizient implementiert werden können, und sogar Vorteile gegenüber den allgemein eingesetzten objekt-orientierten Sprachen bieten, was die Effizienz, Sicherheit und Korrektheit von Programmen angeht. Um dieses Ziel zu erreichen, werden in dieser Arbeit Implementierungstechniken entworfen bzw. aus bestehenden Lösungen weiterentwickelt, welche die dynamische Kompilierung und Optimierung funktionaler Programme erlauben: zum einen präsentieren wir eine Programmzwischendarstellung (getypte dynamische Continuation-Passing-Style-Darstellung), welche sich zur dynamischen Kompilierung und Optimierung eignet. Basierend auf dieser Darstellung haben wir eine Erweiterung zur verzögerten und selektiven Codeerzeugung von Programmteilen entwickelt. Der wichtigste Beitrag dieser Arbeit ist die dynamische Spezialisierung zur Eliminierung polymorpher Funktionen und Datenstrukturen, welche die Effizienz funktionaler Programme deutlich steigern kann. Die präsentierten Ergebnisse experimenteller Messungen eines prototypischen Ausführungssystems belegen, dass funktionale Programme effizient dynamisch kompiliert werden können.This thesis is about dynamic translation and optimization of functional programs. The goal of the optimization is increased run-time efficiency, which is obtained by compiler-directed elimination of programming language abstractions. Object-oriented programming languages have been implemented for several decades using run-time compilation techniques. With the introduction of the Java programming language and its virtual machine-based execution model, the practicability of this implementation method for real-world applications has been proved. Many aspects of modern programming languages, such as dynamic loading and linking of code (even across networks), reflection and security solutions (e.g., sandboxing) can be realized efficiently only by using dynamic transformation techniques. The goal of this work is to show that functional programming languages can be efficiently implemented in a similar way, and that these languages even offer advantages when compared to more common object-oriented languages. Efficiency, security and correctness of programs is easier to ensure in the functional setting. Towards this goal, we design and develop implementation techniques to enable dynamic compilation and optimization of functional programming languages: we describe an intermediate representation for functional programs (typed dynamic continuation-passing style), which is well suited for dynamic compilation. Based on this representation, we have developed an extension for incremental and selective code generation. The main contribution of this work shows how dynamic specialization of polymorphic functions and data structures can increase the run-time efficiency of functional programs considerably. We present the results of experimental measurements for a prototypical implementation, which prove that functional programs can efficiently be dynamically compiled

    Estudio e implementación de protocolos de enrutamiento de redes malladas inalámbricas en entornos rurales

    Get PDF
    Este proyecto surge de la problemática de llevar las tecnologías de la información a las zonas más alejadas e inaccesibles, donde generalmente se dan los mayores índices de pobreza. Para ello se propone el estudio de la viabilidad de las redes malladas inalámbricas aplicadas en entornos rurales. Las redes malladas tienen una filosofía distribuida que permite mayores coberturas con un menor presupuesto, además de ofrecer una mayor seguridad en caso de catástrofes y una gran independencia de las grandes redes de los proveedores de Internet. Esto hace que puedan ser una interesante alternativa a las redes de comunicación inalámbrica convencionales. En primer lugar se intenta analizar cu ́les son los protocolos de encaminamiento más adecuados para redes malladas en este tipo de escenarios rurales, donde el medio inalámbrico es adverso e inestable y la logística es más complicada. En concreto, se ha desplegado para su posterior estudio, una red experimental rural en un entorno altoandino. En dicha red se comparan dos soluciones de encaminamiento de código abierto, Batman-adv y IEEE 802.11s. Adicionalmente, el proyecto intentar difundir la tecnología y transferir los conocimientos aprendidos a través de diversos talleres de capacitación,artículo técnico sobre la comparación de las prestaciones Batman-adv y IEEE 802.11s, y la creación de un proyecto de red comunitaria libre llamado MESH-RURAL, el cual facilitar ́ la implementación de redes malladas inalámbricas con estas dos soluciones de encaminamiento

    HiPE on AMD64

    No full text

    General Terms Experimentation, Measurement, Performance

    No full text
    Erlang is a concurrent functional language designed for developing large-scale, distributed, fault-tolerant systems. The primary implementation of the language is the Erlang/OTP system from Ericsson. Even though Erlang/OTP is by default based on a virtual machine interpreter, it nowadays also includes the HiPE (High Performance Erlang) native code compiler as a fully integrated component. This paper describes the recently developed port of HiPE to the AMD64 architecture. We discuss technical issues that had to be addressed when developing the port, decisions we took and why, and report on the speedups (compared with BEAM) which HiPE/AMD64 achieves across a range of Erlang programs and how these compare with speedups for the more mature SPARC and x86 back-ends

    Efficiently compiling a functional language on AMD64: the HiPE experience

    No full text
    We describe and document our experience from developing an AMD64 backend for the HiPE (High Performance Erlang) native code compiler. We consider implementation alternatives and critically examine design choices for obtaining an efficient AMD64 backend. In particular, we consider in detail how other functional language implementors can migrate their existing x86 backends to the AMD64 architecture, a platform which is becoming increasingly important these days. We mention backend components that can be shared between x86 and AMD64, and those that better be different for achieving high performance on AMD64. Finally, we measure the performance of several different alternatives in the hope that this information can save development effort for others who intend to engage in a similar feat

    Efficiently compiling a functional language on AMD64: the HiPE experience

    No full text

    Design and implementation of a native code compiler for Erlang with LLVM

    No full text
    65 σ.Στις μέρες μας, οι υπάρχοντες μεταγλωττιστές ανοιχτού κώδικα χρησιμοποιούν απαρχαιωμένες τεχνικές παραγωγής κώδικα μηχανής και δεν μοιράζονται μεταξύ τους κώδικα υλοποίησης. Επιπλέον, αποτελούνται από πολύπλοκο κώδικα υλοποίησης, γεγονός που καθιστά δύσκολο το να μελετηθούν και ακόμα πιο δύσκολο το να αλλάξουν. Η Low Level Virtual Machine (LLVM) είναι μια βιβλιοθήκη τελευταίας τεχνολογίας για μεταγλωττιστές. Παρέχει ένα σύνολο από επαναχρησιμοποιήσιμα εργαλεία που υλοποιούν τις καλύτερες τεχνικές μεταγλώττισης και στατικής ανάλυσης, εστιάζοντας στην επίδοση του παραγόμενου κώδικα και στο χρόνο μεταγλώττισης. Ο απώτερος στόχος της LLVM είναι να παρέχει ανεξάρτητα εξαρτήματα για την κατασκευή υψηλής ποιότητας μεταγλωττιστών για πολλές διαφορετικές γλώσσες. Η διπλωματική αυτή περιγράφει την παρούσα αρχιτεκτονική, τις βασικές σχεδιαστικές αποφάσεις και κάποιες λεπτομέρειες υλοποίησης ενός νέο οπίσθιου τμήματος για τον HiPE, το μεταγλωττιστή κώδικα μηχανής του συστήματος της Erlang/OTP, που χρησιμοποιεί την υποδομή της LLVM. Διαπιστώθηκε πως μία από τις ενδιάμεσες γλώσσες του HiPE, η Register Transfer Language (RTL), έχει πολύ απλή και προφανή απεικόνιση στη συμβολική γλώσσα της LLVM. Παρόλα αυτά, υπήρχαν κάποια λεπτά σημεία, όπως η σύμβαση κλήσης συναρτήσεων, ο μηχανισμός χειρισμού εξαιρέσεων και η συλλογή σκουπιδιών, που απαιτούσαν ειδικούς χειρισμούς για να διατηρηθεί η συμβατότητα με το Application Binary Interface (ABI) του Συστήματος Χρόνου-Εκτέλεσης της Erlang (Erlang Run-Time System) και κατ' επέκταση η ενσωμάτωση της δουλειάς μας να γίνει διατηρώντας την υπάρχουσα αρχιτεκτονική της Εικονικής Μηχανής. Γι' αυτούς τους λόγους χρειάστηκε να αλλάξουμε τo Εξάρτημα Παραγωγής Κώδικα της LLVM, εφαρμόζοντας τους κανόνες που επέβαλλε το ABI στον παραγόμενο κώδικα. Στο κεφάλαιο της αξιολόγησης αναλύουμε λεπτομερώς την τρέχουσα πολυπλοκότητα και την επίδοση του νέου οπίσθιου τμήματος που υλοποιήσαμε με χρήση της LLVM για την οικογένεια επεξεργαστών AMD64. Οι χρόνοι εκτέλεσης των μετρο-προγραμμάτων που μεταγλωττίστηκαν στο δικό μας οπίσθιο τμήμα ήταν συγκρίσιμοι με εκείνους των προγραμμάτων που μεταγλωττίστηκαν στο υπάρχων οπίσθιο τμήμα του HiPE, και σημαντικά πιο μικροί από εκείνων της Eικονικής Mηχανής BEAM και της Erjang, η οποία είναι μια εικονική μηχανή για την Erlang βασισμένη στην Εικονική Μηχανή της Java (JVM). Η πολυπλοκότητα του τμήματός μας αποδείχθηκε σημαντικά μικρότερη. Ιδιαιτέρως αν λάβει κανείς υπόψιν του ότι, με σχετικά απλές επεκτάσεις, το οπίσθιο τμήμα που υλοποιήσαμε μπορεί να καλύψει όλες τις αρχιτεκτονικές επεξεργαστών που σήμερα υποστηρίζει ο HiPE. Αρκετές βελτιώσεις έχουν ήδη προγραμματιστεί ως αντικείμενο μελλοντικής εργασίας.Existing open-source compilers are based on old code generation technology, with code bases that are difficult to learn and hard to change, and share no code between each other. The Low Level Virtual Machine (LLVM) is a state-of-the-art compiler infrastructure providing a set of reusable components that implement the best known techniques focusing on compile time and performance of the generated code. The goal of LLVM is to provide modular components for building high quality compilers for many different languages. This thesis describes the current architecture, design decisions and implementation details of a new back end for HiPE, the native code compiler of Erlang/OTP, that targets the LLVM infrastructure. One of HiPE's intermediate representation, called Register Transfer Language (RTL), was found to have a very straightforward translation to LLVM assembly. However, there were a few subtle points, such as the calling convention, the exception handling mechanism and the garbage collection, that needed to be handled in order to retain Application Binary Interface (ABI) compatibility with the Erlang Run-Time System (ERTS) and integrate our work in the existing Virtual Machine architecture. For these reasons we patched the LLVM Code Generator and imposed the appropriate rules on the generated binary code. In the evaluation we detail the current complexity and performance of the new LLVM back end for the AMD64 architecture. The run-time performance was found to be comparable with HiPE and signifficantly faster than BEAM virtual machine and Erjang, a virtual machine for Erlang based on the Java Virtual Machine (JVM). The complexity of the LLVM back end proved to be far simpler; especially, if you take into consideration that, with rather plain extensions, it can support all hardware architectures that HiPE currently targets. Various performance improvements are planned for future work.Χρήστος Γ. ΣταυρακάκηςΓιάννης Φ. Τσιούρη
    corecore