This patch introduce a new toggle option -fprofile-ir-instr that enables IR level instrumentation. It needs to be used in combination with current PGO options. Without an existing PGO options, this option alone is a null operation.
This patch depends on llvm patch http://reviews.llvm.org/D15828 where we introduce a pair of passmanagerbuilder options:
-profile-generate=<profile_filename>
-profile-use=<profile_filename>
Note that the profile specified in driver level options (-fprofile-instr-generate, -fprofile-instr-use, -fprofile-generate, and -profile-use) overrides the profile in the passmanagerbuilder option.
tiny nit: the word "code" seems redundant here.