In order to support generating profile with FS discriminator, three kind of changes are done in llvm-profgen:
- Dissassemble .rodata section to check if FS discriminator var ('"llvm_fs_discriminator"') exists and set the corresponding flag in the binary.
- Change the discriminator decoding in getBaseDiscriminator and getDuplicationFactor.
- set true for FunctionSamples::ProfileIsFS to enable FS functionality in ProfileData.
nit: please use full name ProfileGeneratorBase::UseFSDiscriminator for static fields.
Also, can we check Binary->useFSDiscriminator() instead of parsing in an parameter?