Retargetable Intermediate Code Optimization System Using Tree Pattern Matching Techniques

트리패턴매칭기법의 재목적 가능한 중간코드 최적화 시스템

  • Published : 1999.08.01

Abstract

ACK generates optimized code using the string pattern matching technique in pattern table generator and peephole optimizer. But string pattern matching method is not effective due to the many comparative actions in pattern selection. We designed and implemented the EM intermediate code optimizer using tree pattern matching algorithm composed of EM tree generator, optimization pattern table generator and tree pattern matcher. Tree pattern matching algorithm practices the pattern matching that centering around root node with refer to the pattern table, with traversing the EM tree by top-down method. As a result, compare to ACK string pattern matching methods, we found that the optimized code effected to pattern selection time, and contributed to improved the pattern selection time by about 10.8%.

ACK에서는 패턴 테이블 생성기와 핍홀 최적화기에서 스트링 패턴 매칭 기법을 이용하여 EM 중간 코드에 대한 최적화 코드를 생성한다. 하지만 이 스트링 패턴 매칭 방법은 패턴 결정 시에 반복적으로 많은 비교 동작이 이루어지므로 비효율적이다. 본 논문은 ACK의 중간 코드 최적화기를 개선하기 위해 EM 트리 생성기, 최적화 패턴 테이블 생성기, 트리 패턴 매칭기로 구성된 트리 패턴 매칭 알고리즘을 이용한 EM 중간 코드 최적화 시스템을 설계하고 구현하였다. 이러한 트리 패턴 매칭 알고리즘은 EM 트리를 하향식으로 순회하면서 트리 구조를 가진 패턴 테이블을 참조하여 루트 노드를 중심으로 패턴 매칭을 수행한다. 트리 패턴 매칭 동작은 궁극적으로 ACK의 스트링 패턴 매칭에 비해 최적화 패턴을 찾는데 걸리는 시간을 평균 10.8% 감소시킬 수 있는 효과를 보였다.

Keywords