Why Programmer-specified Aliasing is a Bad Idea

Markus Mock (1)

e-mails: mock@cs.pitt.edu

(1) University of Pittsburgh - Department of Computer Science PA 15260 Pittsburgh Estados Unidos

Abstract

The ISO C standard C99 has added a special keyword, named restrict to allow the programmer to specify non-aliasing as an aid to the compiler's optimizer and to thereby possibly improve performance.

However, it is the programmer's responsibility to ensure that the annotations are correct. Therefore, in practice, restrict will be useful only when the programmer's effort is rewarded with noticeable performance improvement. To assess the performance potential of the restrict annotation, we automatically generated best-case restrict annotations for SPEC CPU2000 benchmarks by using pointer profiling. However, even though we used the best possible restrict annotations, we found an average program speedup of less than 1% on average when using two state-of-the art optimizing compilers that implement the restrict pragma. Since the typical performance benefits do not warrant significant user effort and potential errors, we conclude that having the programmer specify non-aliasing is a bad idea.

Keywords:C, C99 Standard, Restrict, Compilers, Program Optimization, Aliasing, Dynamic Points-to Analysis


BibTex

@INPROCEEDINGS{mock04:12,
                  AUTHOR       = {Markus Mock},
                  TITLE        = {Why Programmer-specified Aliasing is a Bad Idea},
                  BOOKTITLE    = {30ma Conferencia Latinoamericana de Informática (CLEI2004)},
                  YEAR         = {2004},
                  editor       = {Mauricio Solar and David Fernández-Baca and Ernesto Cuadros-Vargas},
                  pages        = {66--75},
                  address      = {},
                  month        = Sep,
                  organization = {Sociedad Peruana de Computación},
                  note         = {ISBN 9972-9876-2-0},
                  file         = {http://clei2004.spc.org.pe/es/html/pdfs/12.pdf}
}

pdficon.gif PDF de este artículo
PDF de CLEI2004 (incluye todos los artículos)
Página principal CLEI 2004
Generado por Sociedad Peruana de Computación