Performance Evaulation of ISO C restrict on the Power Architecture

University essay from Lunds universitet/Institutionen för datavetenskap

Abstract: The C99 standard for the C programming language introduced the new type qualifier restrict which acts as a hint for the compiler and the programmer that the specified pointer is not aliased by any other pointer if the pointed object can be modified. By using restrict on pointers the compiler may, if implemented and allowed, optimize code even further. This thesis investigates how well the C compilers GCC, Clang and XL C implements optimizations based on restrict on the Power architecture. By running a modified Livermore benchmark consisting of different loops that are suitable for restrict based optimizations we show that all three compilers are capable of doing restrict based optimizations. Furthermore we investigate loops using a pipeline simulator in order to understand the performance characteristics of the optimizations. We show that the performance for each loop vary by compiler, some loops have their running time significantly reduced while others, somewhat surprisingly, actually have their run time increased. Finally we provide some general suggestions for programmers and compiler developers on how to best use restrict.

  AT THIS PAGE YOU CAN DOWNLOAD THE WHOLE ESSAY. (follow the link to the next page)