Profiling various application characteristics, including the number of different arithmetic operations performed, memory footprint, etc., dynamically is time- and space-consuming. On the other hand, static analysis methods, although fast, can be less accurate. This paper presents an LLVM-based probabilistic static analysis method that accurately predicts different program characteristics and estimates the reuse distance profile of a program by analyzing the LLVM IR file in constant time, regardless of program input size. We generate the basic-block-level control flow graph of the target application kernel and determine basic-block execution counts by solving the linear balance equation involving the adjacent basic blocks' transition probabilities. Finally, we represent the kernel memory accesses in a bracketed format and employ a recursive algorithm to calculate the reuse distance profile. The results show that our approach can predict application characteristics accurately compared to another LLVM-based dynamic code analysis tool, Byfl.
翻译:动态分析各种应用特征(包括执行的算术运算次数、内存占用等)在时间和空间上均较为耗时。而静态分析方法虽然速度快,但精度可能不足。本文提出一种基于LLVM的概率性静态分析方法,通过分析LLVM IR文件,可在常数时间内准确预测不同程序特征并估算应用程序的内存重用距离轮廓,且不依赖于程序输入规模。我们为目标应用核生成基本块级控制流图,通过求解相邻基本块转移概率的线性平衡方程来确定基本块执行次数。最后,将内核内存访问表示为括号化格式,并采用递归算法计算重用距离轮廓。实验结果表明,与另一款基于LLVM的动态代码分析工具Byfl相比,本方法能更准确地预测应用特征。