一句话:提出首个面向C/C++的增量式全稀疏流敏感指针分析算法,支持代码增删并保持精度与效率。
流敏感指针分析精度高但难以扩展到大型C/C++项目,而软件持续迭代使重算代价高昂。本文提出IncSFS,首个增量式全稀疏流敏感指针分析算法。它先将程序的值流图转为约束图,通过强连通分量检测保证精度;再交替传播指向集的增加与减少,在单趟分析中同时支持代码删除和插入。当指向关系满足对象无环时,算法保证终止并计算最小不动点。在六个大型真实项目上,IncSFS相较全量流敏感分析平均加速9.60倍,相较传统重置-重算方法加速5.84倍,并比现有传播指向集变化的增量算法效率高15.8%。
Pointer analysis is the fundamental technique for compiler optimization and program analysis. Flow sensitive pointer analysis provides high precision but hard to scale to large-size projects. Tailored for rapid iteration scenarios where software evolves continuously, we introduce IncSFS, the first incremental full-sparse flow-sensitive pointer analysis algorithm for C/C++ programs. The algorithm contains two main steps. It first transforms the value-flow graph of a program into a constraint graph, on which a strongly-connected component detection is performed to ensure precision. It then propagates increases and decreases in points-to set in an interleaving manner to support both code deletion and insertion within a single analysis pass. IncSFS is guaranteed to terminate and compute the least fixed point when point-to relation during the analysis is object-acyclic. Experimental results on six large-scale real-world projects show that IncSFS is both precise and efficient, achieving average speedups of 9.60 x over full flow-sensitive pointer analysis and of 5.84 x over the traditional reset-recompute incremental approach. Furthermore, IncSFS improves efficiency by 15.8% compared with state-of-the-art incremental pointer analysis algorithms that also propagate changes in points-to sets.