Presentation is loading. Please wait.

Presentation is loading. Please wait.

New approach to register allocation and instruction scheduling, using DNA Computing 2001-30593 이제형 2002-30447 최형규.

Similar presentations


Presentation on theme: "New approach to register allocation and instruction scheduling, using DNA Computing 2001-30593 이제형 2002-30447 최형규."— Presentation transcript:

1 New approach to register allocation and instruction scheduling, using DNA Computing
이제형 최형규

2 DNA Computing Register Allocation
이제형

3 Register Allocation Compiler 의 code generation 단계에서 무한개로 가정했던 pseudo register 들을 유한개의 machine register 에 할당하는 작업 목적 유한개의 machine register 로 assign 이 불가능할 경우 메모리를 불가피하게 사용하는 spill 을 최소화하여 code size 및 memory usage 를 줄임 Move 명령의 source 와 destination 을 동일한 하나의 register 로 할당하여 move 명령의 제거(coalescing)

4 Graph Coloring Map coloring 문제에서 출발. 대표적인 NP-complete 문제의 하나
Chaitin 이 Register Allocation 을 Graph Coloring 의 범주에 끌어들여 Compiler 에 적용. 그의 algorithm 이 가장 널리 쓰이고 있음 현재 DNA computing 분야에서의 Graph Coloring 연구 영역 Adleman , Lipton 등이 시도한 3-coloring 문제 2차 유클리드 공간에서의 4-coloring 문제

5 Interference Graph enter: c <- r3 a <- r1 b <- r2 d <- 0
Copy Precolored enter: c <- r3 a <- r1 b <- r2 d <- 0 e <- a loop: d <- d + b e <- e - 1 if e > 0 goto loop r1 <- d r3 <- c return (r1, r3 live out)

6 전체적인 시스템 구성 Pseudo register 에 대한 interference graph 생성
Coalescing 을 통한 graph 의 간략화 DNA encoding DNA computing 수행 DNA decoding 결과에 따라 register allocation 일부 node 를 spill 해가 존재? DNA Computing

7 Adleman 의3-coloring Algorithm
Input(T) for k = 1 to z : A: Tblue = +(T, bi), Tred or green = -(T, bi) B: Tred = +(Tred or green, ri) Tgreen = -(Tred or green, ri) C: Tgoodblue = -(Tblue, bj) D: Tgoodred = -(Tred, rj) E: Tgoodgreen = -(Tgreen, gj) F: T’ = U(Tgoodred, Tgoodblue) G: T = U(Tgoodgreen, T’) Where ek = <i, j>   Output(Detect(T))

8 DNA coding 의 예 node 의 coding(r,g,b 3가지 색, node 가 5개의 경우) edge 의 coding
e(i; b, b), e(i; b, r), e(i; b, g), e(i; r, b), e(i; r, r), e(i; r, g), e(i; g, b), e(i; g, r), e(i; g, g) 생성될 수 있는 DNA 결합(brrbg) i v(b, i) v(r, i) v(g, i) v’(b, i) v’(r, i) v’(g, i) 1 AACAAG CACCAG GAAGAC TTGTTC GTGGTC CTTCTG 2 AATACA CATCCA GAGGAT TTATGT GTAGGT CTCCTA 3 ACCACG CCGCCT GCAGCC TGGTGC GGCGGA CGTCGG 4 ACTAGA CGACGC GCGGCT TGATCT GCTGCG CGCCGA 5 AGCAGG CGGCGT GTAGTC TCGTCC GCCGCA CATCAG v(b, 1) v(r, 2) v(r, 3) v(b, 4) v(g, 5) e(1; b, r) e(2; r, r) e(3; r, b) e(4; b, g)

9 DNA computing 단계 생성된 node, edge DNA 조각들을 시험관 T 에 넣음
하나의 edge 에 연결된 node에 대해 동일한 color 로 구성된 염색체를 걸러내고 남은 염색체를 새로운 시험관에 담음 모든 색깔에 대해 동일한 과정을 반복하여 새로운 시험관에 담음 2와 3의 과정으로 생성된 새로운 시험관의 내용물을 모두 합쳐 새로운 시험관에 담음 4의 결과물로 부터 새로운 edge 에 대해 1의 과정부터 반복 모든 edge 에 대해 위의 과정을 모두 마쳤으면, 이제 시험관에 남은 DNA 조각 중 어느것이라도 register allocation 의 조건을 만족

