Precise pointer analysis is a foundational component of many client analyses and optimizations. Scaling flow- and context-sensitive pointer analysis has been a long-standing challenge, suffering from combinatorial growth in both memory usage and runtime. Existing approaches address this primarily by reducing the amount of information tracked often, at the cost of precision and soundness. In our experience a significant proportion of this cost comes from propagation of duplicate data and low-level data structure operations being repeated a large number of times. Our measurements on SPEC benchmarks show that more than 90% of all set-union operations performed can be redundant. We present Multi-level Deduplication Engine (MDE), a mechanism that recursively augments the representation of data through de-duplication and the assignment of unique identifiers to values to eliminate redundancy. This allows MDE to trivialize many operations, and memoize operations enabling their future reuse. MDE's recursive structure allows it to represent de-duplicated values that themselves are constructed from other de-deuplicated values, capturing structural redundancy not easily possible with non-recursive techniques. We provide a full C++ implementation of MDE as a library and integrate it into an existing implementation of a flow- and context-sensitive pointer analysis. Evaluation on selected SPEC benchmarks shows a reduction up to 18.10x in peak memory usage and 8.15x in runtime. More notably, MDE exhibits an upward trend of effectiveness with the increase in benchmark size. Besides performance improvements, this work highlights the importance of representation design and suggests new opportunities for bringing efficiency to future analyses.
翻译:精确的指针分析是众多客户端分析与优化的基础组件。实现流敏感与上下文敏感的指针分析长期以来面临重大挑战,其内存使用与运行时间均存在组合爆炸式增长。现有方法主要通过减少追踪信息量来应对该问题,但往往以牺牲精度和可靠性为代价。我们的实践表明,这一代价的主要来源在于重复数据的传递以及大量重复的低级数据结构操作。在SPEC基准测试中,超过90%的集合合并操作存在冗余。本文提出多级去重引擎(MDE),该机制通过数据去重与为值分配唯一标识符来递归增强数据表示,从而消除冗余。这一设计使MDE能够简化多数操作,并通过记忆化实现操作复用。MDE的递归结构可表示由其他去重值构建的去重值,捕获非递归技术难以处理的层次结构冗余。我们以C++库形式完整实现了MDE,并将其集成至现有流敏感与上下文敏感指针分析实现中。在SPEC基准测试子集上的评估表明,峰值内存使用降低达18.10倍,运行时间降低达8.15倍。更值得注意的是,MDE的有效性随基准测试规模扩大呈上升趋势。除性能提升外,本工作凸显了表示设计的重要性,并为未来分析的高效实现提供了新思路。