Finding Missed Compiler Optimizations by Differential Testing

被引:24
|
作者
Barany, Gergo [1 ]
机构
[1] INRIA, Paris, France
关键词
optimization; differential testing; randomized testing;
D O I
10.1145/3178372.3179521
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Randomized differential testing of compilers has had great success in finding compiler crashes and silent miscompilations. In this paper we investigate whether we can use similar techniques to improve the quality of the generated code: Can we compare the code generated by different compilers to find optimizations performed by one but missed by another? We have developed a set of tools for running such tests. We compile C code generated by standard random program generators and use a custom binary analysis tool to compare the output programs. Depending on the optimization of interest, the tool can be configured to compare features such as the number of total instructions, multiply or divide instructions, function calls, stack accesses, and more. A standard test case reduction tool produces minimal examples once an interesting difference has been found. We have used our tools to compare the code generated by GCC, Clang, and CompCert. We have found previously unreported missing arithmetic optimizations in all three compilers, as well as individual cases of unnecessary register spilling, missed opportunities for register coalescing, dead stores, redundant computations, and missing instruction selection patterns.
引用
收藏
页码:82 / 92
页数:11
相关论文
共 50 条
  • [1] Detection of Optimizations Missed by the Compiler
    Zhang, Yi
    PROCEEDINGS OF THE 31ST ACM JOINT MEETING EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING, ESEC/FSE 2023, 2023, : 2192 - 2194
  • [2] Differential Testing of a Verification Framework for Compiler Optimizations (Case Study)
    Utting, Mark
    Webb, Brae J.
    Hayes, Ian J.
    2023 IEEE/ACM 11TH INTERNATIONAL CONFERENCE ON FORMAL METHODS IN SOFTWARE ENGINEERING, FORMALISE, 2023, : 66 - 75
  • [3] Evaluating the Effects of Compiler Optimizations on Mutation Testing at the Compiler IR Level
    Harir, Farah
    Shi, August
    Converse, Hayes
    Khurshid, Sarfraz
    Marinov, Darko
    2016 IEEE 27TH INTERNATIONAL SYMPOSIUM ON SOFTWARE RELIABILITY ENGINEERING (ISSRE), 2016, : 105 - 115
  • [4] The Road Not Taken: Exploring Alias Analysis Based Optimizations Missed by the Compiler
    Chitre, Khushboo
    Kedia, Piyus
    Purandare, Rahul
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2022, 6 (OOPSLA):
  • [5] Finding Missed Optimizations through the Lens of Dead Code Elimination
    Theodoridis, Theodoros
    Rigger, Manuel
    Su, Zhendong
    ASPLOS '22: PROCEEDINGS OF THE 27TH ACM INTERNATIONAL CONFERENCE ON ARCHITECTURAL SUPPORT FOR PROGRAMMING LANGUAGES AND OPERATING SYSTEMS, 2022, : 697 - 709
  • [6] Compiler Optimizations for OpenMP
    Doerfert, Johannes
    Finkel, Hal
    EVOLVING OPENMP FOR EVOLVING ARCHITECTURES, 2018, 11128 : 113 - 127
  • [7] COMPILER OPTIMIZATIONS FOR THE WAM
    TURK, AK
    LECTURE NOTES IN COMPUTER SCIENCE, 1986, 225 : 657 - 662
  • [8] Phase Directed Compiler Optimizations
    Jain, Era
    Roy, Subhajit
    PROCEEDINGS OF 2016 IEEE 23RD INTERNATIONAL CONFERENCE ON HIGH PERFORMANCE COMPUTING (HIPC), 2016, : 270 - 279
  • [9] Incremental Verification of Compiler Optimizations
    Fedyukovich, Grigory
    Gurfinkel, Arie
    Sharygina, Natasha
    NASA FORMAL METHODS, NFM 2014, 2014, 8430 : 300 - 306
  • [10] GRAPHICAL VISUALIZATION OF COMPILER OPTIMIZATIONS
    BOYD, MR
    WHALLEY, DB
    JOURNAL OF PROGRAMMING LANGUAGES, 1995, 3 (02): : 69 - 94