Code Optimization Using Pattern Table

패턴 테이블을 이용한 코드 최적화

  • 윤성림 (동국대학교 대학원 컴퓨터공학과) ;
  • 오세만 (한국정보처리학회 게임연구회)
  • Published : 2005.11.01

Abstract

Various optimization techniques are deployed in the compilation process of a source program for improving the program's execution speed and reducing the size of the source code. Of the optimization pattern matching techniques, the string pattern matching technique involves finding an optimal pattern that corresponds to the intermediate code. However, it is deemed inefficient due to excessive time required for optimized pattern search. The tree matching pattern technique can result in many redundant comparisons for pattern determination, and there is also the disadvantage of high cost involved in constructing a code tree. The objective of this paper is to propose a table-driven code optimizer using the DFA(Deterministic Finite Automata) optimization table to overcome the shortcomings of existing optimization techniques. Unlike other techniques, this is an efficient method of implementing an optimizer that is constructed with the deterministic automata, which determines the final pattern, refuting the pattern selection cost and expediting the pattern search process.

원시 프로그램에 대한 컴파일 과정 중 최적화 단계에서는 프로그램의 실행 속도를 개선시키고 코드 크기를 줄일 수 있는 다양한 최적화 기법을 수행한다[17]. 최적화 패턴 매칭 방법 중 스트링 패턴 매칭 방법은 중간 코드에 대응하는 최적의 패턴을 찾기 위한 방법으로 과다한 최적화 패턴 검색 시간으로 비효율적이다. 트리 패턴 매칭은 패턴 결정시 중복 비교가 발생할 수 있으며, 코드의 트리 구성에 많은 비용이 드는 단점을 가지고 있는 방법들이다[16,18]. 본 논문에서는 기존의 최적화 방법들의 단점을 극복하기 위한 방법으로 DFA (Deterministic Finite Automate) 최적화 테이블을 이용한 코드 최적화기를 제안하려고 한다. 이 방법은 다른 패턴 매칭 기법보다 결정적인 오토마타(Automata)로 구성하기 때문에 비용은 적어지고, 오토마타를 통해 결정적으로 패턴이 확정됨에 따른 패턴 선택 비용이 줄어들며, 최적화 패턴 검객 시간도 빨라지는 효율적인 방법의 최적화기이다.

Keywords