CTOS: Compiler Testing for Optimization Sequences of LLVM

CTOS: Compiler Testing for Optimization Sequences of LLVM
复制标题

CTOS:LLVM 优化序列的编译器测试

DOI:
10.1109/tse.2021.3058671
复制
发表时间:
2021-02
期刊:
IEEE Transactions on Software Engineering,Online, DOI: 10.1109/TSE.2021.3058671
影响因子:
--
通讯作者:
Xiaochen Li
Xiaochen Li
中科院分区:
其他
文献类型:
--
作者:
He Jiang;Zhide Zhou;Zhilei Ren;Jingxuan Zhang;Xiaochen Li

文献摘要

参考文献

相似文献

优化序列通常在编译器中用于提高程序的性能,但可能引发严重的编译器错误,例如编译器崩溃。虽然已经开发了许多方法来自动测试编译器,但是在应用任意优化序列时,还没有进行系统的工作来检测编译器错误。为了解决这一问题,由于优化序列和测试程序的数量巨大,需要解决两个主要挑战,即代表性优化序列的获取和代表性测试程序的选择。在本研究中,我们提出了一种基于差分测试的编译器测试方法CTOS,用于检测LLVM优化序列导致的编译器bug。CTOS首先利用Doc2Vec技术将优化序列转换为向量,以同时捕获优化信息及其顺序。其次,在CTOS中提出了一种基于区域图和调用关系的方法来构造测试程序的向量表示,从而可以同时捕获程序的语义和结构信息。然后,利用优化序列的向量表示和测试程序,提出了一种基于“质心”的选择方案来解决上述两个挑战。最后,CTOS将具有代表性的优化序列和测试程序作为输入,用所有具有代表性的优化序列对每个测试程序进行测试。如果有一个输出与给定测试程序的大多数其他输出不同,则认为相应的优化序列会触发编译器错误。我们的评估表明,CTOS显著优于基线,最高可达<inline-formula>< text -math notation="LaTeX">$24.76\% \sim 50.57\%$</ text -math><alternatives><mml:math><mml:mrow><mml: m> 24</mml: m> <mml: m> .</mml: m> .< mml: m> 76</mml: m> <mml: m> %</mml: m> <mml: m> ~ </mml: m> <mml: m> 50</mml: m> <mml: m>。</mml:mo><mml:mn>57</mml:mn><mml:mo>%</mml:mo></mml:mrow></mml:math><inline-graphic xlink:href="jiang-ieq1-3058671.gif"/></alternatives></inline-formula>平均查找bug的能力。在7个月的LLVM评估中,我们报告了5种类型的104个有效漏洞,其中21个已得到确认或修复。其中大多数bug是崩溃bug(57个)和错误代码bug(24个)。47个唯一的优化被确定为错误的,其中15个是与循环相关的优化。
Optimization sequences are often employed in compilers to improve the performance of programs, but may trigger critical compiler bugs, e.g., compiler crashes. Although many methods have been developed to automatically test compilers, no systematic work has been conducted to detect compiler bugs when applying arbitrary optimization sequences. To resolve this problem, two main challenges need to be addressed, namely the acquisition of representative optimization sequences and the selection of representative testing programs, due to the enormous number of optimization sequences and testing programs. In this study, we propose CTOS, a novel compiler testing method based on differential testing, for detecting compiler bugs caused by optimization sequences of LLVM. CTOS first leverages the technique Doc2Vec to transform optimization sequences into vectors to capture the information of optimizations and their orders simultaneously. Second, a method based on the region graph and call relationships is developed in CTOS to construct the vector representations of the testing program, such that the semantics and the structure information of programs can be captured simultaneously. Then, with the vector representations of optimization sequences and testing programs, a “centroid” based selection scheme is proposed to address the above two challenges. Finally, CTOS takes in the representative optimization sequences and testing programs as inputs, and tests each testing program with all the representative optimization sequences. If there is an output that is different from the majority of others of a given testing program, then the corresponding optimization sequence is deemed to trigger a compiler bug. Our evaluation demonstrates that CTOS significantly outperforms the baselines by up to <inline-formula><tex-math notation="LaTeX">$24.76\% \sim 50.57\%$</tex-math><alternatives><mml:math><mml:mrow><mml:mn>24</mml:mn><mml:mo>.</mml:mo><mml:mn>76</mml:mn><mml:mo>%</mml:mo><mml:mo>∼</mml:mo><mml:mn>50</mml:mn><mml:mo>.</mml:mo><mml:mn>57</mml:mn><mml:mo>%</mml:mo></mml:mrow></mml:math><inline-graphic xlink:href="jiang-ieq1-3058671.gif"/></alternatives></inline-formula> in terms of the bug-finding capability on average. Within seven month evaluations on LLVM, we have reported 104 valid bugs within 5 types, of which 21 have been confirmed or fixed. Most of those bugs are crash bugs (57) and wrong code bugs (24). 47 unique optimizations are identified to be faulty and 15 of them are loop related optimizations.
DOI: 10.1109/fccm.2019.00049
发表时间: 2019-01
期刊: 2019 IEEE 27th Annual International Symposium on Field-Programmable Custom Computing Machines (FCCM)
影响因子: --
作者:
Qijing Huang;Ameer Haj-Ali;William S. Moses;J. Xiang;I. Stoica;K. Asanović;J. Wawrzynek
通讯作者: Qijing Huang;Ameer Haj-Ali;William S. Moses;J. Xiang;I. Stoica;K. Asanović;J. Wawrzynek
DOI: 10.1145/2491956.2462173
发表时间: 2013-06
期刊: Proceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation
影响因子: --
作者:
Yang Chen;Alex Groce;Chaoqiang Zhang;Weng-Keen Wong;Xiaoli Z. Fern;E. Eide;J. Regehr
通讯作者: Yang Chen;Alex Groce;Chaoqiang Zhang;Weng-Keen Wong;Xiaoli Z. Fern;E. Eide;J. Regehr
DOI: 10.1145/2771783.2771785
发表时间: 2015-07
期刊: Proceedings of the 2015 International Symposium on Software Testing and Analysis
影响因子: --
作者:
Vu Le;Chengnian Sun;Z. Su
通讯作者: Vu Le;Chengnian Sun;Z. Su
DOI: 10.6028/nist.sp.800-142
发表时间: 2010-10
期刊: --
影响因子: --
作者:
D. R. Kuhn;R. Kacker;Yu Lei
通讯作者: D. R. Kuhn;R. Kacker;Yu Lei
DOI: 10.1145/2628071.2628092
发表时间: 2014-08
期刊: 2014 23rd International Conference on Parallel Architecture and Compilation (PACT)
影响因子: --
作者:
Jason Ansel;Shoaib Kamil;K. Veeramachaneni;Jonathan Ragan-Kelley;Jeffrey Bosboom;Una-May O’Reilly;
通讯作者: Jason Ansel;Shoaib Kamil;K. Veeramachaneni;Jonathan Ragan-Kelley;Jeffrey Bosboom;Una-May O’Reilly;