KR100829167B1 - Method of reducing data dependence for software pipelining - Google Patents

Method of reducing data dependence for software pipelining Download PDF

Info

Publication number
KR100829167B1
KR100829167B1 KR1020060111260A KR20060111260A KR100829167B1 KR 100829167 B1 KR100829167 B1 KR 100829167B1 KR 1020060111260 A KR1020060111260 A KR 1020060111260A KR 20060111260 A KR20060111260 A KR 20060111260A KR 100829167 B1 KR100829167 B1 KR 100829167B1
Authority
KR
South Korea
Prior art keywords
instruction
highest priority
priority path
path
dependence
Prior art date
Application number
KR1020060111260A
Other languages
Korean (ko)
Inventor
백윤흥
조두산
어강령
Original Assignee
재단법인서울대학교산학협력재단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 재단법인서울대학교산학협력재단 filed Critical 재단법인서울대학교산학협력재단
Priority to KR1020060111260A priority Critical patent/KR100829167B1/en
Application granted granted Critical
Publication of KR100829167B1 publication Critical patent/KR100829167B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3836Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution
    • G06F9/3838Dependency mechanisms, e.g. register scoreboarding

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Advance Control (AREA)

Abstract

A method for reducing data dependence in software pipelining is provided to improve the performance of a pipelining loop of a DSP(Digital Signal Processor) and utilize resources of the DSP fully by reducing the data dependence in iterated pipelining. All routes is searched from a data dependence graph made for machine language of a target loop code and a priority route forming the longest route, which determines an execution time of the loop, is found from the searched routes(S200). An instruction having the shortest priority route is found as an instruction to reduce dependence by forming a replaceable instruction table for the priority routes and searching the priority route in reference to the replaceable instruction table(S204). Dependence relation is changed by replacing the found instruction to reduce the dependence with a replaceable instruction(S206). The dependence graph is reformed for the changed loop code and a routine is returned to a first stage(S208). The routine is terminated when the instruction to reduce the dependence is not found in the priority route.

Description

소프트웨어 파이프라이닝의 데이터 의존도 완화 방법 {Method of reducing data dependence for software pipelining}Method of reducing data dependence for software pipelining

도 1은 고속 푸리에 변환 알고리즘 C 소스 코드의 최하위 루프의 예시도, 1 is an illustration of the lowest loop of the fast Fourier transform algorithm C source code,

도 2는 도 1의 코드를 멀티이슈 DSP중 대표적인 스타코어(StarCore) 상용 컴파일러로 컴파일하여 생성된 기계어를 도시한 도면,FIG. 2 is a diagram illustrating machine language generated by compiling the code of FIG. 1 with a representative StarCore commercial compiler among multi-issue DSPs; FIG.

도 3은 도 2에 나타낸 기계어의 의존도 그래프를 그릴 때 생성되는 최우선 경로를 도시한 도면,3 is a view showing the highest priority path generated when the dependency graph of the machine word shown in FIG.

도 4a~c는 상기 도 1~3에 예시한 루프에 대해서 클로닝에 의하여 최우선 경로를 제거하는 절차를 도시한 도면,4A to 4C illustrate a procedure of removing a highest priority path by cloning for the loop illustrated in FIGS.

도 5는 하프레이트 GSM 알고리즘 C 소스코드의 최하위 루프중 하나의 예시도,5 is an illustration of one of the lowest loops of the half-rate GSM algorithm C source code,

도 6은 도 5의 코드를 멀티이슈 DSP중 대표적인 스타코어 상용 컴파일러로 컴파일하여 생성된 기계어를 도시한 도면,FIG. 6 is a diagram illustrating machine language generated by compiling the code of FIG. 5 with a representative StarCore commercial compiler among multi-issue DSPs; FIG.

도 7은 도 6에 나타낸 기계어의 의존도 그래프를 그릴 때 생성되는 최우선 경로를 도시한 도면,FIG. 7 is a diagram illustrating a highest priority path generated when a dependency graph of the machine word shown in FIG. 6 is drawn;

도 8a~c는 상기 도 5~7에 예시한 루프에 대해서 디스맨틀링에 의하여 최우선 경로를 줄이는 절차를 도시한 도면,8A to 8C illustrate a procedure of reducing the highest priority path by demantling for the loops illustrated in FIGS.

도 9는 본 발명을 적용하기 위한 전체 절차를 도시한 순서도,9 is a flowchart showing the overall procedure for applying the present invention;

도 10은 본 발명을 적용하기 위해 이용하는 대체 명령어를 도시한 도면.10 illustrates alternative instructions used to apply the present invention.

본 발명은 디지털신호처리기(DSP)의 파이프라이닝 루프의 성능을 개선시키는 방법에 관한 것으로서, 더욱 상세하게는, DSP에 소프트웨어 파이프라이닝을 적용하기 이전에 데이터 의존도 그래프상의 최우선 경로의 길이를 줄임으로써 데이터 의존도를 완화하여 루프의 성능을 개선시키는 방법에 관한 것이다.The present invention relates to a method for improving the performance of a pipelining loop of a digital signal processor (DSP), and more particularly, by reducing the length of the highest priority path on a data dependency graph before applying software pipelining to a DSP. A method of improving the performance of a loop by mitigating dependencies.

전자계산기 구조에 있어서, 일반적으로 중앙처리장치(CPU)는 메모리에 저장되어 있는 데이터를 이용하여 연산 및 기설정된 동작을 수행한다. 상기 중앙처리장치는 메모리에 저장되어 있는 데이터를 직접 이용하여 기설정된 동작을 수행하는 것이 아니라, 중앙처리장치와 연결되어 있는 레지스터에 기록되어 있는 데이터를 이용하여 기설정된 동작을 수행한다. 즉, 중앙처리장치가 메모리에 저장되어 있는 데이터를 이용하기 위해서는, 메모리에 저장되어 있는 데이터를 레지스터에 기록(write)하는 과정이 선행되어야 한다. 또한, 레지스터에 기록되어 있는 데이터를 이용하여 기설정된 동작을 수행한 중앙처리장치는 수행한 결과 데이터를 레지스터에 기록한다. 레지스터에 기록된 결과데이터는 주어진 명령에 의해 메모리에 저장된다. 이와 같이 중앙처리장치가 메모리에 저장되어 있는 데이터를 이용하기 위해서는 레지스터를 활용하여야 하는 것이다.In the electronic calculator structure, the CPU generally performs arithmetic operations and predetermined operations by using data stored in a memory. The CPU does not perform a predetermined operation by directly using data stored in a memory, but performs a predetermined operation by using data recorded in a register connected to the CPU. That is, in order for the CPU to use the data stored in the memory, the process of writing the data stored in the memory to a register must be preceded. In addition, the CPU which performs a predetermined operation using the data recorded in the register writes the result data into the register. The result data written to the register is stored in the memory by the given instruction. In this way, the CPU must utilize registers in order to use the data stored in the memory.

