Is there profiling that survives to transformations?


I’m studying LLVM for a project and I am in doubt if LLVM has a specific functionality.

I started using GCOV profiling and GCOVFunctions, but I want that my profile continues being as consistent as possible after the application of some transformations that changes the CFG.

So I started reading some of the code from Scalar/SampleProfile.cpp and I would like to know if this code do that. If not, does LLVM have some thing to do that?


Vanderson M. Rosario

No. This code is unrelated to what you are looking for. This is the
pass that reads an external profile and applies it to the IR.

Once profile information is converted into IR annotations, it is the
responsibility of each pass to maintain them as they transform the IR.
Currently, the `prof' annotation (the annotation generated by
profiling) is maintained by most transformations.