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 条
  • [21] Weakest Precondition Synthesis for Compiler Optimizations
    Lopes, Nuno P.
    Monteiro, Jose
    VERIFICATION, MODEL CHECKING, AND ABSTRACT INTERPRETATION: (VMCAI 2014), 2014, 8318 : 203 - 221
  • [22] Compiler optimizations for processors with SIMD instructions
    Pryanishnikov, Ivan
    Krall, Andreas
    Horspool, Nigel
    SOFTWARE-PRACTICE & EXPERIENCE, 2007, 37 (01): : 93 - 113
  • [23] Tuning compiler optimizations for simultaneous multithreading
    Lo, JL
    Eggers, SJ
    Levy, HM
    Parekh, SS
    Tullsen, DM
    THIRTIETH ANNUAL IEEE/ACM INTERNATIONAL SYMPOSIUM ON MICROARCHITECTURE, PROCEEDINGS, 1997, : 114 - 124
  • [24] Influence of compiler optimizations on system power
    Kandemir, M
    Vijaykrishnan, N
    Irwin, MJ
    Ye, W
    37TH DESIGN AUTOMATION CONFERENCE, PROCEEDINGS 2000, 2000, : 304 - 307
  • [25] ADVANCED COMPILER OPTIMIZATIONS FOR SPARSE COMPUTATIONS
    BIK, AJC
    WIJSHOFF, HAG
    JOURNAL OF PARALLEL AND DISTRIBUTED COMPUTING, 1995, 31 (01) : 14 - 24
  • [26] COMP: Compiler Optimizations for Manycore Processors
    Song, Linhai
    Feng, Min
    Ravi, Nishkam
    Yang, Yi
    Chakradhar, Srimat
    2014 47TH ANNUAL IEEE/ACM INTERNATIONAL SYMPOSIUM ON MICROARCHITECTURE (MICRO), 2014, : 659 - 671
  • [27] Influence of compiler optimizations on value prediction
    Sato, T
    Hamano, A
    Sugitani, K
    Arita, I
    HIGH-PERFORMANCE COMPUTING AND NETWORKING, 2001, 2110 : 312 - 321
  • [28] Advanced Compiler Optimizations for Sparse Computations
    J Parallel Distrib Comput, (14):
  • [29] Generating Compiler Optimizations from Proofs
    Tate, Ross
    Stepp, Michael
    Lerner, Sorin
    ACM SIGPLAN NOTICES, 2010, 45 (01) : 389 - 402
  • [30] COMPILER OPTIMIZATIONS FOR IMPROVING DATA LOCALITY
    CARR, S
    MCKINLEY, KS
    TSENG, CW
    SIGPLAN NOTICES, 1994, 29 (11): : 252 - 262