5 research outputs found

    Pointer Disambiguation via Strict Inequalities

    Get PDF
    International audienceThe design and implementation of static analyses that disambiguate pointershas been a focus of research since the early days of compiler construction.One of the challenges that arise in this context is the analysis of languagesthat support pointer arithmetics, such as C, C++ and assembly dialects.This paper contributes to solve this challenge.We start from an obvious, yet unexplored, observation: if a pointeris strictly less than another, they cannot alias.Motivated by this remark, we use the abstract interpretation framework tobuild strict less-than relations between pointers.To this end, we construct a program representation that bestows the StaticSingle Information (SSI) property onto our dataflow analysis.SSI gives us an efficient sparse algorithm, which, once seen as aform of abstract interpretation, is correct by construction.We have implemented our static analysis in LLVM.It runs in time linear on the number of program variables, and, depending onthe benchmark, it can be as much as six times more precise than the pointerdisambiguation techniques already in place in that compiler

    Symbolic range analysis of pointers

    No full text
    Exportado OPUSMade available in DSpace on 2019-08-13T06:54:52Z (GMT). No. of bitstreams: 1 vitormendespaisante.pdf: 1108993 bytes, checksum: 5627ad34c0b6955035b0d30a150734bb (MD5) Previous issue date: 11Análise de ponteiros é uma das técnicas mais fundamentais que compiladores utilizam para otmizar linguagens com ponteiros. No entanto, mesmo com toda a atenção que este tópico já recebeu, as propostas do estado da arte atual presentes em compiladores ainda lidam com desafios em relação à precisão evelocidade.Em particular, aritmética de ponteiros, um fator chave de linguagens como C e C++, ainda precisa de soluções satisfatórias neste campo.Este trabalho apresenta um novo algorítmo para análise de ponteiros para resolver esse problema. O ponto chave da nossa proposta é combinar análise de ponteiros com análise simbólica de largura de inteiros.Tal combinação nos permite desambiguar campos dentro de vetores e estruturas de dados, de maneira efetiva obtendo maior precisão do que algorítmos tradicionais.Para validar nossa técnica, implementamos nosso algorítmo no compilador LLVM.Testes em uma vasta gama de benchmarks nos mostraram que podemos desambiguar vários tipos de estruturas em C que as análises atuais do estado da arte não conseguem lidar. Em particular, podemos desambiguar 1.35x mais comparações do que as análises de ponteiros presentes no LLVM.Além, nossa análise é rápida: podemos lidar com um milhão de instruções em assembly em 10 segundos.Alias analysis is one of the most fundamental techniques that compilers use to optimize languages with pointers. However, in spite of all the attention that this topic has received, the current state-of-the-art approaches inside compilers still face challenges regarding precision and speed. In particular, pointer arithmetic, a key feature in C and C++, is yet to be handled satisfactorily. This work presents a new alias analysis algorithm to solve this problem. The key insight of our approach is to combine alias analysis with symbolic range analysis.This combination lets us disambiguate fields within arrays and structs, effectively achieving more precision than traditional algorithms. We have implemented it on top of the LLVM compiler. Tests on a vast suite of benchmarks show that we can disambiguate several kinds of C idioms that current state-of-the-art analyses cannot deal with. In particular, we can disambiguate 1.35x more queries than the alias analysis currently available in LL

    Combining Range and Inequality Information for Pointer Disambiguation

    No full text
    Final published version of https://hal.inria.fr/hal-01429777v2International audiencePentagons is an abstract domain invented by Logozzo and Fähndrich to validate array accesses in low-level programming languages. This algebraic structure provides a cheap “less-than check”, which builds a partial order between the integer variables used in a program. In this paper, we show how we have used the ideas available in Pentagons to design and implement a novel alias analysis.With this new algorithm, we are able to disambiguate pointers with off- sets, that commonly occur in C programs, in a precise and efficient way. Together with this new abstract domain we describe several implementation decisions that let us produce a practical pointer disambiguation algorithm on top of the LLVM compiler. Our alias analysis is able to handle programs as large as SPEC CPU2006’s gcc in a few minutes. Furthermore, it improves on LLVM’s industrial quality analyses. As an extreme example, we have observed a 4x improvement when analyzing SPEC’s lbm

    Combining Range and Inequality Information for Pointer Disambiguation

    Get PDF
    Pentagons is an abstract domain invented by Logozzo and Fähndrich to validate arrayaccesses in low-level programming languages. This algebraic structure provides a cheap “less-thancheck”, which builds a partial order between the integer variables used in a program. In this paper,we show how we have used the ideas available in Pentagons to design and implement a novel aliasanalysis. This new algorithm lets us disambiguate pointers with offsets, so common in C-stylepointer arithmetics, in a precise and efficient way. Together with this new abstract domain wedescribe several implementation decisions that lets us produce a practical pointer disambiguationalgorithm on top of the LLVM compiler. Our alias analysis is able to handle programs as large asSPEC’s gcc in a few minutes. Furthermore, we have been able to improve the percentage of pairsof pointers disambiguated, when compared to LLVM’s built-in analyses, by a four-fold factor insome benchmarks.Les Pentagons est un domaine abstrait inventé par Logozzo et Fähndrich pour la validation des accès tableaux dans les langages de programmation à bas niveau. Cette structure algébrique fournit une relation d’ordre partiel entre les variables entières du programme. Il s’agit d’une relation "plus petit que". Dans ce papier, nous montrons comment utiliser l’idée des Pentagons pour concevoir et implémenter une nouvelle analyse d’alias. Ce nouvel algorithme nous permet de désambiguiser, d’une manière précide et efficace, des pointeurs avec des offsets fréquemment utlisés dans l’arithmétique des pointeurs en C. Nous décrivons, en plus de ce nouveau domaine abstrait, plusieurs détails d’implémentation qui nous ont permis de produire un algorithme d’analyse de pointeurs dans LLVM. Notre analyse est capable de traiter des programmes aussi larges que gcc de SPEC en quelques minutes seulement. Par ailleurs, pour certains benchmarks, nous avons réussi à améliorer par facteur de quatre le pourcentage de paires de pointeurs désambiguisés, étant comparé aux analyses existantes dans LLVM

    Symbolic Range Analysis of Pointers

    Get PDF
    International audienceAlias analysis is one of the most fundamental techniques thatcompilers use to optimize languages with pointers.However, in spite of all the attention that this topic has received, the currentstate-of-the-art approaches inside compilers still face challenges regardingprecision and speed.In particular, pointer arithmetic, a key feature in C and C++, is yet to behandled satisfactorily.This paper presents a new alias analysis algorithm to solve this problem.The key insight of our approach is to combine alias analysis with symbolicrange analysis.This combination lets us disambiguate fields within arrays and structs,effectively achieving more precision than traditional algorithms.To validate our technique, we have implemented it on top of the LLVM compiler.Tests on a vast suite of benchmarks show that we can disambiguate severalkinds of C idioms that current state-of-the-art analyses cannot deal with.In particular, we can disambiguate 1.35x more queries than the alias analysiscurrently available in LLVM.Furthermore, our analysis is very fast: we can go over one million assemblyinstructions in 10 seconds
    corecore