引用本文:于恒彪,易昕,范小康,唐滔,黄春,尹帮虎,王戟.面向编译优化结果不一致的代码高效定位.软件学报,2025,36(12):5387-5401
【打印本页】   【HTML】   【下载PDF全文】   查看/发表评论  【EndNote】   【RefMan】   【BibTex】
←前一篇|后一篇→ 过刊浏览    高级检索
本文已被:浏览 1449次   下载 1823 本文二维码信息
码上扫一扫!
分享到: 微信 更多
面向编译优化结果不一致的代码高效定位
于恒彪1, 易昕1, 范小康1, 唐滔1, 黄春1, 尹帮虎2, 王戟1
1.国防科技大学 计算机学院, 湖南 长沙 410073;2.国防科技大学 系统工程学院, 湖南 长沙 410073
摘要:
编译器是程序开发人员最依赖的性能优化工具之一. 然而, 受限于浮点数有限精度编码问题, 很多编译优化选项会改变浮点计算的语义, 进而导致程序计算结果不一致. 定位程序中导致编译优化结果不一致的语句对于程序性能优化和结果可复现具有重要意义. 当前最先进的方法PLiner采用基于语句精度增强的二分搜索来定位导致编译优化结果不一致的代码段, 受限于对多源问题代码的定位支持不够和搜索效率不高问题. 提出一种浮点指令差异性引导的Delta调试定位方法FI3D, 利用Delta调试中的回溯机制更好地支持多源问题代码定位, 基于不同编译优化选项下函数浮点指令序列的差异性来引导定位. 使用NPB基准测试集中的6个应用、GSL数学库中的10个程序和floatsmith混合精度测试集中的2个程序对FI3D进行了评测, 实验结果显示FI3D能够成功定位PLiner失效的4个测试用例, 且对PLiner成功定位的14个测试用例获得了平均26.8%的性能提升.
关键词:  编译优化  结果不一致  浮点指令差异性  Delta调试
DOI:10.13328/j.cnki.jos.007406
分类号:
基金项目:国家重点研发计划(2023YFB3001600); 国家自然科学基金(62272471, 62202488)
Efficient Localization for Codes Causing Compilation Optimization-induced Result Inconsistency
YU Heng-Biao1, YI Xin1, FAN Xiao-Kang1, TANG Tao1, HUANG Chun1, YIN Bang-Hu2, WANG Ji1
1.College of Computer Science and Technology, National University of Defense Technology, Changsha 410073, China;2.College of Systems Engineering, National University of Defense Technology, Changsha 410073, China
Abstract:
The compiler is one of the most relied-upon performance tuning tools for program developers. However, due to the limited precision encoding of floating-point numbers, many compiler optimization options can alter the semantics of floating-point calculations, leading to result inconsistency. Locating the program statements that cause compilation optimization-induced result inconsistency is crucial for performance tuning and result reproducibility. The state-of-the-art approach employs precision enhancement-based binary search to locate the code snippets causing result inconsistency but suffers from insufficient support for multi-source localization and low search efficiency. This study proposes a floating-point instruction difference-guided Delta-Debugging localization method, FI3D, which utilizes the backtracking mechanism in Delta-Debugging to better support multi-source problem code localization and exploits the differences in floating-point instruction sequences under different compiler optimization options to guide the localization. FI3D is evaluated using 6 applications from the NPB benchmark, 10 programs from the GNU scientific library, and 2 programs from the floatsmith mixed-precision benchmark. Experimental results demonstrate that FI3D successfully locates the 4 applications where PLiner fails and achieves an average 26.8% performance improvement for the 14 cases successfully located by PLiner.
Key words:  compiler optimization  result inconsistency  floating-point instruction difference  Delta-Debugging