프로그램의 명령어(instruction) 사이의 의존도(dependence) 관계는 같은 이름의 레지스터들과 메모리들을 이용하는 명령어들 사이에서 생성된다. 특정 명령어의 결과값이 레지스터에 작성되어야 다음 명령어에서 그 값을 이용할 수 있는 순서가 결정되기 때문이다. A dependency relationship between the instructions of a program is created between instructions using registers and memories of the same name. This is because the result of a specific instruction must be written to a register to determine the order in which the value is available to the next instruction.

한편, 멀티이슈 디지털신호처리를 위시한 다양한 디지털신호처리기(DSP)에 적용되는 기법인 소프트웨어 파이프라이닝(pipelining)은, 루프를 구성하는 각 반복(iteration) 사이의 명령어들이 의존도를 구성하지 않는 범위에서 리소스가 허용하는 범위까지 반복들을 중첩시킴으로서 루프의 성능을 개선시키는 기법이다. 그런데, 레지스터가 다음 반복시 다시 사용되는 경우에는 두 반복들 사이에 필연적으로 의존도 관계가 형성되는데, 이것은 소프트웨어 파이프라이닝 기법을 제약하는 주요 요인으로 작용한다. Meanwhile, software pipelining, a technique applied to various digital signal processors (DSPs) including multi-issue digital signal processing, is a resource in a range in which instructions between each iteration of a loop do not form a dependency. This technique improves the performance of the loop by nesting the iterations to the extent that is allowed. However, if a register is used again in the next iteration, a dependency relationship is inevitably formed between the two iterations, which acts as a major factor that restricts the software pipelining technique.

상기 문제점을 해결하기 위하여, 본 발명자들은 소프트웨어 파이프라이닝을 적용하기 전에 반복간의 의존도 관계를 완화하는 방안을 연구하여 본 발명을 완성하였다. 따라서 본 발명의 목적은 파이프라이닝 반복간의 의존도를 완화함으로써 루프의 성능을 보다 개선시키고 디지털신호처리기(특히, 고성능 멀티이슈 DSP)의 리소스를 충분히 활용하도록 하는 방법을 제공하는 것이다. In order to solve the above problem, the present inventors have completed the present invention by studying a method for alleviating the dependency relationship between iterations before applying software pipelining. Accordingly, it is an object of the present invention to provide a method that further improves the performance of loops by mitigating the dependencies between pipelining iterations and makes full use of the resources of digital signal processors (especially high performance multi-issue DSPs).

상기 목적을 달성하기 위하여, 본 발명에 따른, 소프트웨어 파이프라이닝의 대상이 되는 응용 프로그램의 루프 코드에 있어서의 데이터 의존도를 완화하는 방 법은, In order to achieve the above object, according to the present invention, a method for mitigating data dependence in loop code of an application program subject to software pipelining,

1) 대상이 되는 루프 코드에 대한 기계어에 대해서 작성된 데이터 의존도 그래프를 대상으로 모든 경로를 검색하고, 이 중 루프의 실행시간을 결정 짓는 가장 긴 경로를 구성하는 최우선 경로를 찾아내는 단계;1) searching all the paths of the data dependency graph created for the machine language for the target loop code, and finding the highest priority path constituting the longest path that determines the execution time of the loop;

2) 상기 최우선 경로들을 대상으로 교체 가능 명령어 테이블을 구성하고, 교체 가능 명령어 테이블을 참조하여 최우선 경로를 검색함으로써, 최우선 경로 길이가 가장 작은 명령어를 의존도 완화 가능한 명령어로서 찾아내는 단계;2) constructing a replaceable instruction table for the highest priority routes and searching for the highest priority route by referring to the replaceable instruction table, thereby finding an instruction having the smallest priority path length as an instruction that can alleviate dependencies;

3) 상기 단계에서 찾은 완화 가능 대상 명령어를 교체명령어로서 교체하여 의존 관계를 변경하는 단계를 포함하여 구성된다.3) changing the dependency by replacing the mitigable target instruction found in the step as a replacement instruction.

또한, 본 발명에는, 상기 3)단계에서 변경된 루프코드를 대상으로 의존도 그래프를 재구성하는 단계가 추가로 포함되어, 다시 최초의 단계(즉, 1)단계)로 되돌아가 이후의 단계를 반복하는 것을 특징으로 한다. 그리고, 상기 2)단계에서 최우선 경로에 의존도 완화 가능한 명령어가 없으면 이후의 절차를 종료한다. In addition, the present invention further includes a step of reconstructing the dependency graph with respect to the loop code changed in step 3), and then returning to the first step (ie, step 1) again and repeating the subsequent steps. It features. In step 2), if there is no command that can alleviate the dependency on the highest priority path, the subsequent procedure is terminated.

상기 3)단계에서, 최우선 경로 길이가 가장 작은 명령어를 찾는데 있어서, (본래 최우선 경로 길이) - (재구성 최우선 경로 길이)=(이득)이 가장 큰 명령어를 최종 완화 가능 명령어로서 결정하는 것이 바람직하다. In step 3), in order to find the instruction having the smallest priority path length, it is preferable to determine the instruction having the greatest (originally the priority path length) minus the (reconstruction priority path length) = (gain) as the final mitigable instruction.

