LLVM笔记1:static profiling

13 篇文章 0 订阅
9 篇文章 0 订阅

1. 有时需要在编译器中使用static profiling来获取程序的信息,比如指令的执行次数,各分支的执行频率等。[1]提出来用于估计分支频率的启发式,[2]综合了[1],提出了用于估计分支频率以及指令执行频率的静态方法。

2. 在llvm中,已经有现成的static profiling [3] 实现,该实现正是基于[1]和[2]。此外,该实现的作者的硕士论文[4]详细地讨论了基于llvm的profiling。但是,该实现并没有集成到release里面。所以,需要手动添加。根据本人经验,手动添加进llvm 2.8没有什么问题;但是对于llvm 2.9貌似有点问题。

参考:

[1] Thomas Ball and James R. Larus. 1993. Branch prediction for free. In Proceedings of the ACM SIGPLAN 1993 conference on Programming language design and implementation (PLDI '93).

[2] Youfeng Wu and James R. Larus. 1994. Static branch frequency and program profile analysis. In Proceedings of the 27th annual international symposium on Microarchitecture (MICRO 27).

[3] http://homepages.dcc.ufmg.br/~rimsa/tools/stprof-llvm.patch

[4] llvm.org/pubs/2010-04-NeustifterProfiling.pdf.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值