摘要: 软件规范中的函数调用约定指出,caller和callee都需要保存函数调用前后的程序状态。根据数据流分析和过程间分析,caller和callee会保存和恢复的程序状态有不同的分工。数据流分析方法在决定对callee-save的寄存器是否要保存恢复时是从理论上在函数的入口保存寄存器状态而在函数的出口恢复寄存器状态,然而在特定控制流路径上并没有对一些保存的全局寄存器的状态进行修改,所以这些控制流路径上的寄存器保存恢复实际上是冗余的。该文提出了一种简单快捷的反向数据流分析方法,对特定控制流路径上的callee-save的寄存器恢复指令进行选择性优化,从而使特定控制流路径上的代码得到有效的优化,特别是对热控制流路径和短路径,提出的优化方法显得特别重要。
关键词:
调用约定,
控制流路径,
过程调用,
caller-save/callee-save的寄存器
Abstract: According to calling convention, caller and callee have to save and restore the corresponding registers across boundaries of procedure call, and these registers are divided into caller-save registers and callee-save registers. Current optimizations can address some redundant saves and restores of registers if data flow analysis can tell whether these registers are changed or not; but can't help on certain control flow path if these registers aren't changed on the path. The research work presents a new technique to optimize save/restores of registers on a path-sensitive way, which becomes pretty important and effective on short control flow paths and hot paths.
中图分类号:
芦运照,张兆庆. 控制流路径敏感的深层代码优化技术[J]. , 2004, 30(10): 48-.
LU Yunzhao,ZHANG Zhaoqing. An Optimization Technique on A Path Sensitive Manner[J]. , 2004, 30(10): 48-.