Optimizing your applications
The XL compilers enable development of high performance applications by offering a comprehensive set of performance enhancing techniques that exploit the multilayered PowerPC® architecture. These performance advantages depend on good programming techniques, thorough testing and debugging, followed by optimization and tuning.
- Distinguishing between optimization and tuning
You can use optimization and tuning separately or in combination to increase the performance of your application. Understanding the difference between them is the first step in understanding how the different levels, settings, and techniques can increase performance. - Steps in the optimization process
As you begin the optimization process, consider that not all optimization techniques suit all applications. Trade-offs sometimes occur between an increase in compile time, a reduction in debugging capability, and the improvements that optimization can provide. - Basic optimization
The XL compiler supports several levels of optimization, with each option level building on the levels below through increasingly aggressive transformations and consequently using more machine resources. - Advanced optimization
Higher optimization levels can have a tremendous impact on performance, but some trade-offs can occur in terms of code size, compile time, resource requirements, and numeric or algorithmic precision. - Tuning for your system architecture
You can instruct the compiler to generate code for optimal execution on a given microprocessor or architecture family. By selecting appropriate target machine options, you can optimize to suit the broadest possible selection of target processors, a range of processors within a given family of processor architectures or a specific processor. - Using high-order loop analysis and transformations
High-order transformations are optimizations that specifically improve the performance of loops through techniques such as interchange, fusion, and unrolling. - Using interprocedural analysis
Interprocedural analysis (IPA) enables the compiler to optimize across different files (whole-program analysis), and it can result in significant performance improvements. - Using profile-directed feedback
You can use profile-directed feedback (PDF) to tune the performance of your application for a typical usage scenario. The compiler optimizes the application based on an analysis of how often branches are taken and blocks of code are run. - Marking variables as local or imported
The compiler assumes that all variables in applications are imported, but the use of -qdatalocal and -qdataimported can mark variables local or imported. The compiler optimizes applications that are based on the specification of static or dynamic binding for program variables. - Other optimization options
Options are available to control particular aspects of optimization. They are often enabled as a group or given default values when you enable a more general optimization option or level.