This extension streamlines your optimization process within the Visual Studio IDE, specifically designed for use with the Clang Compiler for optimizing applications with HWPGO.
It allows you to enhance your application's performance by utilizing hardware counters collected during runtime to further optimize the application. The Clang Compiler supports "Execution Frequency" PGO.
You can access a wider range of profile types and optimizations by using Intel’s C/C++ compiler from the Visual Studio Marketplace.
Prerequisites for using the extension
Visual Studio 2022 (17.13 or later)
Ensure the Clang Compiler is installed through the Visual Studio Installer. You can find Clang under Individual Components. The extension works with Clang version 19.1.1.
You need the ability to run applications as Administrator and adjust Windows Device security settings. This is required for profiling your application with VTune.
To profile with precise hardware events in VTune, “Core Isolation -> Memory integrity” must be turned off, and your system must be rebooted.
To use the extension, ensure your project is set to the “LLVM (clang-cl)” platform toolset. You can select this option in the “General Properties” section of your project properties.
Once configured, you should be able to right-click on your project in the Solution Explorer and find the “HW Profile-Guided Optimization for LLVM/Clang" option.
Phase 1: Recompiles your project using additional compiler and linker flags to add instrumentation information into your application.
Phase 2: Runs your application with sep.exe from VTune to collect hardware events. The output will be converted into a format that the compiler can use. Data from previous runs will be merged into a single profile.
Phase 3: Feeds the collected profile samples back into the compiler. The extension adds the compiler flags under the “C/C++ -> All Options -> Additional Options” on your project properties.