Optimizing Itanium-Based Applications (May 2011)

Optimizing Itanium-Based Applications
2
Table of Contents
introduction .....................................................................................................................................................3
six levels of optimization.................................................................................................................................3
level zero .................................................................................................................................................... 3
level one ..................................................................................................................................................... 3
level two ..................................................................................................................................................... 4
level two -ipo.............................................................................................................................................. 4
level three ................................................................................................................................................... 5
level four (level three –ipo) ........................................................................................................................ 5
interprocedural optimizations with -ipo...........................................................................................................6
loop optimizations at +O3 or +O4...................................................................................................................8
advanced optimization options and pragmas...................................................................................................9
enabling aggressive optimizations.............................................................................................................10
removing compilation time limits when optimizing..................................................................................10
limiting the size of optimized code............................................................................................................11
controlling the scheduling model ..............................................................................................................11
controlling floating point optimization......................................................................................................11
controlling data allocation .........................................................................................................................13
controlling symbol binding........................................................................................................................13
controlling other optimization features......................................................................................................16
profile-based optimization.............................................................................................................................20
instrumenting the code ..............................................................................................................................20
collecting execution profile data................................................................................................................20
performing profile-based optimization......................................................................................................20
maintaining profile data files.....................................................................................................................21
merging profile data files...........................................................................................................................21
locking of profile database files.................................................................................................................22
Itanium- versus PA-RISC profile-based optimization differences ............................................................22
compiler-generated performance advice........................................................................................................23
putting it together with optimization option recipes......................................................................................23
References .....................................................................................................................................................25