그리고, 상기 2)단계는 상기 교체가능 명령어 테이블을 구성하는 시점에서 파이프라이닝을 수행하는 디지털신호처리기 명령어집합 구조에 따라 의미론적으로 동일한 명령어들의 집합을 선정하는 단계와, 상기 집합을 구성하고 있는 각 명령어 들의 상호 관계에 따라 교체 명령어의 증감을 결정하는 단계와, 상기 증감 크기에 따라 리소스에 관한 이득을, 이득 크기 계산에 반영하는 단계를 포함할 수 있다. Step 2) includes selecting a set of semantically identical instructions according to a structure of an instruction set of a digital signal processor performing pipelining at the time of constructing the replaceable instruction table, and configuring each of the sets. Determining the increase and decrease of the replacement command according to the interrelationship of the instructions, and reflecting the gain on the resource according to the increase and decrease magnitude in the gain size calculation.

또는, 상기 2) 단계에서 교체가능 명령어 테이블에 따라 최우선 경로를 순차적으로 검색함에 있어서, 검색되는 각 시점에서 해당 명령어를 포함하는 모든 경로를 함께 레코드함으로써, 최종 완화 명령어를 교체 명령어로 교체하여 의존도 관계를 완화하는 시점에서 다른 경로 길이를 늘이는 반작용 효과를 발생시키는 경우 이를 최우선 경로 선정을 위한 이득 계산에 반영하도록 할 수 있다.Alternatively, in sequentially searching the highest priority paths according to the replaceable instruction table in step 2), all the paths including the corresponding instructions are recorded together at each time point in which they are searched, thereby replacing the final mitigation instruction with the replacement instruction and relying on the dependency relationship. In the case of mitigating a reaction effect that increases the length of another path at the time of mitigation, it can be reflected in the gain calculation for the highest priority path selection.

이하, 첨부된 도면들을 참조하여 본 발명을 상세하게 설명하기로 한다.Hereinafter, with reference to the accompanying drawings will be described in detail the present invention.

도 1~3은 본 발명에 따른 멀티이슈 디지털신호처리용 소프트웨어 파이프라이닝 전처리 방법, 즉 데이터 의존도 완화방법의 대상을 나타내는데, 도 1은 C로 작성된 고속 푸리에 변환 알고리즘의 소스 코드의 최하위 루프를 예시하고 있고, 도 2는 도 1의 소스 코드를 멀티이슈 DSP중 대표적인 스타코어(StarCore) 상용 컴파일러로 컴파일하여 생성된 기계어를 도시하며, 도 3은 도 2에 예시한 기계어의 의존도 그래프를 그릴 때 생성되는 최우선 경로를 도시한다. 도 4a~c는 본 발명에 따른 파이프라이닝 전처리 방법의 일특징인 클로닝법(cloning)을 이용하여 도 1의 고속 푸리에 변환 알고리즘 코드에 대한 최우선 경로를 감소시키는 과정을 설명하기 위한 것이다. 1 to 3 illustrate the object of the software pipelining preprocessing method for multi-issue digital signal processing, that is, the data dependency mitigation method, according to the present invention. FIG. 1 illustrates the lowest loop of the source code of the fast Fourier transform algorithm written in C. FIG. 2 illustrates a machine language generated by compiling the source code of FIG. 1 with a representative StarCore commercial compiler among multi-issue DSPs, and FIG. 3 is generated when a dependency graph of the machine language illustrated in FIG. 2 is drawn. The highest priority path is shown. 4A to 4C illustrate a process of reducing the highest priority path for the fast Fourier transform algorithm code of FIG. 1 using cloning, which is a feature of the pipelining preprocessing method according to the present invention.

한편, 도 5는 C로써 작성된 하프레이트(half rate) GSM 알고리즘 소스 코드의 최하위 루프중 하나를 예시하고 있고, 도 6은 도 5의 코드를 멀티이슈 DSP중 대 표적인 스타코어 상용 컴파일러로 컴파일하여 생성된 기계어를 도시하며, 도 7은 도 6에 나타낸 기계어의 의존도 그래프를 그릴 때 생성되는 최우선 경로를 도시한다. 도 8a~c는 상기 도 5~7에 예시한 하프레이트 GSM 코드에 대해서 디스맨틀링(dismantling)법에 의하여 최우선 경로를 감소시키는 절차를 도시한다.5 illustrates one of the lowest loops of a half-rate GSM algorithm source code written in C, and FIG. 6 compiles the code of FIG. 5 into a representative Starcore commercial compiler among multi-issue DSPs. The generated machine word is shown, and FIG. 7 shows the highest priority path generated when the dependency graph of the machine word shown in FIG. 6 is drawn. 8A to 8C illustrate a procedure of reducing the highest priority path by the dismantling method for the half-rate GSM code illustrated in FIGS. 5 to 7.

이하, 상기 도 1과 5에서 예시한 소스 코드에 대해서 본 발명에 따른 데이터 의존도 방법을 실현하기 위하여 최우선 경로 크기를 감소시키는 과정에 대해 개략적으로 알아보기로 한다. 이 과정은 도 9의 순서대로 진행된다. 도 9를 참조하여 설명한다.Hereinafter, a process of reducing the first priority path size in order to realize the data dependency method according to the present invention with respect to the source code illustrated in FIGS. 1 and 5 will be described. This process is performed in the order of FIG. It demonstrates with reference to FIG.

우선 도 2의 기계어를 대상으로 의존도 그래프를 구성한다. 도 2와 도 6의 기계어를 통하여 구성되는 의존도 그래프를 대상으로 도 3에서와 같은 최우선 경로를 찾아낸다(S200 단계).First, a dependency graph is constructed for the machine language of FIG. The highest priority path as shown in FIG. 3 is found based on the dependency graph formed through the machine words of FIGS. 2 and 6 (S200).

다음에, 최우선 경로를 구성하는 명령어들 중에서 의존도 구성을 완화 가능한 명령어로 대체할 수 있는 명령어들을 교체 명령어 테이블(도 10 참조)과 비교하여 검색한다(S202 단계). 만일 최우선 경로에 완화 가능 명령어가 없으면 진행과정을 종료한다.Next, among the instructions constituting the highest priority path, instructions that can replace the dependency configuration with a relaxed instruction are searched in comparison with the replacement instruction table (see FIG. 10) (step S202). If there is no mitigable instruction in the top path, the process ends.

