Skip to main content
QUICK REVIEW

[论文解读] SymPas: Symbolic Program Slicing

Yingzhou Zhang|arXiv (Cornell University)|Mar 13, 2019
Software Testing and Debugging TechniquesComputer Science参考文献 46被引用 3
一句话总结

SymPas 提出了一种轻量级、基于符号的静态程序切片方法,该方法在 LLVM 的中间表示(IR)上运行,利用符号执行生成参数化切片。通过避免对过程进行重复重新分析,SymPas 相较于 SDG-IFDS 实现了 6 倍的性能提升和 4 倍的空间节省,证明了其在包含最多 336,800 条 IR 指令的大规模程序中具有出色的可扩展性。

ABSTRACT

Program slicing is a technique for simplifying programs by focusing on selected aspects of their behaviour. Current mainstream static slicing methods operate on the PDG (program dependence graph) or SDG (system dependence graph), but these friendly graph representations may be expensive and error-prone for some users. We attempt in this paper to study a light-weight approach of static program slicing, called Symbolic Program Slicing (SymPas), which works as a dataflow analysis on LLVM (Low-Level Virtual Machine). In our SymPas approach, slices are stored symbolically rather than procedure being re-analysed (cf. procedure summaries). Instead of re-analysing a procedure multiple times to find its slices for each callling context, SymPas calculates a single symbolic (or parameterized) slice which can be instantiated at call sites avoiding re-analysis; it is implemented in LLVM to perform slicing on its intermediate representation (IR). For comparison, we systematically adapt IFDS (Interprocedural Finite Distributive Subset) analysis and the SDG-based slicing method (SDG-IFDS) to statically IR slice programs. Evaluated on open-source and benchmark programs, our backward SymPas shows a factor-of-6 reduction in time cost and a factor-of-4 reduction in space cost, compared to backward SDG-IFDS, thus being more efficient. In addition, the result shows that after studying slices from 66 programs, ranging up to 336,800 IR instructions in size, SymPas is highly size-scalable.

研究动机与目标

  • 解决基于 PDG 或 SDG 表示的传统静态切片方法在性能和可扩展性方面的局限性。
  • 开发一种轻量级、高效的现有切片技术替代方案,避免对过程进行重复重新分析。
  • 通过符号化编码切片而非为每个调用点计算切片,实现对大规模程序的可扩展切片。
  • 通过真实世界程序和基准程序的实际评估,检验符号化切片在执行时间和空间可扩展性方面的表现。

提出的方法

  • SymPas 在 LLVM 的中间表示(IR)上执行数据流分析,以计算符号化切片。
  • 它使用调用上下文参数对切片进行符号化表示,从而无需重复重新分析过程。
  • 该方法利用 IFDS(跨过程有限分配子集)分析原理,传播符号化依赖关系至程序各点。
  • 切片通过在调用点使用符号参数实例化,实现在无需重新计算的前提下按需高效生成切片。
  • 该方法作为 LLVM 编译器基础设施的扩展实现,以支持 IR 层级的切片。
  • 通过在真实世界程序和基准程序上进行反向切片,与 SDG-IFDS(一种标准的基于 SDG 的切片方法)进行性能对比。

实验结果

研究问题

  • RQ1符号化程序切片能否降低传统切片技术的时间和空间开销?
  • RQ2与 SDG-IFDS 相比,SymPas 在执行时间和内存使用方面的表现如何?
  • RQ3SymPas 对于包含最多 336,800 条 IR 指令的大规模程序,其可扩展性如何?
  • RQ4符号化切片能否在保持正确性和精度的前提下避免对过程的重复重新分析?
  • RQ5在多样化程序工作负载下,使用符号化参数化在切片中能带来多大实际性能提升?

主要发现

  • 与反向 SDG-IFDS 切片相比,SymPas 实现了 6 倍的时间成本降低。
  • 与反向 SDG-IFDS 相比,SymPas 将内存使用量减少了 4 倍。
  • 该方法在大规模程序上表现出良好的可扩展性,成功分析了包含最多 336,800 条 IR 指令的程序。
  • 符号化表示使得在调用点能够高效实例化切片,而无需重新分析过程。
  • 对 66 个真实世界程序的评估证实了 SymPas 的实际效率和鲁棒性。
  • SymPas 在时间和空间效率方面均优于 SDG-IFDS,同时通过符号化依赖关系追踪保持了正确性。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。