-source-code --> FRONT-END - intermediate-code --> CODE-OPTIMIZER - intermediate-code --> CODE-GENERATOR - target-code -->
;
FOR (result=0, i=1; i<10; i++) result += a[i] * b[i]; 1 result := 0 2 i := 1 3 t1 := 4 * i -- 4 is the element size of a 4 t2 := a[t1] 5 t3 := 4 * i -- 4 is the element size of b 6 t4 := b[t3] 7 t5 := t2 * t4 8 t6 := result + t5 9 result := t6 10 t7 := i+1 11 i := t7 12 IF i < 10 GOTO 3
FOR block B IN loop L LOOP count += use(x, B) + 2*live(x, B); END LOOP;
FOR (result=0, i=1; i<10; i++) result += a[i] * b[i]; 3 t1 := SIZEOF *a * i 4 t2 := a[t1] 5 t3 := SIZEOF *b * i 6 t4 := b[t3] 7 t5 := t2 * t4 8 t6 := result + t5 9 result := t6 10 t7 := i + 1 11 i := t7 12 IF i < 10 GOTO 3