10 DNA Computing Instruction Scheduling
최형규

11 Instruction Scheduling
Program Dependency DAG Solutions 1 3 4 6 2 5 7 . . . 1 2 3 4 5 6 7 1 r1[r12+0] 2 r2[r12+4] 3 r1r1+r2 4 [r12,0] r1 5 r1r12+8 6 r2[r12+12] 7 r2r1+r2 1 2 6 7 8 9 13 1 2 3 6 4 5 7 1 2 6 7 8 9 11 analysis schedule Solutions Any topologically sorted order can be solution Best Solution We want best solution with least cost cost =

12 What’s the problem? Analysis Schedule Program  dependency DAG
O(n2), but O(n) in practice Schedule Finding any one solution : Easy Finding best solution : NP-Hard problem

13 Hybrid Approach 1 Make Dependency DAGs (silicon computer)
Pre-processing (silicon computer) Make Hamiltonian graph from Dependency Graph Solve Hamiltonian Path Problem(DNA Computer) Get set of all valid path Post-processing (silicon computer) Find best solution which have least cost

14 Preprocessing Dependency DAGHamiltonian Graph
O(n2) algorithm for each node I { for each node j except I { if(node i and j can be schedule at same time && node i is not reachable from node j) Add bi-directional edge } add node0 Dependency DAG Hamiltonian Graph 1 3 4 6 2 5 7

15 PostProcessing Assumption If total k kind of solutions are acquired
We can count how many kind of valid paths are in set of solutions. If total k kind of solutions are acquired Evaluate each kind of solutions Evaluation time : O(n), where n is # of nodes Total complexity O(k*n) But k can be n! in worst case!!!

16 Hybrid Approach 2 Make Dependency DAGs (silicon computer)
Pre-processing (silicon computer) Make Weighted-Hamiltonian-Graph from Dependency Graph Solve Travel Salesman Problem (DNA Computer) Get set of all valid path sorted by total cost Post-processing (silicon computer) Calculate cost of solutions in sorted order

17 Preprocessing Dependency DAGWeighted Hamiltonian Graph
We can’t conver dependency graph into weighted hamiltonian graph w/o information loss. Heuristic Algorithm Almost same with previous O(n2) algorithm Only difference is this allocate minimum weight for edges in Hamiltonian Graph. Dependency DAG Hamiltonian Graph 1 3 4 6 2 5 7

18 Solve Travel Salesman Problem
가능한 두 node들 사이의 경로 조각들을 제작한다. 이 때 경로 조각에는 방사능 동위원소의 방사능 세기를 이용하여 weight를 표시하게 된다 이렇게 제작한 경로 조각들을 Hybridization과 Ligation을 통하여 경로 조각들이 서로 붙도록 만든다. 그리고 PCR(Polymerase Chain Reaction)을 통하여 원하는 path들을 증가시킨다. 예를 들어 특정 node0로 시작하는 path를 복제한다. 이제 총 n개의 node로 이루어진 path를 찾기 위하여 전기연동법(Gel electrophoresis)을 이용하여 길이가 n*(경로조각의 길이)인 사슬들만을 선택한다 bead separation이나 혹은 다른 필터링 기법을 거쳐 각 node들을 한번씩 방문한 경로들을 선택한다. 방사능 세기가 작은 해부터 찾는다.(DNA computing) 찾은 해의 실제 필요 cycle을 계산한다. (silicon computer), O(n) 최소 해를 찾을 때까지 반복

19 PostProcessing Almost same as previous Hybrid Approach 1
But we reduces total complexity! Hybrid Approach 1 : We should evaluate all solutions Hybrid Approach 2 : We don’t have to evaluate all. And in most case, We have to evaluate only one best solution by DNA computing. e.g. example case in this material


Download ppt "New approach to register allocation and instruction scheduling, using DNA Computing 2001-30593 이제형 2002-30447 최형규."

Similar presentations


Ads by Google