Speed and precision in range analysis

  • Authors:
  • Victor Hugo Sperle Campos;Raphael Ernani Rodrigues;Igor Rafael de Assis Costa;Fernando Magno Quintão Pereira

  • Affiliations:
  • Department of Computer Science, UFMG, Brazil;Department of Computer Science, UFMG, Brazil;Department of Computer Science, UFMG, Brazil;Department of Computer Science, UFMG, Brazil

  • Venue:
  • SBLP'12 Proceedings of the 16th Brazilian conference on Programming Languages
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

Range analysis is a compiler technique that determines statically the lower and upper values that each integer variable from a target program may assume during this program's execution. This type of inference is very important, because it enables several compiler optimizations, such as dead and redundant code elimination, bitwidth aware register allocation, and detection of program vulnerabilities. In this paper we describe an inter-procedural, context-sensitive range analysis algorithm that we have implemented in the LLVM compiler. During the effort to produce an industrial-quality implementation of our algorithm, we had to face a constant tension between precision and speed. The foremost goal of this paper is to discuss the many engineering choices that, due to this tension, have shaped our implementation. Given the breath of our evaluation, we believe that this paper contains the most comprehensive empirical study of a range analysis algorithm ever presented in the compiler related literature.