高级检索

    RALBP:面向高性能处理器的运行时自适应循环分支预测器

    RALBP: A Runtime-Adaptive Loop Branch Predictor for High-Performance Processors

    • 摘要: 随着高性能处理器指令窗口扩大和流水线加深,分支误预测带来的冲刷与状态恢复开销不断增加,分支预测准确率对整体性能的影响日益显著。针对循环分支方向主要由当前迭代数与循环总数共同决定,而通用历史型预测器难以准确识别循环退出边界的问题,提出了一种运行时自适应循环分支预测器(runtime-adaptive loop branch predictor,RALBP)。为了精确跟踪循环的执行进度,该预测器采用了当前迭代数和循环总数的解耦更新机制,即当前迭代数在预测阶段进行推测更新以保证实时性,而循环总数在提交阶段基于真实执行信息训练来达到快速收敛。同时,RALBP通过收益寄存器在运行时动态统计其性能收益,实现了自主根据运行时收益决定是否采用其预测结果。除此之外,RALBP引入了新的步长数据域用于支持循环总数按固定步长变化的场景。基于香山处理器和SPEC CPU2006/2017的实验结果表明,相比于TAGE-SC-L(tagged geometric history length predictor with a statistical corrector and a loop predictor)中的循环分支预测器,RALBP将每周期指令数(instructions per cycle,IPC)的几何平均提升了0.52%,并且实现了6.58%的每千条指令误预测数(mispredictions per kilo instructions,MPKI)下降。与此同时,整个分支预测单元(branch prediction unit,BPU)的单元面积仅增加了0.5%,且功耗无明显增长。

       

      Abstract: As instruction windows become larger and pipelines become deeper in high-performance processors, the overhead caused by pipeline flushes and state recovery after branch mispredictions continues to increase. As a result, branch prediction accuracy has an increasingly significant impact on overall processor performance. For loop branches, the branch direction is mainly determined by the relationship between the past iteration count and the loop trip count, making it difficult for general-purpose history-based predictors to accurately identify loop exit boundaries. To address this problem, this paper proposes RALBP, a Runtime-Adaptive Loop Branch Predictor. To accurately track loop execution progress, RALBP adopts a decoupled update mechanism for the past iteration count and the loop trip count. Specifically, the past iteration count is speculatively updated at the prediction stage to ensure timeliness, while the loop trip count is trained at the commit stage using non-speculative execution information to achieve fast convergence. Meanwhile, RALBP uses a benefit register to track its runtime performance benefit and determine whether to use its predictions. In addition, RALBP introduces a new stride field to support loops whose trip counts change with a fixed stride. Experimental results on the XiangShan processor using SPEC CPU2006 and SPEC CPU2017 show that, compared with the loop predictor in TAGE-SC-L (tagged geometric history length predictor with a statistical corrector and a loop predictor), RALBP improves the geometric mean of IPC (instructions per cycle) by 0.52% and reduces MPKI (mispredictions per kilo instructions) by 6.58%. At the same time, the cell area of the entire BPU (branch prediction unit) increases by 0.5%, with no noticeable increase in power consumption.

       

    /

    返回文章
    返回