Master the fundamental concepts of compiler optimization techniques through this focused micro-challenge.
Profile-Guided Optimization (PGO) runs a instrumented binary on representative input, records edge frequencies, then rebuilds with fprofile-use so the compiler lays out hot branches and inlines the right callees. Chrome, Firefox, and LLVM itself ship PGO-trained builds.
Phase 1: -fprofile-generate run workload. Phase 2: -fprofile-use recompile using .profraw merged to .profdata.
bashLoading…
Keep the relevant documentation open while you implement. When your output disagrees with the reference, trace one failing case by hand before changing random lines.
You will generate and consume a profile to build a PGO-optimized binary. This exercise requires comparing branch layout or speed against a non-PGO build.
Demonstrate Profile-Guided Optimization (PGO) with performance comparison.
Requirements:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github