Open hstk30 opened 11 months ago
基本步骤
添加-fprofile-generate=/path,生成插桩版本的二进制工程。
在真实运行环境上运行生成的插桩版本,生成采集数据 default_*.profraw。
通过llvm-profdata工具,将采集数据merge成一个ir.profdata。
llvm-profdata merge -output=ir.profdata default_*.profraw
添加-fprofile-use=ir.profdata –ffgo-feature-gen=profile.cfg重新编译工程,生成profile.cfg。
使用FGO profile.cfg生成反馈优化版本,添加-ffgo-feature-use=profile.cfg
三种形式
-fprofile-instr-generate
对应在测试用例中的命令:%clang_profgen
-fprofile-generate
%clang_pgogen
-fcs-profile-generate
%clang_cspgogen
基本逻辑(对于IRPGO)
参考