活性分析:编译器中的一种数据流分析,用来判断在程序的某个位置上,某个变量(或寄存器中的值)在未来是否还会被使用(即“仍然活着/有效”)。常用于寄存器分配与死代码消除等优化阶段。
/ˈlaɪvnəs əˈnæləsɪs/
The compiler performs liveness analysis before register allocation.
编译器会在进行寄存器分配之前执行活性分析。
By running liveness analysis over the control-flow graph, the optimizer can build an interference graph and reduce unnecessary loads and stores.
通过在控制流图上进行活性分析,优化器可以构建冲突图,从而减少不必要的加载与存储操作。
liveness 来自 live(“活的、仍在使用的”)+ 名词后缀 -ness(表示性质);analysis 源自希腊语词根,含“分解、解析”之意。合起来就是“对(变量)是否仍有用的性质进行分析”。