Often, software developers have deeper insights into their software’s behavior and its inputs than the compiler does. This knowledge represents a valuable optimization opportunity that can significantly improve performance when properly communicated to the compiler as boundary information.
When a loop’s size is determined at runtime, the compiler faces a dilemma:
As a developer, you often know more about your application’s runtime characteristics than the compiler can infer, such as:
In this Learning Path, you’ll learn how to explicitly communicate this valuable context to the compiler, enabling it to generate more efficient code.
You can use any Arm Linux system to run the example application and learn about loop optimization. The only requirement is to install the g++
compiler.
If you are running Ubuntu or another Debian-based Linux distribution, you can use the commands below to install the compiler:
sudo apt update
sudo apt install g++ -y
For other Linux distributions, use the appropriate package manager to install g++
.
This learning path uses standard C++ features and optimization techniques that work with any recent C++ compiler.
You can check your version using:
g++ --version
Continue to the next section to learn about an example application which demonstrates how to use developer knowledge for loop boundary information.