각 완화 가능한 명령어들 중에서 명령어를 교체 명령어 테이블과 교체하였을 때 구성되는 의존도 그래프로부터 재구성되는 최우선 경로 길이가 가장 작은 명령어, 즉, 이득(본래 최우선 경로 길이 - 재구성 최우선 경로 길이)이 가장 큰 명령어를 최종 완화 명령어로 선택한다(S204 단계). 이에 대해서는 차후에 상세하게 설 명한다.Of each of the mitigable instructions, the instruction with the smallest priority path length reconstructed from the dependency graph constructed when the instruction is replaced with the replacement instruction table, that is, the instruction with the highest gain (originally the highest priority path length minus the reconstruction highest path length) Select to relax command (step S204). This will be explained in detail later.

선택된 최종 완화 명령어를 교체명령어로 교체하여 의존 관계를 목적한 모양으로 변경한다(S206 단계). 이때에는 전체 루프 코드의 의미론적 동질성을 유지하도록 한다. 이와 관련된 클로닝은 도 4를 통해, 디스맨틀링은 도 8을 통해 상세하게 설명하기로 한다.The selected final relaxation instruction is replaced with a replacement instruction to change the dependency to the desired shape (step S206). In this case, the semantic homogeneity of the entire loop code is maintained. Cloning associated with this will be described in detail with reference to FIG. 4 and dismantling through FIG. 8.

변경된 루프코드를 대상으로 의존도 그래프를 재구성한 다음에, 다시 S200단계로 되돌아가 반복한다(S208 단계).After reconstructing the dependency graph for the changed loop code, the process returns to step S200 and repeats it (step S208).

이제, 도면을 참조하여 실제적인 예를 들어 상기 각 과정에 대해서 구체적으로 설명한다. 우선, 클로닝 기법을 이용한 최우선 경로 감소 과정에 대한 설명이다. 클로닝은 참 혹은 역 의존일 경우 최우선 경로를 구성하게 하는 레지스터 이름을 사용 가능한 다른 레지스터로 변경하여 최우선 경로를 제거하는 기법이다. 이때 루프 코드의 의미론적 동일성을 유지하기 위하여 루프가 시작되기 이전 코드블럭에 새로운 레지스터에 기존 레지스터 값을 반드시 미리 복사하도록 한다. Now, with reference to the drawings will be described in detail for each of the above-described practical example. First, a description is given of the first priority path reduction process using the cloning technique. Cloning is a technique that removes the highest priority path by changing the register name to another available register if it is true or reverse dependent. At this time, in order to maintain the semantic identity of the loop code, the existing register value must be copied to the new register in the code block before the loop starts.

고성능 멀티이슈 DSP인 "스타코어 1400"에서 도 2에 예시한 기계어를 동작시킨다고 가정하자. 스타코어 1400은 한 번에 6개의 명령어를 실행하는 것이 가능한데, 이 6개 명령어는 4개의 산술논리부(Arithmetic Logical Unit: ALU) 명령어와 2개의 주소발생부(Address Generation Unit) 명령어로 구성된다. 이 6개 유닛을 최대한 많이 사용하도록 하는 것이 전자계산기 성능개선의 관건이라 할 수 있다. Assume that the high-performance multi-issue DSP "starcore 1400" operates the machine language illustrated in FIG. The StarCore 1400 can run six instructions at a time, which consists of four Arithmetic Logical Unit (ALU) instructions and two Address Generation Unit instructions. Using these six units as much as possible is the key to improving the performance of your computer.

도 2의 기계어에서 최우선 경로에 관련된 데이터의존도(data dependence) 관 계는 다음과 같다. 명령어 1과 2의 d3, d4가 명령어 3에서 사용된다. 명령어 3의 d5는 명령어 6에서 사용되며 명령어 7의 d5가 명령어 8에서 사용된다. 명령어 8의 d5는 최종적으로 명령어 9에서 메모리 주소 r1에 저장된다. 이 의존 경로는 (1, 2)→(3)→(6)→(7)→(8)→(9)로 이루어지며 해당 경로의 길이는 각 명령어의 실행시간을 더한 6이 된다. 도 2의 루프에서 가장 긴 최우선 경로의 길이는 6이 되며, 이것을 의존도 그래프로 표현한 것이 도 3이다. 도 4a에 최우선 경로에 해당하는 명령어가 도시되어 있다.In the machine language of FIG. 2, the data dependency relation related to the highest priority path is as follows. Commands 1 and 2 of d3 and d4 are used in command 3. Instruction 3 d5 is used in instruction 6 and instruction 7 d5 is used in instruction 8. The d5 of instruction 8 is finally stored at memory address r1 in instruction 9. This dependent path consists of (1, 2) → (3) → (6) → (7) → (8) → (9), and the length of the path is 6 plus the execution time of each instruction. The length of the longest highest priority path in the loop of FIG. 2 is 6, which is represented by the dependency graph in FIG. In FIG. 4A, a command corresponding to the highest priority path is illustrated.

최우선 경로를 구성하는 명령어를 순차적으로 검색하여 해당 경로를 줄일 수 있는 완화 가능 대상 명령어를 찾아낸다. 이때 미리 구성되어 있는 교체 명령어 표를 사용한다. 해당 표는 도 10에 일부 나타내었으며, 이것은 멀티이슈 DSP의 명령어 집합 구조에 따라 다르게 구성된다. 도 10의 테이블은 스타코어 1400의 명령어집합(instruction set) 구조에 따라 구성된 일부 명령어이다. 도 3의 최우선 경로를 따라 검색되는 완화 가능 대상 명령어는 도 10과 비교하여 1, 2, 6, 7, 9가 된다.Sequentially searches the commands that make up the highest priority path and finds a mitigable target command that can reduce the path. At this time, use the preconfigured replacement command table. The table is shown in part in FIG. 10, which is configured differently according to the instruction set structure of the multi-issue DSP. The table of FIG. 10 shows some instructions configured according to the instruction set structure of the StarCore 1400. The relaxed target instructions retrieved along the highest priority path of FIG. 3 may be 1, 2, 6, 7, 9 as compared to FIG. 10.

