Finding Missed Compiler Optimizations by Differential Testing

被引:26
|
作者
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 条
  • [41] Evolutionary Generative Fuzzing for Differential Testing of the Kotlin Compiler
    Georgescu, Calin
    Olsthoorn, Mitchell
    Derakhshanfar, Pouria
    Akhin, Marat
    Panichella, Annibale
    COMPANION PROCEEDINGS OF THE 32ND ACM INTERNATIONAL CONFERENCE ON THE FOUNDATIONS OF SOFTWARE ENGINEERING, FSE COMPANION 2024, 2024, : 197 - 207
  • [42] Simplification of array access patterns for compiler optimizations
    Paek, Y
    Hoeflinger, J
    Padua, D
    ACM SIGPLAN NOTICES, 1998, 33 (05) : 60 - 71
  • [43] Locality-Based Optimizations in the Chapel Compiler
    Kayraklioglu, Engin
    Ronaghan, Elliot
    Ferguson, Michael P.
    Chamberlain, Bradford L.
    LANGUAGES AND COMPILERS FOR PARALLEL COMPUTING (LCPC 2021), 2022, 13181 : 3 - 17
  • [44] Automatic Selection of Compiler Optimizations by Machine Learning
    Peker, Melih
    Ozturk, Ozcan
    Yildirim, Suleyman
    Ozturk, Mahiye Uluyagmur
    2023 31ST SIGNAL PROCESSING AND COMMUNICATIONS APPLICATIONS CONFERENCE, SIU, 2023,
  • [45] Analyzing the Effects of Compiler Optimizations on Application Reliability
    Demertzi, Melina
    Annavaram, Murali
    Hall, Mary
    2011 IEEE INTERNATIONAL SYMPOSIUM ON WORKLOAD CHARACTERIZATION (IISWC), 2011, : 184 - 193
  • [46] The effects of compiler optimizations in face recognition system
    Daud, Shuhaizar
    Khalib, Zahereel Ishwar Abdul
    Ahmad, R. Badlishah
    Juhari, M. Rizon
    2008 INTERNATIONAL CONFERENCE ON COMPUTER AND COMMUNICATION ENGINEERING, VOLS 1-3, 2008, : 833 - +
  • [47] Enhancing compiler techniques for memory energy optimizations
    Zambreno, J
    Kandemir, MT
    Choudhary, A
    EMBEDDED SOFTWARE, PROCEEDINGS, 2002, 2491 : 364 - 381
  • [48] Microarchitecture sensitive empirical models for compiler optimizations
    Vaswani, Kapil
    Thazhuthaveetil, Matthew J.
    Srikant, Y. N.
    Joseph, P. J.
    CGO 2007: INTERNATIONAL SYMPOSIUM ON CODE GENERATION AND OPTIMIZATION, 2007, : 131 - +
  • [49] Assessing the Impact of Compiler Optimizations on GPUs Reliability
    Dos Santos, Fernando Fernandes
    Carro, Luigi
    Vella, Flavio
    Rech, Paolo
    ACM TRANSACTIONS ON ARCHITECTURE AND CODE OPTIMIZATION, 2024, 21 (02)
  • [50] Automated Programmable Control and Parameterization of Compiler Optimizations
    Yi, Qing
    2011 9TH ANNUAL IEEE/ACM INTERNATIONAL SYMPOSIUM ON CODE GENERATION AND OPTIMIZATION (CGO), 2011, : 97 - 106