본문 바로가기
KERD
논문KCI 등재

Compiler triggered C level error check

1

조회

0

다운로드

0

인용

0

참고문헌

키워드

주제분류컴퓨터학

초록

We describe a technique for automatically proving compiler optimizations sound, meaning that their transformations are always semantics-preserving. As is well known, IR (Intermediate Representation) optimization is an important step in a compiler backend. But unfortunately, it is difficult to detect and debug the IR optimization errors for compiler developers. So, we introduce a C level error check system for detecting the correctness of these IR transformation techniques. In our system, we first create an IR-to-C converter to translate IR to C code before and after each compiler optimization phase, respectively, since our technique is based on the Memory Comparison-based Clone(MeCC) detector which is a tool of detecting semantic equivalency in C level. MeCC accepts only C codes as its input and it uses a path-sensitive semantic-based static analyzer to estimate the memory states at exit point of each procedure, and compares memory states to determine whether the procedures are equal or not. But MeCC cannot guarantee two semantic-equivalency codes always have 100% similarity or two codes with different semantics does not get the result of 100% similarity. To increase the reliability of the results, we describe a technique which comprises how to generate C codes in IR-to-C transformation phase and how to send the optimization information to MeCC to avoid the occurrence of these unexpected problems. Our methodology is illustrated by three familiar optimizations, dead code elimination, instruction scheduling and common sub-expression elimination and our experimental results show that the C level error check system is highly reliable.

Abstract

We describe a technique for automatically proving compiler optimizations sound, meaning that their transformations are always semantics-preserving. As is well known, IR (Intermediate Representation) optimization is an important step in a compiler backend. But unfortunately, it is difficult to detect and debug the IR optimization errors for compiler developers. So, we introduce a C level error check system for detecting the correctness of these IR transformation techniques. In our system, we first create an IR-to-C converter to translate IR to C code before and after each compiler optimization phase, respectively, since our technique is based on the Memory Comparison-based Clone(MeCC) detector which is a tool of detecting semantic equivalency in C level. MeCC accepts only C codes as its input and it uses a path-sensitive semantic-based static analyzer to estimate the memory states at exit point of each procedure, and compares memory states to determine whether the procedures are equal or not. But MeCC cannot guarantee two semantic-equivalency codes always have 100% similarity or two codes with different semantics does not get the result of 100% similarity. To increase the reliability of the results, we describe a technique which comprises how to generate C codes in IR-to-C transformation phase and how to send the optimization information to MeCC to avoid the occurrence of these unexpected problems. Our methodology is illustrated by three familiar optimizations, dead code elimination, instruction scheduling and common sub-expression elimination and our experimental results show that the C level error check system is highly reliable.

참고문헌 (10)

  1. A. Pnueli, "Translation validation, In Tools and Algorithms for Construction and Analysis of Systems, TACAS ’98", Lecture Notes in Computer Science, 1384, pp.151~166 (1998)
  2. George C. Necula, "Translation validation for an optimizing compiler", Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, pp.83~95 (2000)
  3. Credible compilation, "Martin Rinard", Massachusetts Institute of Technology, ~, pp.MIT-LCS-TR-776 (1999)
  4. J. Guttman, "VLISP: a verified implementation of Scheme", Lisp and Symbolic Compucation, 8(1), pp.33~110 (1995)
  5. F. Lockwood Morris, "Advice on structuring compilers and proving them correct", Conference Record of the 1st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (1973)
  6. Jens Knoop, "Optimal code motion: Theory and practice", ACM Transactions on Programming Languages and Systems, 16(4), pp.1117~1155 (1994)
  7. M. Kauffmann, "The Boyer-Moore theorem prover and its interactive enhancement", Computers and Mathematics with Applications, 29(2), pp.27~62 (1995)
  8. Bernhard Steffen, "Generating dataflow analysis algorithms for model specifications", Science of Computer Programming, 21(2), pp.115~139 (1993)
  9. Heejung Kim, "MeCC: Memory Comparison-based Clone Detector", ICSE 2011: The 33rd International Conference on Software Engineering (2011)
  10. M. Ahn, "SoarGen: A user retargetable compiler in the design of embedded systems", 박사, pp.2009

관련 논문AI추천

이 간행물의 다른 논문 (4건)