1번 명령어의 경우 move.w (r10)+n0, d3와 같이 변경하면, r1로 구성되는 1번과 9번 명령어 사이의 의존관계가 변경된다. 결과적으로 도 3의 최우선 경로가 도 4c에 나타난 것처럼 3번 명령어에서 9번 명령어로 변경된다. 재구성되는 3→9의 최우선 경로는 본래의 길이 6에서 재구성 길이 4로서 이득이 2가 된다. 2, 6, 7의 경우 교체 명령어로 교체하여도 변경되는 의존 관계에 의한 이득이 없다. 9의 경우 명령어 한 개를 추가하여 이득 2를 만족시킬 수 있다. 하지만 추가되는 명령어 한 개에 의해 사용되는 리소스 오버헤드가 있으므로 이득이 동일한 경우 완화 가능 명령어 1에 우선권을 부여한다.In case of instruction 1, if change like move.w (r10) + n0, d3, dependency between instructions 1 and 9 composed of r1 is changed. As a result, the highest priority path of FIG. 3 is changed from command 3 to 9 as shown in FIG. 4C. The highest priority path of 3 → 9 to be reconstructed has gain 2 as the reconstruction length 4 from the original length 6. In case of 2, 6, and 7, there is no benefit from the dependency that is changed even if the replacement instruction is replaced. In case of 9, one additional command can satisfy gain 2. However, there is a resource overhead used by one additional instruction, so if the gains are the same, the mitigating instruction 1 is given priority.

도 4b에, 완화 가능 대상 명령어 중 찾아진 최종 완화 명령어를 교체 명령어로 변경하는 과정이 도시되어 있다. 명령어 1번 move.w (r1),d3을 move.w (r10)+n0,d3로 변경하면 1번 명령어와 9번 명령어 사이의 r1에 의한 의존도 관계가 제거되어 최우선 경로가 변경된다. 교체 명령어를 삽입함과 동시에 루프 코드의 의미론적 동일성을 유지하기 위하여 다음 과정을 진행한다. 루프 코드 이전 블록에 사용가능한 r10레지스터에 r1값을 미리 복사해두고, 1번 move.w와 9번 move.l 명령어 사이의 데이터 변경 크기 간극을 메우기 위하여 기본 옵셋 레지스터 n0에 long size 2를 할당하여 교체명령어의 교체 레지스터에 더해준다. In FIG. 4B, a process of changing the last mitigation instruction found among the mitigable target instructions into a replacement instruction is illustrated. Changing instruction 1 move.w (r1), d3 to move.w (r10) + n0, d3 removes the dependency relationship by r1 between instruction 1 and instruction 9, changing the top priority path. In order to maintain the semantic identity of the loop code while inserting the replacement instruction, proceed as follows. Copy r1 to r10 register that can be used in the block before loop code, and allocate long size 2 to basic offset register n0 to fill the data change size gap between 1st move.w and 9th move.l instruction. It is added to the replacement register of the replacement instruction.

위 과정을 끝마친 루프코드에 대하여 의존도 그래프를 재구성한 것이 도 4c에 도시되어 있다. 최우선 경로가 3→6→7→8→9로 변경되었으며 길이가 4로 줄어 루프 코드의 각 반복 당 길이 2만큼 줄어들었다. 해당 루프의 반복 횟수가 만 번이라고 가정하면 해당 루프 코드의 전체 실행시간 중에서 67%를 개선하게 된 것이다.The reconstruction of the dependency graph for the loop code after the above process is illustrated in FIG. 4C. The priority path has been changed from 3 → 6 → 7 → 8 → 9 and the length has been reduced to 4, reducing the length by 2 for each iteration of the loop code. Assuming that the loop has 10,000 iterations, we have improved 67% of the total execution time of the loop code.

재구성한 의존도 그래프를 대상으로 위 과정을 반복하여 완화 가능한 모든 명령어에 대하여 본 발명의 해당 절차를 진행한다.The above procedure is repeated for the reconstructed dependency graph, and the corresponding procedure of the present invention is performed for all the mitigable instructions.

다음에, 다른 예로서, 디스맨틀링 기법을 이용한 최우선 경로 감소 과정에 대해 설명한다. 디스맨틀링은 역 혹은 산출 의존일 경우 합성 명령어를 일반 명령어로 분리하여 레지스터 이름을 사용 가능한 다른 레지스터로 변경하여 최우선 경 로를 줄이는 기법이다. 이때 루프 코드의 의미론적 동일성을 유지하기 위하여 분리되는 일반 명령어는 합성 명령어와 동일한 기능을 하는 다수의 명령어로 변경된다. Next, as another example, the first priority path reduction process using the demantling technique will be described. Demantering is a technique to reduce the priority path in case of inverse or output dependence by separating the synthesis instruction into general instructions and changing the register name to another available register. In this case, in order to maintain the semantic identity of the loop code, the general instructions are changed into a plurality of instructions having the same function as the synthesis instructions.

고성능 멀티이슈 DSP인 스타코어 1400에서 도 6의 기계어를 동작시킨다고 가정하자. 도 6의 기계어에서 최우선 경로에 관련된 의존도 관계는 다음과 같다. 명령어 2의 d10이 명령어 3에서 사용된다. 명령어 3의 d10이 명령어 5에서 사용되며 명령어 7의 d10이 명령어 8에서 사용된다. 명령어 8의 d10은 최종적으로 명령어 9에서 메모리 주소 r4에 저장된다. 이 의존 경로는 (2)→(3)→(5)→(7)→(8)→(9)로 구성되며 해당 경로 길이는 각 명령어의 실행시간을 더한 6이 된다. 도 6의 루프에서 가장 긴 최우선 경로의 길이는 6이 되며, 이것을 의존도 그래프로 표현한 것이 도 7이다. 도 8a에 최우선 경로에 해당하는 명령어가 도시되어 있다.Assume that the machine language of FIG. 6 is operated on the StarCore 1400, a high performance multi-issue DSP. The dependency relationship related to the highest priority path in the machine word of FIG. 6 is as follows. Instruction 2 d10 is used in instruction 3. The command d10 of command 3 is used in command 5 and the command d10 of command 7 is used in command 8. The d10 of the instruction 8 is finally stored in the memory address r4 in the instruction 9. This dependent path consists of (2) → (3) → (5) → (7) → (8) → (9), and the path length is 6 plus the execution time of each instruction. The length of the longest highest priority path in the loop of FIG. 6 is 6, which is represented by the dependency graph in FIG. An instruction corresponding to the highest priority path is shown in FIG. 8A.

