[hellogcc] Re: [hellogcc] Re: Re: Re: [hellogcc] Re: [hellogcc] Re: [hellogcc] Re: [hellogcc] HelloGCC 2012 活动通知

  • From: "Michael.Kang" <blackfin.kang@xxxxxxxxx>
  • To: hellogcc@xxxxxxxxxxxxx
  • Date: Sun, 19 Aug 2012 19:08:05 +0800

2012/8/17 ???f任 (Wei-Ren Chen) <chenwj@xxxxxxxxxxxxxx>:
> On Fri, Aug 17, 2012 at 06:33:30PM +0800, Michael.Kang wrote:
>> 2012/8/17 ???f任 (Wei-Ren Chen) <chenwj@xxxxxxxxxxxxxx>:
>> >> 我们目前实现的是BB的Profiling,即一个基本块的执行次数是否到达一定阈值,如果达到了,就是热点,然后启动动态编译模块去对热点的BB进行翻译。
>> >>
>> >> 其实我们也实现了trace的profiling ,但是效果不太好,目前发现和BB
>> >> Profiling效果差不多。主要是trace的profiling本身有些复杂,也要占用运行时间。还需要进一步研究。
>> >
>> >   trace profiling 你??是怎?N做的? trace profiling 最大的用??是?@?樱?
>> >
>>
>> 在快速解释执行中统计edge的执行次数,判断几个BB是否相关联,
>> 并且执行的次数是否达到阈值。同时我们还考虑了recency,也就是说如果一段代码现在很热,但是后面又不热了,这样的代码我们也不会做为热点进行翻译。
>
>   我?X得?@可能有?c heavy。要不要???? Dynamo NET (Next-Executing Tail) [1]
> 找出 trace? 它的作法就是在你一?_始替 basic block ?a生 code 的?r候,
> 插入一些代?a,?? basic block 被?绦谐??^阈值,就??沿著??前?绦新??揭宦?
> 找出相?P??的 basic block。方法很直?^,我想?@??比你统计 edge 执行次数,
> 判断几个 BB 是否相关联?淼? lightway 些。
>
>   我有?d趣的是你??怎?N判?嘁欢未??a?F在很?幔?但???聿???? 你怎?N知道
> 未?淼氖履??

用了一个Timer,随着时间的增长为每个trace做recency的衰减。这样在挑选最
热的trace,同时看热度和recency。

>
>> 我觉得主要的问题还是llvm翻译的开销比较大,llvm的code
>> generation还是挺占时间的,所以在运行中需要找到最合适的trace去翻译来获取指令执行性能,这确实有些困难。可能trace的优化获取了一些性能收益,但是又被它在运行时刻的代价给抵消了。导致效果不佳。
>
>   你有把 LLVM 分到另一?? thread 上??? 解??器能做到跟 LLVM 分成
> ???? thread ??? 解??器??解?????绦校?找到 trace 就?G?o LLVM 翻?g
> ,解??器不要停下,LLVM 翻好之後再?\行??化?^的代?a。
多线程也做了一些工作,目前可以用两个线程,一个线程翻译,另外一个线程
执行,感觉有些提高,可能在10%到15%之间。

-- MK
>
> ?f任
>
> [1] Software profiling for hot path prediction: less is more
>
> --
> Wei-Ren Chen (???f任)
> Computer Systems Lab, Institute of Information Science,
> Academia Sinica, Taiwan (R.O.C.)
> Tel:886-2-2788-3799 #1667
> Homepage: http://people.cs.nctu.edu.tw/~chenwj
>



-- 
www.skyeye.org

Other related posts:

  • » [hellogcc] Re: [hellogcc] Re: Re: Re: [hellogcc] Re: [hellogcc] Re: [hellogcc] Re: [hellogcc] HelloGCC 2012 活动通知 - Michael.Kang