arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1903.05333cs.PLcs.LOcs.SE
收藏

SymPas:符号程序切片

SymPas: Symbolic Program Slicing

Yingzhou Zhang

摘要:

程序切片是一种通过关注程序行为的选定方面来简化程序的技术。当前主流的静态切片方法在PDG(程序依赖图)或SDG(系统依赖图)上操作,但是这些友好的图表示对于一些用户来说可能是昂贵的并且容易出错。在本文中,我们试图研究一个轻量级的静态程序切片的方法,称为符号程序切片(Symbolic Program Slicing,SymbolPas),它的工作原理是对LLVM(低级虚拟机)的一个简单的分析。在我们的SymPas方法中,切片是符号化存储的,而不是重新分析的过程(参见。程序摘要)。SymPas不是多次重新分析过程以找到每个调用上下文的切片,而是计算单个符号(或参数化)切片,该切片可以在调用站点实例化,避免重新分析;它在LLVM中实现以对其中间表示(IR)执行切片。为了比较,我们系统地适应IFDS(过程间有限分布子集)分析和基于SDG的切片方法(SDG-IFDS)静态IR切片程序。在开源和基准程序上进行评估,与后向SDG-IFDS相比,我们的后向SymPas显示出时间成本降低了6倍,空间成本降低了4倍,因此更高效。此外,结果表明,在研究了66个程序的切片后,大小范围高达336,800条IR指令,SymPas具有高度的大小可伸缩性。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