최우선 경로를 구성하는 명령어를 순차적으로 검색하여 해당 경로를 줄일 수 있는 완화 가능 대상 명령어를 찾아낸다. 이때 미리 구성되어 있는 교체 명령어 표를 사용한다. 이 교체 명령어 표는 도 10에 일부 나타나 있으며, 이것은 멀티이슈 DSP의 명령어집합 구조에 따라 다르게 구성된다. 도 10의 테이블은 스타코어 1400의 명령어집합 구조에 따라 구성된 일부 명령어이다. 도 7의 최우선 경로를 따라 검색되는 완화 가능 대상 명령어는 도 10과 비교하여 3, 5, 7, 8, 9가 된다.Sequentially searches the commands that make up the highest priority path and finds a mitigable target command that can reduce the path. At this time, use the preconfigured replacement command table. This replacement instruction table is shown in part in FIG. 10, which is configured differently according to the instruction set structure of the multi-issue DSP. The table of FIG. 10 shows some instructions configured according to the instruction set structure of the StarCore 1400. The mitigable target instructions retrieved along the highest priority path of FIG. 7 are 3, 5, 7, 8, and 9 compared to FIG.

7번 명령어의 경우 mac을 mpy d3,d12,d11; add d11,d10,d11와 같이 변경하면, d10으로 구성되는 2번과 9번 명령어 사이의 의존관계가 변경된다. 결과적으로 도 7의 최우선 경로가 도 8c에 나타난 것처럼 2번 명령어에서 7번 명령어로 변경된다. 재구성되는 2→7의 최우선 경로는 본래의 길이 6에서 재구성 길이 3으로서 이 득이 3이 된다. 3, 5, 9의 경우 교체 명령어로 교체하여도 변경되는 의존 관계에 의한 이득이 없다. 8의 경우 명령어 7의 경우처럼 합성 명령어를 분리하여 9번에서 2번으로의 경로를 제거함으로써 이득 1을 만족시킬 수 있다. 하지만 명령어 7에서 이득이 가장 높음으로 최종 완화 명령어는 7번으로 결정된다.For command 7, mac is replaced by mpy d3, d12, d11; If add d11, d10, d11, and so on, the dependency between instructions 2 and 9 composed of d10 is changed. As a result, the highest priority path of FIG. 7 is changed from command 2 to command 7 as shown in FIG. 8C. The highest priority path of 2 → 7 to be reconstructed has a gain of 3 as the reconstruction length 3 from the original length 6. In the case of 3, 5, and 9, there is no benefit from the dependency that is changed even if the replacement instruction is replaced. In case of 8, gain 1 can be satisfied by separating the synthesis instruction and removing the path from 9 to 2 as in the case of instruction 7. However, since the gain is the highest in instruction 7, the final mitigation instruction is determined as seven.

도 8b에 완화 가능 대상 명령어 중 찾아진 최종 완화 명령어를 교체 명령어로 변경하는 과정이 도시되어 있다. 명령어 7번을 일반 명령어로 분리할 때 사용되는 d11은 데이터플로우 분석을 통하여 얻어진 결과로서 해당 루프에서 사용가능한 레지스터 중 하나이다. d10의 값을 d11로 변경하면 2번 명령어와 9번 명령어 사이의 d10에 의한 의존도 관계가 제거되어 최우선 경로가 변경된다. 8B illustrates a process of changing the final mitigation instruction found among the mitigable target instructions into a replacement instruction. D11, which is used to separate instruction 7 into normal instructions, is one of the registers available in the loop as a result of dataflow analysis. Changing the value of d10 to d11 removes the dependency relationship by d10 between commands 2 and 9, changing the top priority path.

위 과정을 끝마친 루프코드에 대하여 의존도 그래프를 재구성한 것이 도 8c에 도시되어 있다. 최우선 경로가 2→3→5→7로 변경되었으며 길이가 3으로 줄어 루프 코드의 각 반복 당 길이 3만큼 줄어든다. 해당 루프의 반복 횟수가 만 번이라고 가정하면 해당 루프의 총 실행시간이 두 배 빠르게 개선되는 것이다.The reconstruction of the dependency graph for the loop code after the above process is illustrated in FIG. 8C. The priority path has been changed from 2 → 3 → 5 → 7 and the length has been reduced to 3, reducing the length by 3 for each iteration of the loop code. Assuming that the loop has 10,000 iterations, the total execution time of that loop is twice as fast.

재구성한 의존도 그래프를 대상으로 위 과정을 반복하여 완화 가능한 모든 명령어에 대하여 본 발명의 해당 절차를 진행한다.The above procedure is repeated for the reconstructed dependency graph, and the corresponding procedure of the present invention is performed for all the mitigable instructions.

이상에서는 본 발명의 바람직한 실시예에 대해서 도시하고 설명하였으나, 본 발명은 상술한 특정의 실시예에 한정되지 아니하며, 청구범위에서 청구하는 본 발명의 요지를 벗어남이 없이 당해 발명이 속하는 기술분야에서 통상의 지식을 가진 자라면 누구든지 다양한 변형 실시가 가능한 것은 물론이고, 그와 같은 변경은 청 구범위 기재의 범위 내에 있게 된다.Although the preferred embodiments of the present invention have been illustrated and described above, the present invention is not limited to the specific embodiments described above, and the present invention is not limited to the specific embodiments of the present invention without departing from the spirit of the present invention as claimed in the claims. Anyone of ordinary skill in the art can make various modifications, and such changes are within the scope of the claims.

