https://clang.llvm.org/docs/UsersManual.html#introduction
Differences Between Sampling and Instrumentation
Although both techniques are used for similar purposes, there are important differences between the two:
Profile data generated with one cannot be used by the other, and there is no conversion tool that can convert one to the other. So, a profile generated via -fprofile-instr-generate must be used with -fprofile-instr-use. Similarly, sampling profiles generated by external profilers must be converted and used with -fprofile-sample-use.
Instrumentation profile data can be used for code coverage analysis and optimization.
Sampling profiles can only be used for optimization. They cannot be used for code coverage analysis. Although it would be technically possible to use sampling profiles for code coverage, sample-based profiles are too coarse-grained for code coverage purposes; it would yield poor results.
Sampling profiles must be generated by an external tool. The profile generated by that tool must then be converted into a format that can be read by LLVM. The section on sampling profilers describes one of the supported sampling profile formats.