2013-11-20 23 views

回答

1

你寫的問題的方式意味着你試圖執行使用llvm-prof程序。但我不確定這是否是這樣做的。個人資料的方式是先來測試您的代碼與計數器使用:

lli -O0 -fake-argv0 'program.bc < YOUR_ARGS' -load llvm/Debug+Asserts/lib/libprofile_rt.so program.profile.bc 

注意的方式向參數傳遞給使用-fake-argv0 'program.bc < YOUR_ARGS'程序:

opt -disable-opt -insert-edge-profiling -o program.profile.bc program.bc 

然後如下執行使用lli儀器化方案以上。此步驟將生成llvmprof.out文件,然後可以用llvm-prof讀取文件以生成執行配置文件,如下所示:

llvm-prof program.profile.bc 
4

我建議在此時遠離llvm-prof。原因是它實際上是在一個月前從主幹LLVM中刪除的(修訂版191835)。這裏是提交消息應該澄清的動機:

Remove the very substantial, largely unmaintained legacy PGO 
infrastructure. 

This was essentially work toward PGO based on a design that had several 
flaws, partially dating from a time when LLVM had a different 
architecture, and with an effort to modernize it abandoned without being 
completed. Since then, it has bitrotted for several years further. The 
result is nearly unusable, and isn't helping any of the modern PGO 
efforts. Instead, it is getting in the way, adding confusion about PGO 
in LLVM and distracting everyone with maintenance on essentially dead 
code. Removing it paves the way for modern efforts around PGO. 

Among other effects, this removes the last of the runtime libraries from 
LLVM. Those are being developed in the separate 'compiler-rt' project 
now, with somewhat different licensing specifically more approriate for 
runtimes.