1 / 14

框架设计

框架设计. 龚军. 内容. CPU2006 数据采集 构架设计. 内容. CPU2006 数据采集 构架设计. CPU2006 数据采集. 测试 CPU2006 Train 测试集 动静结合 加 EBO 选项的运行时间 不加 EBO 选项的运行时间 目的 找到受到 EBO 选项影响最大的 CPU2006 中的例子,这样便于有针对性地选取优化方法. CPU2006 数据采集. 测试结果. CPU2006 数据采集. 问题 加 EBO 选项和不加 EBO 选项的时间差别不是很大( 470.lbm 的效果好像还不错)

Télécharger la présentation

框架设计

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 框架设计 龚军

  2. 内容 • CPU2006数据采集 • 构架设计

  3. 内容 • CPU2006数据采集 • 构架设计

  4. CPU2006数据采集 • 测试CPU2006 Train测试集 • 动静结合 • 加EBO选项的运行时间 • 不加EBO选项的运行时间 • 目的 • 找到受到EBO选项影响最大的CPU2006中的例子,这样便于有针对性地选取优化方法

  5. CPU2006数据采集 • 测试结果

  6. CPU2006数据采集 • 问题 • 加EBO选项和不加EBO选项的时间差别不是很大(470.lbm的效果好像还不错) • 有的例子Train的时间太短,可能需要用Ref测(不过测Ref 时间应该很长,不利于做重复运行进行分析 ) • 现有的最新的Qemu-n32 版本,有几个例子会出错

  7. 内容 • CPU2006数据采集 • 构架设计

  8. 框架设计

  9. 插桩 • 热代码一般是热循环或者被频繁调用的函数 • 基于上述事实,所以插桩方法如下: • 对于跳转/分支指令,如果其目标地址小于该指令的地址(PC),就有可能是一个循环,对其进行插桩 • 对于Call指令的目标地址所在的Block进行插桩 • 不能处理Callin情况,因为目标地址未知(如:对于C++中的多态函数,就能不处理),另外对于JMP/JMPIN到一个函数的情况也不能进行处理 • 如果做Trace优化,则还需要统计每个Block的执行次数

  10. 插桩 • 插桩指令 #对tb->times进行加1 Lui a4, tb>>16 Ori a4, tb & 0xFFFF Lw a0, (a4)->times Add a0, a0, 1 Sw a0, tb->times #比较是否超过阈值 Lw a1, THRESHOLD Sub a0, a1 Blez a0, NormalPath #此时tb的地址放在a4中 Jrra NormalPath: …..

  11. 热代码 • 当Block执行到阈值(Threshold)时,会跳回本地码,将此TB放入待优化队列

  12. 优化线程 • 从待优化队列中取出TB,进行优化,并修改TB的状态

  13. 优化线程 • 问题 • 对热循环/热函数做优化,可能比较复杂,另外根据以前做Trace优化的经验,效果好像不太好 • 优化产生的本地码 • 如何管理本地码 • 由于该优化后的本地码是独立存放的,可能影响代码局部性

  14. Thank You!

More Related