This patch includes the passmanagerbuilder change that enables IR level PGO instrumentation. It adds two passmanagerbuilder options:
-profile-generate=<profile_filename> -profile-use=<profile_filename>
which is primary for debug purpose (or called directly from opt).
It adds two fields in class PassManagerBuilder:
std::string PGOInstrGen
std::string PGOInstrUse
which specifies profile name for generation and use passes, respectively.
In PassManagerBuilder::populateModulePassManager(), it adds a preinstrumenation inline pass if IR level instrumentation is enabled. It then calls the profile generation or use pass as the option specified.