본 발명은 소프트웨어 파이프라이닝을 지원하는 전처리 기법으로서 의존도 그래프 상의 최우선 경로의 길이를 줄임으로써 루프의 성능을 효율적으로 개선시키는 방안을 제안한다. 이를 위해서 최우선 경로상의 완화 가능 대상 명령어들을 순차적으로 검색하고 이를 대상으로 성능 개선 이득을 계산하여 가장 이득이 높은 최종 완화 명령어를 교체명령어로 변경하여 의존 관계를 완화시킨다. 이를 통해서 루프의 성능 개선과 더불어 멀티이슈 DSP의 리소스 사용률 역시 높이게 된다. The present invention proposes a method for efficiently improving the performance of a loop by reducing the length of the priority path on the dependency graph as a preprocessing technique supporting software pipelining. To this end, the mitigation targets on the highest priority path are sequentially searched for, and the performance improvement gains are calculated from the targets. This improves loop performance and increases resource utilization of multi-issue DSPs.

Claims (9)

소프트웨어 파이프라이닝의 대상이 되는 응용 프로그램의 루프 코드에 있어서의 데이터 의존도를 완화하는 방법으로서, As a method of mitigating data dependence in loop code of an application that is subject to software pipelining, 1) 대상이 되는 루프 코드에 대한 기계어에 대해서 작성된 데이터 의존도 그래프를 대상으로 모든 경로를 검색하고, 이 중 루프의 실행시간을 결정 짓는 가장 긴 경로를 구성하는 최우선 경로를 찾아내는 단계;1) searching all the paths of the data dependency graph created for the machine language for the target loop code, and finding the highest priority path constituting the longest path that determines the execution time of the loop; 2) 상기 최우선 경로들을 대상으로 교체 가능 명령어 테이블을 구성하고, 교체 가능 명령어 테이블을 참조하여 최우선 경로를 검색함으로써, 최우선 경로 길이가 가장 작은 명령어를 의존도 완화 가능한 명령어로서 찾아내는 단계;2) constructing a replaceable instruction table for the highest priority routes and searching for the highest priority route by referring to the replaceable instruction table, thereby finding an instruction having the smallest priority path length as an instruction that can alleviate dependencies; 3) 상기 단계에서 찾은 완화 가능 대상 명령어를 교체명령어로서 교체하여 의존 관계를 변경하는 단계를 포함하는, 소프트웨어 파이프라이닝의 데이터 의존도 완화방법.3) changing the dependency by replacing the mitigable target instruction found in the step as a replacement instruction. 제1항에 있어서, The method of claim 1, 상기 3)단계에서 변경된 루프코드를 대상으로 의존도 그래프를 재구성하는 단계가 추가로 포함되어, Reconstructing the dependency graph for the loop code changed in step 3) is further included. 다시 최초의 단계(즉, 1)단계)로 되돌아가 이후의 단계를 반복하는 것을 특징으로 하는, 소프트웨어 파이프라이닝의 데이터 의존도 완화 방법. And returning to the first step (i.e., step 1)) and repeating the subsequent steps. 제1항에 있어서, The method of claim 1, 상기 2)단계에서 최우선 경로에 의존도 완화 가능한 명령어가 없으면 이후의 절차를 종료하는 단계가 추가로 포함되는, 소프트웨어 파이프라이닝의 데이터 의존도 완화 방법.If there is no instruction that can reduce the dependence on the priority path in the step 2), the step further comprises the step of terminating the data dependency of software pipelining. 제1항 또는 제2항에 있어서, The method according to claim 1 or 2, 상기 3)단계에서, 최우선 경로 길이가 가장 작은 명령어를 찾는데 있어서, 경로길이 상의 이득이 가장 큰 명령어를 최종 완화 가능 명령어로서 결정하는 것을 특징으로 하는, 소프트웨어 파이프라이닝의 데이터 의존도 완화 방법.In step 3), in finding the instruction having the smallest priority path length, the method having the greatest gain on the path length is determined as the final mitigable instruction. 제4항에 있어서, 상기 이득은 The method of claim 4, wherein the gain is (이득) = (본래 최우선 경로 길이) - (재구성 최우선 경로 길이)인 것을 특징으로 하는, 소프트웨어 파이프라이닝의 데이터 의존도 완화 방법.(Gain) = (originally highest priority path length)-(reconstruction highest priority path length). 제4항에 있어서, 2) 단계에서 교체가능 명령어 테이블에 따라 최우선 경로를 순차적으로 검색할 경우에, The method of claim 4, wherein in the step 2), when the first priority path is sequentially searched according to the replaceable instruction table, 검색되는 각 시점에서 해당 명령어를 포함하는 모든 경로를 함께 레코드함으로써 최종 완화 명령어를 교체 명령어로 교체하여 의존도 관계를 완화하는 시점에서 다른 경로 길이를 늘이는 반작용 효과를 발생시키는 경우, 이를 최우선 경로 선정을 위한 이득 계산에 반영하는 것을 특징으로 하는, 소프트웨어 파이프라이닝의 데이터 의존도 완화 방법.If all the paths containing the instruction are recorded together at each point in time that is retrieved, replacing the final mitigation instruction with a replacement instruction produces a reaction effect that increases the length of the other path at the point of mitigation of the dependency relationship. A method for mitigating data dependency of software pipelining, which is reflected in the gain calculation. 제4항에 있어서, 상기 2)단계는 The method of claim 4, wherein step 2) 상기 교체가능 명령어 테이블을 구성하는 시점에서 파이프라이닝을 수행하는 디지털신호처리기 명령어집합 구조에 따라 의미론적으로 동일한 명령어들의 집합을 선정하는 단계,Selecting a set of semantically identical instructions according to a structure of an instruction set of a digital signal processor performing pipelining at the time of constructing the replaceable instruction table; 상기 집합을 구성하고 있는 각 명령어들의 상호 관계에 따라 교체 명령어의 증감을 결정하는 단계,Determining the increase or decrease of the replacement command according to the mutual relationship of each command constituting the set, 상기 증감 크기에 따라 리소스에 관한 이득을, 이득 크기 계산에 반영하는 단계를 포함하는 것을 특징으로 하는, 소프트웨어 파이프라이닝의 데이터 의존도 완화 방법.And reflecting the gains about the resource in the gain magnitude calculation according to the increase and decrease magnitudes. 제1항에 있어서, 상기 2)단계는 The method of claim 1, wherein step 2) 상기 교체가능 명령어 테이블을 구성하는 시점에서 파이프라이닝을 수행하는 디지털신호처리기 명령어집합 구조에 따라 의미론적으로 동일한 명령어들의 집합을 선정하는 단계,Selecting a set of semantically identical instructions according to a structure of an instruction set of a digital signal processor performing pipelining at the time of constructing the replaceable instruction table; 상기 집합을 구성하고 있는 각 명령어들의 상호 관계에 따라 교체 명령어의 증감을 결정하는 단계를 포함하는 것을 특징으로 하는, 소프트웨어 파이프라이닝의 데이터 의존도 완화 방법.And determining the increase or decrease of the replacement instruction according to the interrelationship of each instruction constituting the set. 제1항에 있어서, 2) 단계에서 교체가능 명령어 테이블에 따라 최우선 경로를 순차적으로 검색할 경우에, The method of claim 1, wherein in the step 2), if the first priority path is sequentially searched according to the replaceable instruction table, 검색되는 각 시점에서 해당 명령어를 포함하는 모든 경로를 함께 레코드함으로써, 최종 완화 명령어를 교체 명령어로 교체하여 의존도 관계를 완화하는 시점에서 다른 경로 길이를 늘이는 반작용 효과를 발생시키는 경우를 최우선 경로 선정에 반영하는 것을 특징으로 하는, 소프트웨어 파이프라이닝의 데이터 의존도 완화 방법.By recording all the paths that contain the command at each point in time that is retrieved, the highest priority path selection reflects the case in which the final relaxation command is replaced with a replacement command to produce a reaction effect that increases the other path lengths at the time of easing the dependency relationship. A method for mitigating data dependence of software pipelining, characterized in that.
KR1020060111260A 2006-11-10 2006-11-10 Method of reducing data dependence for software pipelining KR100829167B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020060111260A KR100829167B1 (en) 2006-11-10 2006-11-10 Method of reducing data dependence for software pipelining

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020060111260A KR100829167B1 (en) 2006-11-10 2006-11-10 Method of reducing data dependence for software pipelining

