d code motion fori0 i100 i Xi10AjYi TP10Aj
- Slides: 32
(d) コード移動 code motion for(i=0; i<100; i++) X[i]=10*A[j]+Y[i] TP=10*A[j] for(i=0; i<100; i++) X[i]=TP+Y[i]
(e) ループ制御変数の除去 induction variable elimination for(i=0; i<100; i++) C[i]=A[j]*B[i] 1. 2. 3. 4. 5. 6. 7. 8. i = 0 goto 0004 i = i + 1 if not(i<100) goto 8 p = 4 * i C[p]=A[p]*B[p] goto 3 1. 2. 3. 4. p = 0 goto 0004 p = p + 4 if not(p<400) goto 7 5. C[p]=A[p]*B[p] 6. goto 3 7.
(3) 制御の流れ解析 control flow analysis 原始プログラムを基本ブロック(basic block)と 分岐の形に変換して解析する。 for(i=0; i<N; i++) if(A[I]==X) goto L 1; F = 0; goto L 2 L 1: F = 1; L 2: 1. i = 0 2. goto 0004 3. i = i + 1 4. if not(i<N) goto 8 5. p = 4 * i 6. if A[p]=X goto 10 7. goto 3 8. F = 0 9. Goto 11 10. F = 1 11.
(a) 流れグラフ flow graph 基本ブロック内を局所的(local) 基本ブロックにまたがる関係を大域的(global) 1. i = 0 2. goto 0004 3. i = i + 1 4. if not(i<N) goto 8 5. p = 4 * i 6. if A[p]=X goto 10 7. goto 3 8. F = 0 9. Goto 11 10. F = 1 11. B 1 i = 0 B 2 i = i + 1 B 3 if not(i<N) goto 8 B 4 p = 4 * i if A[p]=X goto 10 B 6 F = 1 B 5 F = 0
到達可能性の処理(1) Private History(100) As Integer Private List. Data(100, 100) As Integer Private Num. List(100) As Integer Private Pnt. List As Integer Private Function Hsearch(Bno, History, P) History(P + 1) = Bno k = 1 Do While History(k) <> Bno k = k + 1 Loop Hsearch = k End Function Sub 登録(History, P) Pnt. List = Pnt. List + 1 Num. List(Pnt. List) = P For k = 1 To P List. Data(Pnt. List, k) = History(k) Next End Sub
到達可能性の処理(2) Sub 到達可能性リスト(Bno, History, P) If Bno = 0 Or Hsearch(Bno, History, P) <= P Then 登録 History, P Else With Worksheets("Sheet 1") History(P + 1) = Bno num = Val(. Cells(Bno + 1, 2)) If num = 0 Then 登録 History, P + 1 Else For k = 1 To num next. Bno = Val(. Cells(Bno + 1, k + 2)) 到達可能性リスト next. Bno, History, P + 1 Next End If End With End If End Sub
到達可能性の処理(3) Sub 表示() With Worksheets("Sheet 2"). Cells(1, 1) = Pnt. List For i = 1 To Pnt. List. Cells(i + 1, 1) = i. Cells(i + 1, 2) = Num. List(i) For k = 1 To Num. List(i). Cells(i + 1, k + 2) = List. Data(i, k) Next End With End Sub ボタン 1_Click() Pnt. List = 0 For i = 1 To 6 到達可能性リスト i, History, 0 Next 表示 End Sub
処理の流れ (for(B≠ B 1) は、 B 1 以外の各ブロックBに対して行うという意味) in[B 1]=φ; out[B 1]=φ; for(B≠ B 1) U- e_kill[B] change=true; while (change){ change=false; for(B≠ B 1) {in[B]=∩ out[P]; /* Pは直前のブロック */ oldout=out[B]; out[B]=(in[B]- e_kill[B])∪ e_gen[B]; if(oldout ≠ out[B])change=true; } }
- Mies i100
- Mies i100
- Code commit code build code deploy
- What is active rom
- Harmonic equation physics
- An object in motion stays in motion
- Chapter 2 motion section 1 describing motion answer key
- Describing and measuring motion
- Section 1 describing motion worksheet answer key
- Describing motion chapter 1 lesson 1
- Section 1 describing motion
- Loop invariant code motion
- Lazy code motion
- Code élaboré code restreint
- Managed code unmanaged code
- Apa itu assembly language
- Difference between source code and machine code
- What is code mixing
- Trace the code genetic code table
- It is also known as simply "air in motion".
- The only force acting on a projectile is
- Symmetrical projectile motion
- Webquest types of forces answers
- Transverse velocity
- Lapping diagram warp knitting
- Relative velocity
- Vy=vyo-gt
- Linear motion equations
- Chapter 9 motion and energy answer key
- What is a balanced force
- Relativistic circular motion
- E you
- Kinematic equations rearranged