Instrumentation-based FDO
In the instrumentation-based FDO scenario, two compilations are required. The first compilation is performed with compilation option -fprofile-generate[=path]. After a series of typical scenario tests, the profile data is generated. The second compilation is performed with compilation option -fprofile-use[=path], during which AutoBOLT converts the instrumentation data to a BOLT profile and automatically enables post-link optimization.
Application Scenarios
Scenarios that are insensitive to performance loss in the instrumentation phase, or those insensitive to the build and test time but pursue ultimate performance.
Usage
1 2 3 4 5 6 | # Perform instrumentation to generate gcno. gcc -O3 -fprofile-generate[=path] -fprofile-update=atomic -o test test.c # Perform a test to obtain gcda. ./test # Use the generated gcda to build a new executable file. gcc -O3 -Wl,-q -fprofile-use[=path] -fprofile-correction -Wno-error=coverage-mismatch -Wno-error=missing-profile -fauto-bolt -fbolt-target=test -o test test.c |
Parent topic: AutoBOLT