Conditional Branch Optimization in the Compilers for Superscalar Processors

수퍼스칼라 프로세서를 위한 컴파일러에서 조건부 분기의 최적화

  • 김명호 (동아대학교 컴퓨터공학과) ;
  • 최완 (한국전자통신연구소)
  • Published : 1995.03.01

Abstract

In this paper, a technique for eliminating conditional branches in the compilers for superscalar processors is presented. The technique consists of three major steps. The first step transforms conditional branches into equivalent expressions using algebraic laws. The second step searches all possible instruction sequences for those expressions using GSO of Granlund/Kenner. Finally an optimal sequence that has the least dynamic count for the target superscalar processor is selected from the GSO output. Experiment result shows that for each conditional branch is the input program matched by one of the optimization patterns, the proposed technique outperforms more than 25% speedup of execution time over the original code when the GNU C compiler and the SuperSPARC processor are used.

본 논문에서는 수퍼스칼라 프로세서를 위한 컴파일러에서 조건부 분기 명령을 제 거하는 최적화 기법을 제시하였다. 분기를 제거하는 단계적 방법으로 먼저 대수적 규 칙을 사용하여 분기를 산술식의 형태로 변형하고, 그 식에 대응하는 명령 수순을 Granlund/Kenner의 GSO를 사용하여 완전 탐색한 후 목적 프로세서에서 실행시 최소의 동적 계수를 갖는 명령 수순을 선택하였다. 제안한 분기 최적화 기법을 SuperSPARC 프로세서와 GNU C 컴파일러를 사용하여 실험한 결과 입력 프로그램에서 최적화 패턴 과 대응하는 조건부 분기의 경우 원래의 컴파일러가 생성하는 최적 코드 수순에 비하 여 25% 이상의 추가적인 수행시간 개선 효과를 얻을 수 있었다.

Keywords