Prolog Tailoring Technique on Epilog Tailored Procedures

에필로그 테일러된 프로시저를 위한 프롤로그 테일러링 기법

  • 지윤찬 (인하대학교 전자계산공학과) ;
  • 김기창 (인하대학교 전자계산공학과)
  • Published : 1998.05.01

Abstract

Prolog tailoring technique, an optimization method to improve the execution speed of a procedure, is proposed in this paper. When a procedure is frequently and repeatedly called and the machine has a lot of callee-saved registers, optimizing prolog and epilog can become an important step of optimization. Epilg tailoring supported by IBM XL C Compiler has been known to improve procedure's execution speed by reducing register restore instructions on execution paths, but no algorithms for prolog tailoring has been proposed yet. The prolog generated by the prolog tailoring algorithm proposed in this paper executes considerably smaller number of register save instructions at run-time. This means the total number of instructions to be executed is decreased resulting in an improvement on the procedure's execution speed. To maintain the correctness of code, prolog code should not be inserted inside diamond structures of loop structures. This paper proposes a prolog tailoring technique which generates register save instructions at the best position in a control flow graph while not allowing the insertion of any prolog code inside diamond structures of loop structures.

본 논문은 컴파일러에 의해 생성된 목적 코드상의 프로시저의 수행 속도를 향상시키기 위한 방안으로, 프롤로그 테일러링 알고리즘을 제안한다. 레지스터의 수가 많은 기계에서 반복 수행되는 프로시저의 경우, 프롤로그와 에필로그에서 실행되는 레지스터 저장 및 복원 명령어를 줄이는 것은 프로시저 실행 속도 향상의 주요 작업이 된다. IBM XL C 컴파일러에서 제공되는 에필로그 테일러링은 실행 경로상의 레지스터 복원 명령어를 줄임으로써, 프로시저 성능 향상에 기여해왔으나, 프롤로그 테일러링에 대한 구체적 알고리즘은 현재 제안되어 있지 않다. 본 논문이 제안하는 알고리즘에 의해 생성된 프롤로그는 각각의 실행 경로에 대해 현저히 감소된 수의 레지스터 저장 명령을 실행하도록 함으로써, 프로시저의 실행 속도를 개선시킨다. 테일러된 프롤로그를 갖는 프로시저가 바르게 실행되기 위해서는, 다이아몬드 구조나 반복 구조 내분에 레지스터 저장 명령을 생성해서는 안된다. 그러므로, 본 논문은 다이아몬드 구조나 반복 구조 내부가 아닌 최적의 위치에 레지스터 저장 명령을 생성하는 알고리즘을 제안한다.

Keywords