Publications (1)

Publication Number Publication Date
KR100829167B1 true KR100829167B1 (en) 2008-05-13

Family

ID=39650294

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020060111260A KR100829167B1 (en) 2006-11-10 2006-11-10 Method of reducing data dependence for software pipelining

Country Status (1)

Country Link
KR (1) KR100829167B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20120040630A (en) * 2010-10-19 2012-04-27 삼성전자주식회사 Reconfigurable processor and method for processing loop having memory dependency

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5560028A (en) 1993-11-05 1996-09-24 Intergraph Corporation Software scheduled superscalar computer architecture
KR20040080520A (en) * 2003-03-12 2004-09-20 (주)자람테크놀로지 A digital signal processor for parallel processing of instructions and its process method
KR20060010004A (en) * 2004-07-27 2006-02-02 재단법인서울대학교산학협력재단 Code reduction method through multiple load-store instructions

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5560028A (en) 1993-11-05 1996-09-24 Intergraph Corporation Software scheduled superscalar computer architecture
KR20040080520A (en) * 2003-03-12 2004-09-20 (주)자람테크놀로지 A digital signal processor for parallel processing of instructions and its process method
KR20060010004A (en) * 2004-07-27 2006-02-02 재단법인서울대학교산학협력재단 Code reduction method through multiple load-store instructions

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20120040630A (en) * 2010-10-19 2012-04-27 삼성전자주식회사 Reconfigurable processor and method for processing loop having memory dependency
KR101722695B1 (en) 2010-10-19 2017-04-04 삼성전자주식회사 Reconfigurable processor and method for processing loop having memory dependency

Similar Documents

Publication Publication Date Title
JP4745341B2 (en) System, method and apparatus for dependency chain processing
Schoeberl et al. Towards a time-predictable dual-issue microprocessor: The Patmos approach
Catthoor et al. Data access and storage management for embedded programmable processors
Yang et al. A GPGPU compiler for memory optimization and parallelism management
JP5707011B2 (en) Integrated branch destination / predicate prediction
US8407715B2 (en) Live range sensitive context switch procedure comprising a plurality of register sets associated with usage frequencies and live set information of tasks
JP2004302706A (en) Program parallelization device, program parallelization method, and program parallelization program
JPWO2012105593A1 (en) Data flow graph processing apparatus, data flow graph processing method, and data flow graph processing program
GB2380825A (en) Compiling methods for parallel processing
US11226798B2 (en) Information processing device and information processing method
Glossner et al. Trends in compilable DSP architecture
Kelefouras et al. A methodology for speeding up fast fourier transform focusing on memory architecture utilization
KR100829167B1 (en) Method of reducing data dependence for software pipelining
Feng et al. Evaluation of compilers’ capability of automatic vectorization based on source code analysis
Du et al. Scientific computing applications on the imagine stream processor
Eisenbeis et al. Optimal software pipelining in presence of resource constraints
Hong et al. Rapid prototyping of DSP algorithms on VLIW TMS320C6701 DSP
Zhuang et al. A framework for parallelizing load/stores on embedded processors
JP2023002165A (en) Compiler and compilation method
US11734003B2 (en) Non-transitory computer-readable recording medium, compilation method, and compiler device
CN116168765B (en) Gene sequence generation method and system based on improved stroboemer
JPH10105412A (en) Object generating method realizing efficient access of main storage
Wang et al. VNEC: A Vectorized Non-Empty Column Format for SpMV on CPUs
Azevedo Filho et al. Scalar processing overhead on SIMD-only architectures
Keckler et al. Combined branch target and predicate prediction

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20130703

Year of fee payment: 6

FPAY Annual fee payment

Payment date: 20140425

Year of fee payment: 7

FPAY Annual fee payment

Payment date: 20150430

Year of fee payment: 8

LAPS Lapse due to unpaid annual fee