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 条
  • [31] Effect of compiler optimizations on memory energy
    Kim, HS
    Irwin, MJ
    Vijaykrishnan, N
    Kandemir, M
    2000 IEEE WORKSHOP ON SIGNAL PROCESSING SYSTEMS: DESIGN AND IMPLEMENTATION, 2000, : 663 - 672
  • [32] COMPILER OPTIMIZATIONS FOR ELIMINATING BARRIER SYNCHRONIZATION
    TSENG, CW
    SIGPLAN NOTICES, 1995, 30 (08): : 144 - 155
  • [33] Influence of compiler optimizations on system power
    Kandemir, M
    Vijaykrishnan, N
    Irwin, MJ
    Ye, W
    IEEE TRANSACTIONS ON VERY LARGE SCALE INTEGRATION (VLSI) SYSTEMS, 2001, 9 (06) : 801 - 804
  • [34] A Framework for Formal Verification of Compiler Optimizations
    Mansky, William
    Gunter, Elsa
    INTERACTIVE THEOREM PROVING, PROCEEDINGS, 2010, 6172 : 371 - 386
  • [35] A compiler framework for speculative analysis and optimizations
    Lin, J
    Chen, T
    Hsu, WC
    Ju, RDC
    Ngai, TF
    Yew, PC
    Chan, S
    ACM SIGPLAN NOTICES, 2003, 38 (05) : 289 - 299
  • [36] Tuning Compiler Optimizations for Simultaneous Multithreading
    Jack L. Lo
    Susan J. Eggers
    Henry M. Levy
    Sujay S. Parekh
    Dean M. Tullsen
    International Journal of Parallel Programming, 1999, 27 : 477 - 503
  • [37] GLOBAL OPTIMIZATIONS IN A PROLOG COMPILER FOR THE TOAM
    ZHOU, NF
    JOURNAL OF LOGIC PROGRAMMING, 1993, 15 (04): : 275 - 294
  • [38] Tuning compiler optimizations for simultaneous multithreading
    Lo, JL
    Eggers, SJ
    Levy, HM
    Parekh, SS
    Tulsen, DM
    INTERNATIONAL JOURNAL OF PARALLEL PROGRAMMING, 1999, 27 (06) : 477 - 503
  • [39] Generating Compiler Optimizations from Proofs
    Tate, Ross
    Stepp, Michael
    Lerner, Sorin
    POPL'10: PROCEEDINGS OF THE 37TH ANNUAL ACM SIGPLAN-SIGACT SYMPOSIUM ON PRINCIPLES OF PROGRAMMING LANGUAGES, 2010, : 389 - 402
  • [40] A Study of Conflicting Pairs of Compiler Optimizations
    Ben Asher, Yosi
    Haber, Gadi
    Stein, Esti
    2017 IEEE 11TH INTERNATIONAL SYMPOSIUM ON EMBEDDED MULTICORE/MANY-CORE SYSTEMS-ON-CHIP (MCSOC 2017), 2017, : 52 - 58